I have installed VirtualBox 2.0.2 on Ubuntu 8.04. It really works perfect. There is only one thing I like to do. I want to configure a network setting that is capable to connect to the guest machines and the host, but NOT to the "outside" (e.g. internet).
The reason is I want to use the printer connected to the host in my guest machine. It is a usb printer, but connecting this printer with the virtual USB connection claims the USB printer. After shutting down the guest the printer is not released and cannot be used by the host any longer. You have to restart the host to make the printer usable again. This is not desirable to say the least.
The only way around this is to use SAMBA and share the printer in the network. The guest however, must be kept isolated from the internet. So what I need is a connection to the printer in the local network on the host, but without any connection to the "outside". The host, however, must be able to connect and surf the internet. I have used VMware server and this has a setting called "local" that does just that. However - I want to switch to VirtualBox (being fully open source), and the "local" setting is sadly not the same as with VMware.
What did i tried until now...
Using NAT connects the guest to the internet, so that is out of the question. Using local only connects the guests, but not the host to the guests. So this is also no solution.
So i had to setup a Host Interface. My local host has IP address 10.0.0.12, and the gateway 10.0.0.2 (it is a local network with modem/router configured with static addresses)
I edited the /etc/network/interfaces file to read:
auto lo
iface lo inet loopback
auto tap0
iface tap0 inet manual
tunctl_user myusername
uml_proxy_arp 10.0.0.12
uml_proxy_ether eth0
auto br0
iface br0 inet static
address 10.0.0.12
netmask 255.255.255.0
gateway 10.0.0.2
bridge_ports eth0 tap0
bridge_maxwait 0
And set networking in VirtualBox to Host Interface with interface name tap0
This works. My guest can connect to the host computer and can use the printer. However - it also can connect to the internet! Needless to say that is NOT desirable.
My knowledge of networking is not that strong. Can anyone tell me what I have to change in the above settings to make a connection to the host, but not to the outside world? I know it is possible, but I don't know how to do this...
Oh - and sorry about my poor English - it is not my native language..
How to configure local only network?
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
Loose the bridge, set an IP on the TAP interface and one in the same range on the Guest. Enjoy
. Use search for other topics just like yours. In both Using VB and Windows Hosts is a more detailed explanation.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.