1

I have a virtual development server running Ubuntu Server set up with Apache and running under VirtualBox on a Mac (host OS is OSX 10.8.1). I have a bridged adapter configured in an attempt to make it visible from my test devices (iPhone and Android) inside the network.

When I connect to the server from the "real" machine that's running it, everything's fine - webpages can be loaded, etc. However, connection attempts to this server from any of my test devices time out.

I tried setting promiscuous mode = allow all and restarting the guest OS, but it doesn't seem to have had any effect. I've also verified that the host box's firewalls are completely off (at the command line using 'sudo ipfw list' and in System Preferences > Security > Firewall).

Is there any additional setup I ought to have done in order to make this work? What additional troubleshooting steps am I missing?

6
  • Do you try to bridge up en1, the WiFi adpaptor? That doesn't work. Try en0, the regular Ethernet port. Oct 12, 2012 at 23:32
  • Interesting - can you elaborate on why it doesn't work? The VirtualBox manual seems to claim it works as long as you're using IPv4, and I'm not sure I can easily swing an Ethernet connection in this office.
    – Arkaaito
    Oct 12, 2012 at 23:56
  • Sorry, no, I can't. It's just an observation I made myself. Because of this annoying fact I always set up two virtual interfaces for the VM guests, one NATed for Internet access, and one host only network for communication with the host and other VMs. I never found out why it doesn't work, maybe this is an combination of OSX version and MPB model. But you know what? I just got a brand new (used) Macbook and I haven't tried if it's working now. Will do later this afternoon... Oct 13, 2012 at 7:13
  • Wow, you were right! In direct contradiction to the VirtualBox manual, bridged adapters are not working for my WiFi connection, even using IPv4. I'll submit a bug report to them with my network card info (I have one of the new retina MBPs, so maybe there's some hardware that's not yet supported?). Meanwhile, you should add your comment as an answer so I can accept it. :-)
    – Arkaaito
    Oct 16, 2012 at 16:52
  • Oh really? The problem is still there? To be honest, I totally forgot about testing it. Sure, will post a reasonable answer. Oct 16, 2012 at 16:53

1 Answer 1

2

OK, earlier I wrote that using the Mac's wireless interface en1 simply doesn't working with bridging. I only have anecdotal evidence, but since you were able to verify it, we can take it as a fact.

But let's have a look at the available documentation, which is interesting for itself. Maybe someone else can comment on that?

I had a look at the documentation which was shipped with VirtualBox 4.1.20 (r80170). It says in chapter 6.4 Bridged networking:

To enable bridged networking, all you need to do is to open the Settings dialog of a virtual machine, go to the “Network” page and select “Bridged network” in the drop down list for the “Attached to” field. Finally, select desired host interface from the list at the bottom of the page, which contains the physical network interfaces of your systems. On a typical MacBook, for example, this will allow you to select between “en1: AirPort” (which is the wireless interface) and “en0: Ethernet”, which represents the interface with a network cable.

OK, this seems to imply, that en1 should be working. But, just the next paragraph says:

Note: Bridging to a wireless interface is done differently from bridging to a wired interface, because most wireless adapters do not support promiscuous mode. All traffic has to use the MAC address of the host’s wireless adapter, and therefore VirtualBox needs to replace the source MAC address in the Ethernet header of an outgoing packet to make sure the reply will be sent to the host interface. When VirtualBox sees an incoming packet with a destination IP address that belongs to one of the virtual machine adapters it replaces the destination MAC address in the Ethernet header with the VM adapter’s MAC address and passes it on. VirtualBox examines ARP and DHCP packets in order to learn the IP addresses of virtual machines.

OK? I'm not too sure about the capabilities of the airport card, but when I run tcpdump I see the message en1: promiscuous mode enable succeeded in dmesg. (Although I can't see any traffic which isn't mine, or multi- or broadcast. Meh)

Now, the fun part:

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 net- working) for bridged networking. Currently, VirtualBox supports only IPv4 over AirPort. For other protocols such as IPv6 and IPX, you must choose a wired interface.

I can imagine that Oracle made assumptions about the capabilities. Or, it used to work at some point (back when SUN was still in charge) and doesn't do any more with recent Macs or OSX-versions. I'm wildly guessing there, because it never worked for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .