Wednesday, 28 February 2018

macos - How do I get a bridge network to work for VirtualBox with Linux guest on a Mac OS X host


Does anybody have the step by step configuration process that would allow VirtualBox running a Linux/Ubuntu guest on a Mac OS X host use the bridge type network using Ethernet and wireless? I have read that it does work and it doesn't work, trying to find a definite answer. I want the guest environment to look like a separate box.


Thanks



Answer



I have a bridge network working on OSX with a Ubuntu guest VM. You need a network connection for this to work. I have my nic configured via DHCP in OSX and then I statically assigned the guest eth0 an IP on the same subnet.


With this set up I could SSH to my Ubuntu guest; with entries in /etc/hosts on OSX I was able to access internal domains I'd set up in apache on the Ubuntu guest.


I simply installed Ubuntu, in the VM settings, set the adapter to a bridge connection. Boot Ubuntu and be sure to configure /etc/network/interfaces


Mine looks like this:


auto eth0
iface eth0 inet static
address 192.168.0.20
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

OSX would pick up an IP address on the same subnet (e.g. 192.168.0.102), I could see the guest from the host just fine.


ssh 192.168.0.20

Hope this helps.


I'm struggling to get host-only networking set up so I can communicate with the guest VM without an active internet connection.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...