Create Hyper-V Virtualization Lab inside VMware Workstation 10
Sometimes we need cheap and flexible environment to test our infrastructure. VMware Workstation represents perfect solution for most of our problems. We can use it to emulate networks, servers with basic services, and even servers with advanced features like High Availability and clustering. But also, we can emulate native (bare metal) virtualization, which is needed to install Hyper-V or ESXi inside virtual lab.
In normal situations, to test Microsoft Hyper-V, Clustering or some other advanced Windows Server 2012 features, we need 2 or more physical computer to test environment inside Hyper-V. With a little help of VMware Workstation, we can settle our lab inside only one physical computer.
CPU: Dual core with VT-X/EPT (Intel) or AMD-V/RVI support. Faster CPU with more cores will always make you happier. We need CPU with Intel EPT or AMD RVI, because this is the key factor for Hyper-v or ESXi installation inside VMware Workstation. All modern AMD CPUs natively support AMD-V RVI, but for Intel that’s a bit tricky. Most of core i5 CPU support VT-X/EPT, as well as some core i3, but before you make purchase be sure to check it on Intel website. Also, sometimes it’s necessary to enable virtualization in BIOS, even if CPU supports it.
RAM: 4GB or more. With less RAM you can still run few virtual machines, but this will probably stress your disk drive, because VMware Workstation will swap memory to disk drive. RAM is really cheap nowadays, so try to build machine with 8GB RAM or more. This will really improve performance of your virtual machines.
HDD: Regular SATA drive will do (RAID or non-RAID), but SSD will make virtualized lab run much faster, as disk drive is usually main performance bottleneck. SSD provides us with 50.000+ IOPS, compared to standard SATA ~150 IOPS, which make it obvious that one SSD can handle much more input/output operations (more virtual machines=more IO operations) than standard SATA drives, even if we use RAID to improve performance.
Network: 1GBit NIC will be sufficient
Software: VMware Workstation 10
To prepare our lab in VMware Workstation, first we need to allocate virtual machines. That is pretty straightforward, so it’s up to you.
After initial creation of virtual machine for our Hyper-V or ESXi server, we have additional steps. First, we need to select “Edit virtual machine settings”
And after that, we need to enable “Virtualize Intel VT-X/EPT or AMD-V/RVI” for every virtual machine that will host Hyper-V or ESXi.
For ESXi story ends here, we can install our ESXi hypervisor, and start nesting virtual machines inside right away.
For Windows Server 2012 Hyper-V we have additional steps:
Before Hyper-V role installation, you need to change configuration file of created VMware Workstation machine. Locate file with .VMX extension (it should be something like <Virtual-machine-name>.VMX, and open this file in notepad or similar editor.
At the end of the file add those three lines
hypervisor.cpuid.v0 = “FALSE”
This option tricks the Windows Server 2012 into “thinking” it is not running in a virtualized instance
mce.enable = “TRUE”
This option enables Machine Check Exception (MCE), which enable the Windows Server 2012 VM to report CPU hardware issues
vhv.enable = “TRUE”
This option enables nested virtualization
It should look like this.
If you fail to do this properly, you will end up with “error” message when you try to add Hyper-V role.
After you have successfully edited .VMX config, you should be able to add Hyper-V role inside Windows Server 2012 guest, as well as additional nested Virtual Machines inside that Hyper-V.
It should look something like this:
You can optimize the way VMware Workstation handles physical memory (RAM) of your host machine. If you have machine with sufficient amount of RAM, you can chose “Fit all virtual machine memory into reserved host RAM“, which will prevent VMware Workstation to use local disk storage as memory swap. This could significantly improve performance, but also it will prevent you to start virtual machines if your host do not have sufficient amount of RAM.