Search This Blog

Wednesday, August 17, 2011

VirtualBox bridged network to wlan0

I needed to connect a Windows XP VM in VirtualBox 4.0.12 to a PPTP network. To do that, you have to use bridged networking (NAT won't work). The problem was, when I switched to bridged mode while on my wireless network, the network in the VM stopped working. The virtual network card said it was connected, but it couldn't get a DHCP address or anything.

Since it worked fine when I was connected to eth0 on the host, I figured it had to have something to do with the configuration of the wlan0 connection.After a bunch of searching, I found some references to enabling promiscuous mode on the wireless card (sounds naughty, but actually has  to do with accepting packets not specifically addressed to it).

The fix seemed simple. At the command prompt:

sudo /sbin/ifconfig wlan0 promisc

To make sure it took, I checked the log with:

tail /var/log/messages 

and found

device wlan0 entered promiscuous mode

After that, I was able to use bridged mode in the VM for a minute or two but it switched back off. Looking into it a bit further, I noticed the following in the logs:

vboxnet0: no IPv6 routers present

I remembered something from the VirtualBox documentation about IPv6 not being supported on Linux (yes, I read the docs). So, I went into YaST and disabled IPv6 in
Network Settings. Although YaST claimed the system needed a restart, everything seemed OK after the network restarted. In any event, I can now connect to the PPTP network from my VM.

No comments: