|
Configuration: (K)Ubuntu 8.04 VirtualBox 1.6.2 I've had problems with NAT networking for some time. I was getting periodic long delays in network response on the order of 1-2 minutes. Particularly in Lotus Notes. Very annoying to say the least. I've searched the internet for anyone else reporting the same or similar problem. Looks like I'm alone. So, I decided to try something other than NAT. Enter; Host Inteface Networking.
Carefully following the instruction in the manual section 6.7. Specifically the following excerpt;
---
6.7.1.1 Debian and Ubuntu hosts To set up a permanent host interface on a modern Debian or Ubuntu host, follow these steps: 1. First install the bridge utilities (bridge-utils). package. You can do this from the command line as follows:
sudo apt-get install bridge-utils
2. Next, you must add an entry to the file /etc/network/interfaces to de- scribe the bridge. The following sample entry creates a bridge called br0, adds the host ethernet interface eth0 to it and tells it to obtain an IP address using DHCP so that the host remains able to access the network.
auto br0 iface br0 inet dhcp bridge_ports eth0
You will probably want to change this to suit your own networking needs. In particular, you may want to assign a static IP address to the bridge. You will find more documentation in the files a) /usr/share/doc/bridge-utilities/README.Debian.gz and b) /usr/share/doc/ifupdown/examples/network-interfaces.gz. 3. Restart networking on the host:
sudo /etc/init.d/networking restart
After this the bridge will be recreated every time you boot your host system.
4. Now, to create a permanent host interface called vbox0 (all host interfaces cre- ated in this way must be called vbox followed by a number) and add it to the network bridge created above, use the following command (see chapter 6.7.1.5, Host Interface Networking utilities for Linux, page 81 for more details): sudo VBoxAddIF vbox0 <user> br0
Replace <user> with the name of the user who is supposed to be able to use the new interface.
To tell VirtualBox to use the interface, select the virtual machine which is to use it in the main window of the VirtualBox application, configure one of its network adapters to use Host Interface Networking (using “Settings”, “Network”, “Attached to”) and enter vbox0 into the “Interface name” field. You can only use a given interface (vbox0, vbox1 and so on) with a single virtual network adapter.
Alternatively, you can use the VBoxManage command line tool (in this example we are attaching the interface to the first network card of the virtual machine “My VM”):
VBoxManage modifyvm "My VM" -hostifdev1 vbox0 ---
One caveat that's not listed above is the need to change permissions or make sure the Vbox user is a member the the same group as the file /dev/net/tun. On my system the owner and group are "root". Rather than make users a member of the "root" group I opted to change the permissions on the file to 666.
Since I've made the above modifications the problem appears to be gone (fingers crossed). I'm also finding improved performance in Windows applets such as Add/Remove Printer and Computer Management.
8/26 - Update: The problem was not resolved with the above. After reboot the host Linux system would not bind to the NIC card. I was able to get an internet connection with VM. In the end I added a second NIC to the machine. Set both to Auto DHCP in /etc/network/interfaces. Configured the VM to use Network Adapter 1 (NAT). My logic here is that Linux will normally only use 1 NIC at a time(usually eth0). Eth1 is left to deal with the requirements of VirtualBox. Based on my results, I've concluded that VirtualBox has some difficulty sharing a NIC between host and virtual Machine in v1.6.2. Hopefully it's gone in subsequent versions.
|