Can't get bridged networking to work between linux guest virtual machine and Mac host

15,491

Solution 1

I have a CentOS guest OS in VirtualBox and am using a Mac OS X host. Bridged networking is working for me.

I did not enable Internet Sharing on my Mac OS X config. Is there a reason you needed to enable that? Have you tried the bridged networking option without Internet Sharing enabled?

Solution 2

I had same issue: NAT was working fine while in bridged mode failed to get DHCP.

I was suspicious about Lion Firewall but switching it off did not help.

Later I found that it is only DHCP that is not working in Bridged mode; so I set the IP address manually on my Linux host and everything started to work nicely.

Solution 3

Found a simple solution to the connectivity problem in VirtualBox:

  1. Set the Network setting to "NAT" in VirtualBox settings for the virtual/guest machine
  2. After booting into the VM, go to "Network Adapter Properties" and insert the following DNS server addresses (OpenDNS configuration):
    • 208.67.222.222
    • 208.67.220.220
  3. Now full internet connectivity is established.
Share:
15,491
tgoneil
Author by

tgoneil

Updated on September 18, 2022

Comments

  • tgoneil
    tgoneil over 1 year

    I'm trying to establish bridged networking from linux mint vsn 12 in virtualbox to a Mac Lion host.

    Mac config:

    • Network setting: en3 configured by DHCP
    • Sharing setting: Internet Sharing selected, Share connection from en3 to computers using en3

    Virtualbox Linux setting:

    • Network setting: Bridged Adapter, Name: en3

    I can ping from host (192.168.2.1) to guest (192.168.2.2) and guest to host, but I Cannot ping from the Linux guest to the outside world. Connection in host is up, because I can ping from the Mac host to the outside world.

    Something else that's seems weird to me, in the Mac Network setting, the IP Address generated by DHCP says 169.254.243.185. What the heck is that?? When I open a terminal up in the Mac, however, ifconfig shows its en3 inet address as 192.168.2.1.

    • tgoneil
      tgoneil over 12 years
      I tried the suggestion at: superuser.com/questions/100499/… But my machine got stuck on reboot. Had to boot with a rescue disk, mount the VM's hd, then change /etc/network/interaces back to the original values. :-(
    • tgoneil
      tgoneil over 12 years
      Just tried a different vm -- VMWare's Fusion. Got the exact same problem, so it's looking like a Mac configuration issue, and not the virtual machine.
  • tgoneil
    tgoneil about 12 years
    I have indeed. Still no connection. Are you connecting via en3? If so, is the ip address generated by DHCP an expected 192.168.x.x or is it 169.254.x.x? Still scratching my head about that. Thanks for your help with this Rohit.
  • Rohit
    Rohit about 12 years
    My mac is on a wireless connection, which is 'en1'. The bridged connection it is connected over 'en1'. My Mac gets a proper ip address (eg 10.10.x.x) for the en1 interface. I have other en* interfaces that get IP addresses like 169..., but I am not using those for network communication. In my CentOS virtual machine, the eth0 network interface is enabled and it gets a 10.10.x.x IP address. Do you have multiple network interfaces defined in your Linux VM instance? What does ifconfig show?
  • tgoneil
    tgoneil about 12 years
    Ok, I turned off the en3 connection in the Mac host, so now only the wireless connection is active. The Mac host was assigned 192.168.1.2 by the router. In Linux Mint, the vm in virtualbox, I changed the bridged adapter to use en0, rather than en3, and that's the only active network interface in the vm. Still doesn't work.
  • tgoneil
    tgoneil about 12 years
    ifconfig output: Here is the eth0 output of ifconfig: $> ifconfig eth0 Link encap:Ethernet HWaddr 08:00:27:4b:81:0c inet6 addr: fe80::a00:27ff:fe4b:810c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:420509 errors:0 dropped:0 overruns:0 frame:0 TX packets:209529 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:326718251 (326.7 MB) TX bytes:28947274 (28.9 MB)
  • tgoneil
    tgoneil about 12 years
    It confirms no inet address assigned. Just for grins, I changed the vm's network to NAT which does indeed get me internet access. I'm relatively new to network configurations, but isn't the NAT configuration supposed to use the host's ip address? With NAT for the adapter, ifconfig reports the ip address is: 10.0.2.15
  • Rohit
    Rohit about 12 years
    I just remembered, there is an issue in VirtualBox bridged networking where IPv6 is not working when using a Mac OSX wireless connection. If you disable IPv6 in your Linux OS, forcing the 'eth0' interface to use IPv4, hopefully that'll get it work and give you an inet address.
  • Rohit
    Rohit about 12 years
  • tgoneil
    tgoneil about 12 years
    I had read that too a while back and already have ipv6 setting as "ignored".
  • tgoneil
    tgoneil about 12 years
    I should have paid more attention to your comment that the VM should also be set to en1. Now it works! Thanks for your help Rohit!
  • tgoneil
    tgoneil over 11 years
    Thanks Indrek, but was looking for BRIDGED networking solution, NOT Nat!