Mac – Accessing a Virtual Machine over Hamachi VPN

hamachivirtual machinevirtualboxvpn

I've got two virtualized machines running Ubuntu on a Windows 7 Host machine – we're utilizing VirtualBox to handle this. The Host machine also acts as a Gateway for our VPN solution – Hamachi.

The two VMs use Bridged Networking with static IPs assigned to each. When I'm on the network, I can see them both and access them (LAMP servers, one holds our Git repos, the other is a utility box).

So, I can access the VMs internally, and I can get into the network externally over Hamachi. What I can't do, is access the VMs over Hamachi. Basically everything exists through Hamachi except my two VMs.

The goal is to be able to work externally, and push changes to our Git repos over Hamachi and to the VM over SSH. This works fine internally, but not over Hamachi.

Is this even possible? Suggestions, comments, or a solid "Hell no, not possible" are all welcomed.

Best Answer

I just discovered what was going on on Linux, and this probably applies to Windows too.

Hamachi makes a bridged network interface to run the gateway through, and that becomes the "normal" network interface for the machine (on Linux, this is ham-br0 by default).

VirtualBox however, keeps the machine configuration bridged to the original physical network interface (eth0 on Linux). I ran the following while the VM was powered off to make VirtualBox bridge to the Hamachi adapter:

VBoxManage modifyvm <vm_name> --bridgeadapter1 ham-br0

This sets the adapter VirtualBox ties into to ham-br0. The VM is still visible from the non-Hamachi network as well. Like I said, this was on Linux, but VirtualBox's networking model remains more or less the same cross-platform.

Related Question