VirtualBox – ubuntu host vista guest Host Interface Networking via Wireless
Posted by lhe | Posted in Leiv Hendrickx, Linux (Ubuntu) | Posted on 25-03-2009
4
Wireless Networking
Setting up a normal bridged network generally doesn’t work if you’re bridging from a wireless card to VirtualBox. A simple script that utilises the parprouted tool will allow your VM full access to the wireless network.
You will require parprouted to do this:
sudo apt-get install parprouted
Next, using your favorite text editor, create and edit the script, for example:
sudo nano /etc/network/if-up.d/vbox_network
Then, enter the script replacing $USER with your username or whoever you intend to run virtualbox as. Replace wlan0 with the name of your wireless interface. Use an available IP address on your network for tap0 I have used 192.168.1.100 in this case:
sysctl net.ipv4.ip_forward=1 VBoxTunctl -b -u $USER ip link set tap0 up ip addr add 192.168.1.100/24 dev tap0 parprouted wlan0 tap0
Finally, make sure the new file is executable by root:
sudo chmod 700 /etc/network/if-up.d/vbox_network
Now your networking script is installed, the virtual interface tap0 will be available on boot for VirtualBox. Rather than reboot, let’s just run the script now:
sudo /etc/network/if-up.d/vbox_network
The final thing to do is tell VirtualBox to use the new virtual device tap0. Open VirtualBox, highlight a VM and click settings. Now choose the network option and select Host Interface on the ‘attached to’ drop down menu. In the Interface Name text box, enter: tap0
Click ok and start your VM. The VM should now behave as though it was another physical machine on your network
For more information on the process up to this point, please visit Bridged Networking with VirtualBox on Linux Hosts
Using DHCP in the Guest VM
It was possible to get DHCP to work on the guest virtual machine. Instructions were taken from here. Because parprouted does not relay multicast, we need to use an additional helper daemon to manage this. I tried dhcp-helper and bcrelay, and had the most success with bcrelay.
Use it as follows:
sudo apt-get install bcrelay sudo bcrelay -i tap0 -o wlan0
At this point, my /etc/network/if-up.d/vbox_network is as follows:
#/bin/sh sysctl net.ipv4.ip_forward=1 VBoxTunctl -b -u jacob ip link set tap0 up ip addr add 192.168.1.200/32 dev tap0 parprouted tap0 wlan0 route add -net 192.168.1.0 netmask 255.255.255.0 tap0 bcrelay -i tap0 -o wlan0



Hi , I tired this proceedure however, the virtual machine has no real IP yet. It does have an IP when using the ethernet cable eth0. I am running VirtualBox 2.2 with the host Ubuntu 9.04 and an Ubuntu 8.10 virtual machine …. any ideas ?
Hi Avron
when using Ubuntu Jaunty (9.04) and the latest version of Virtualbox, you should be able to choose WLAN0, which is your wireless host connection.
However, i have not yet succeeded in getting a PPTP vpn working from the Vista guest in this configuration.
Let me know if this worked out for you.
cheers
Leiv
Leiv,
Amazingly after a reboot and simply changing eth0 to Wlan0 in the settings of the virtual machine I now have a valid IP. Many thanks for the help !
Np!