I have a VMWare Fusion host (OSX Mountain Lion) with an Ubuntu 12.04 LTS virtual. The host is connected to a LAN through a router/switch. I have another machine (OSX Mountain Lion) on the LAN that I would like to use as an SSH client for the Ubuntu virtual.

Note: sshd is already setup and working from the host to the virtual.

The Ubuntu virtual machine can access the internet fine. eth0 is bound to a 172 address, and my host has two virtual interfaces (vmnet1 & vmnet8) on the 172 subnet as well.

How can I make the virtual machine accessible to the LAN? Can it join the 192 network, or do I have to run some sort of NAT on my host? What is the best approach here?



You most likely need to set your guest OS to have at least one bridged network interface to get access to 192 net and you will need to install openssh-server on it.

  • For clarity, when you create a VM there is an option to use a bridged network which I missed. This can apparently only be set when first creating the instance. Afterwards, you can set eth0 to DHCP and all is well. – blu Mar 2 '13 at 21:37
  • You can usually change it afterwards but the VM needs to be off – Srdjan Grubor Mar 2 '13 at 22:01

Your virtual machine's ethernet adapter should be bridging with the hardware one aka 'Bridged Networking` option usually in VMWare or VirtualBox.

This way the virtual machine presents a virtual ethernet adapter which gets an IP address from the physical network (i.e your router).

With this verify if you're able to ping your virtual machine from the machine you wish to login from. And if you're already able to run SSHD on your virtual machine with the firewall not blocking the intended SSH port (22 if you have not changed), you should be all set.

If you use NAT on your host (share host's IP in VMWare or VirtualBox), it is equivalent to running a simple router on the host machine, which will only allow access from the virtual machine to the outside, but not the other way around.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.