Bridged networking not working with wifi (mavericks)

Discussions related to using VirtualBox on Mac OS X hosts.
cerberos
Posts: 14
Joined: 26. Mar 2014, 11:44

Bridged networking not working with wifi (mavericks)

Post by cerberos »

With NAT selected, on the guest machine I can access the internet.
With Bridged (en4: USB Ethernet) all is ok

With Bridged (en0: Wi-Fi (AirPort)) selected I can't get an ip address (v4) on the guest so can't access the internet.
This is very frustrating, please help (let me know if you need to see the output of any other commands).

Code: Select all

$ ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:f9:23:3f  
          inet6 addr: fe80::a00:27ff:fef9:233f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3352 (3.3 KB)  TX bytes:7830 (7.8 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Code: Select all

$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:f9:23:3f brd ff:ff:ff:ff:ff:ff

Code: Select all

$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Bridged networking not working with wifi (mavericks)

Post by loukingjr »

I know little about networking but if I choose Bridged in the VB settings my options are...
en0: Ethernet
en1: Wi-Fi (Air-Port)
en4: Thunderbolt 1
en3: Thunderbolt 2
p2p0
bridge0

with en1: Wi-Fi (AirPort) selected I have no trouble with guests getting online. under Advanced, cable connected is enabled.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
cerberos
Posts: 14
Joined: 26. Mar 2014, 11:44

Re: Bridged networking not working with wifi (mavericks)

Post by cerberos »

loukingjr wrote:I know little about networking but if I choose Bridged in the VB settings my options are...
en0: Ethernet
en1: Wi-Fi (Air-Port)
en4: Thunderbolt 1
en3: Thunderbolt 2
p2p0
bridge0

with en1: Wi-Fi (AirPort) selected I have no trouble with guests getting online. under Advanced, cable connected is enabled.
Thanks for confirmation that it should work. The choices I have are (when I don't have USB Ethernet plugged in)

en0: Wi-Fi (AirPort)
en1: Thunderbolt 1
en2: Thunderbolt 2
p2p0
bridge0
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Bridged networking not working with wifi (mavericks)

Post by loukingjr »

I don't know why you don't have a plain Ethernet option and I don't know why you do have a USB Ethernet option. Hopefully someone else here does.

edit: I assume you do have the ethernet cable connected to your AirPort.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
cerberos
Posts: 14
Joined: 26. Mar 2014, 11:44

Re: Bridged networking not working with wifi (mavericks)

Post by cerberos »

There's no ethernet option because it's a new MBP and MBPs don't have an ethernet socket any more. The USB Ethernet option is because I've borrowed a usb to ethernet adapter to test with, I can't post an image of it as I haven't been a member long enough.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Bridged networking not working with wifi (mavericks)

Post by loukingjr »

I actually have an AirPort Time Capsule which is why I thought I had an Airport Option. And there is an Ethernet cable connected to it from my router. You should be able to connect the MBP wirelessly to your router. Perhaps you need to disable "Cable Connected" when you try Wi-Fi since you don't have an Ethernet connection or an AirPort device I take it.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Bridged networking not working with wifi (mavericks)

Post by loukingjr »

after a little digging I found this. it is an old ticket but it still seems to be a problem...
https://www.virtualbox.org/ticket/10019

apparently there is a problem using bridged with IPv6 enabled.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Bridged networking not working with wifi (mavericks)

Post by loukingjr »

I don't know if it will work but in the Mac's network preferences under Wi-Fi>Advanced>TCP/IP>Configure IPv6 there is a setting "Link-local only" which is suppose to disable IPv6. Can't hurt to try it.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
cerberos
Posts: 14
Joined: 26. Mar 2014, 11:44

Re: Bridged networking not working with wifi (mavericks)

Post by cerberos »

I really appreciate the your help with this loukingjr.

I disabled ipv6 by

Code: Select all

networksetup -listallnetworkservices (to find the available interfaces)
networksetup -setv6off Wi-Fi
Now System preferences > network preferences > Wi-Fi > Advanced > TCP/IP > Configure IPV6 is showing off, I then rebooted. ifconfig is still showing the ipv6 address on the guest machine, I'm pretty sure it's coming from VirtualBox's networking layer.

According to the docs, this shouldn't be a problem anyway as I'm trying to use IPV4 with AirPort.
Depending on your host operating system, the following limitations should be kept in mind:

On Macintosh hosts, functionality is limited when using AirPort (the Mac's wireless networking) for bridged networking. Currently, VirtualBox supports only IPv4 over AirPort. For other protocols such as IPv6 and IPX, you must choose a wired interface.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Bridged networking not working with wifi (mavericks)

Post by loukingjr »

cerberos wrote:I really appreciate the your help with this loukingjr.

I disabled ipv6 by

Code: Select all

networksetup -listallnetworkservices (to find the available interfaces)
networksetup -setv6off Wi-Fi
Now System preferences > network preferences > Wi-Fi > Advanced > TCP/IP > Configure IPV6 is showing off, I then rebooted. ifconfig is still showing the ipv6 address on the guest machine, I'm pretty sure it's coming from VirtualBox's networking layer.

According to the docs, this shouldn't be a problem anyway as I'm trying to use IPV4 with AirPort.
Depending on your host operating system, the following limitations should be kept in mind:

On Macintosh hosts, functionality is limited when using AirPort (the Mac's wireless networking) for bridged networking. Currently, VirtualBox supports only IPv4 over AirPort. For other protocols such as IPv6 and IPX, you must choose a wired interface.
you're welcome. I know how annoying this kind of issue can be. what I don't understand is why mine works. I can log the iMac I use wirelessly through my Airport Time Capsule or to my router and guests still work using bridged. I also don't understand how this problem has remained for 2 years using OSX 10.7 through OSX 10.9

p.s. I am running VB 4.3.10 so you might want to try that if you hadn't already.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
cerberos
Posts: 14
Joined: 26. Mar 2014, 11:44

Re: Bridged networking not working with wifi (mavericks)

Post by cerberos »

So here's the command that shows what happens when the guest attempts to get a DHCP ip address with a bridged network, I'm not sure where 10.0.2.15 comes from, it's definitely not the DHCP server that I can get an ip address from. loukingjr, could you run this command on one of your guest machines and post the output?

Code: Select all

$ sudo dhclient eth0 -v
Internet Systems Consortium DHCP Client 4.1-ESV-R4
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit

Listening on LPF/eth0/08:00:27:f9:23:3f
Sending on   LPF/eth0/08:00:27:f9:23:3f
Sending on   Socket/fallback
DHCPREQUEST of 10.0.2.15 on eth0 to 255.255.255.255 port 67
DHCPREQUEST of 10.0.2.15 on eth0 to 255.255.255.255 port 67
DHCPREQUEST of 10.0.2.15 on eth0 to 255.255.255.255 port 67
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 20
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
...
(eventually times out)
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Bridged networking not working with wifi (mavericks)

Post by loukingjr »

louis@louis-VirtualBox:~$ sudo dhclient eth0 -v
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/08:00:27:f5:16:82
Sending on LPF/eth0/08:00:27:f5:16:82
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x23994fa7)
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5 (xid=0x23994fa7)
DHCPREQUEST of 1xx.1xx.1.12 on eth0 to 255.255.255.255 port 67 (xid=0x23994fa7)
DHCPOFFER of 1xx.1xx.1.12 from 1xx.1xx.1.1
DHCPACK of 1xx.1xx.1.12 from 1xx.1xx.1.1
bound to 1xx.1xx.1.12 -- renewal in 36411 seconds.

edit: I thought I best censor my IP. :)
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
cerberos
Posts: 14
Joined: 26. Mar 2014, 11:44

Re: Bridged networking not working with wifi (mavericks)

Post by cerberos »

So I setup wireshark captures while `sudo dhclient eth0 -v` ran with bridged ethernet and bridged wireless. I'm hoping someone that understands what's supposed to happen when a machine requests a DHCP ip address can look at these files to say where the problem is.

https://dl.dropboxusercontent.com/u/450 ... et1.pcapng
https://dl.dropboxusercontent.com/u/450 ... ss1.pcapng
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Bridged networking not working with wifi (mavericks)

Post by loukingjr »

I hope someone can help. What I still don't understand is why I can use bridged with Airport despite what the manual says and the results you and others are getting. You didn't mention which version of VirtualBox you are running. I am running 4.3.10 as I mentioned. Perhaps the IPv6 problem was fixed in a more recent version than you are using. I am also running OSX 10.9.2 if that makes any difference.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
cerberos
Posts: 14
Joined: 26. Mar 2014, 11:44

Re: Bridged networking not working with wifi (mavericks)

Post by cerberos »

I'm running 4.3.10. I'm pretty sure the problem is not related to IPV6 in any way, the docs state bridged doesn't work with Airport and IPV6 on a mac however I'm trying to use IPV4.

What I suspect is happening is one of
a) virtualbox is not requesting an ip address correctly (unlikely since it works for you)
b) that the DHCP server isn't responding to the ip address request (eg router issue)
c) a combination of a) and b) eg the request is malformed in some way that my DHCP server doesn't like but your does
Post Reply