If given the choice, then Hyper-V wouldn’t be the hypervisor I’d pick first. Don’t get me wrong, there are a number of things I really like:
- Ability to overcommit the number of virtual CPUs compared to the number of logical ones on my computer.
- The out-of-the-box integration with Windows guests.
- The ability to passthrough the hardware acceleration for virtualization (VT-x) on Intel CPUs.
But then there are some of the things that I don’t like:
- It not being a good citizen in regards to sharing the hardware acceleration of virtualization on the CPU. VirtualBox can be made to workaround this by uing the Hyper-V as the virtualization engine, but at a performance degradation. In my experience, if the VM (Windows Server 2012R2) is able to boot at all, the performance is so bad that it is unusable. Trying to run VirtualBox without this workaround always resulted in BSOD.
- The network configuration of the VMs, in regards to being run on a developer’s computer.
And it is in regards to the last point that is one of the biggest headaches for me. When running a VM as a developer, it isn’t unlikely that I want to have Internet access whilst not wanting anyone but me reaching it. The switch type that you want to use in this case is the “Default Switch”, which provides NAT functionality. But what I’ve stumbled upon is that this switch doesn’t handle the case when the host computer is utilizing a VPN. If I remember correctly, the issue lied in how DNS lookups were handled. This was an issue with the version of Cisco AnyConnect I used for work, but work better with FortiClient which we may start using instead. This rendered my virtual machine unable to integrate with other resources on my company’s intranet.
In any case, I wanted to use the Internal Switch type in order to always be able to reach the VM. But since there is no DHCP server, you’ll need to manage the IP configuration manually (unless you actually add a DHCP machine/server to the internal switch). How to do this manual configuration isn’t clear unless you have the knowledge how to do it, which is made apparent by the number of articles I’ve read with incorrect information, at least in part. But then I finally found some articles with correct information.
The only thing that should be configured is the IP address and the network subnet mask. The parts that don’t need to be configured are the default gateway and DNS. The default gateway, i.e. the way packets should go from your computer, is implied to be the switch itself. Unless you have a DNS server configured on a computer connected to the internal switch, then there is no DNS to configure, since no one is there to get the requests.
Regarding the network mask, ensure that it is not used by any other network you’re connected to. I.e., don’t configure 192.168.0.0/24 if your home router you’re directly connected to is using it for the intranet.