I’ve been a supporter of VMware Workstation for years and still think it’s the best virtualization solution for the desktop. It’s the little things like not having to use Remote Desktop all the time to copy files to my virtual machines or the ability to use folders to organize my stuff (sounds trivial, but this is how that looks like).
Once in a while I feel the urge to play around with Hyper-V on my laptop but I never used it for more than a few days. One of the reasons being the lack of support for NAT. With Hyper-V you typically create two virtual switches: one for the wired connection and one for the wireless one. You then use these switches to connect your virtual machines to the internet. The problem with that is that I always have to change my VM to use the right switch, depending on the medium I’m working with at the moment.
Another problem is that those external virtual switches get their IP from the external DHCP server. If that happens to be a wireless connection that needs a password you see where that breaks down.
In VMware Workstation you’ve got a NAT service that works great. You connect your virtual machine to it and it then automatically finds out which network to use (wired or wireless) and shares your external IP to communicate with the outside world. Source-NAT for those who know what that means.
I’ve been searching for a way to mimic this behavior in Hyper-V but was unable to find a good solution. Until now that is. Granted, it’s still a bit messing around but it works. I’m pretty sure it’s not supported by Microsoft however
Step 1 – Install VMware Player
Go to the VMware website and download VMware Player. Install Player on your machine. If that doesn’t work because you already have Hyper-V installed, you have to boot your pc with Hyper-V disabled. Scott Hanselman recently published a nice blog on how to do that. If VMware Player is installed, you have these Windows services:
Additionally, it installs the following virtual network connections on your host:
VMnet8 is the network adapter connected to the NAT service. Reboot your pc to enable Hyper-V again.
Step 2 – Configure Hyper-V
In your virtual switch manager, create an external network switch and connect that to the VMnet8 network connection:
That’s it. Connect a virtual machine to that network and you’ve got internet – whether you’re on a wired or a wireless connection. No more switching virtual networks anymore.
Step 3 – Configure NAT & DHCP (Optional)
If you want to change the network range or any options, you can find the necessary configuration files in the following directory:
Just edit vmnetdhcp.conf & vmnetnat.conf to suit your needs.