Thursday, August 7, 2014

Today I finally made it possible to run Windows 2012 R2 Hyper-V as a VM running on ESXi 5.5 (nested VM's).
After extensive trial and error, I finaly found the solution that might be useful for you as well.

Background:
As most people know after a little googling and reading, Hyper-V on Windows 2012 R2 requires a SLAT capable CPU, if not Windows refuses to add the Hyper-V role. There are lots of guides and blogs about this, but none of them worked for me. So I did the tricks on Derek Seaman's excellent blog (http://www.derekseaman.com/2014/06/nesting-hyper-v-2012-r2-esxi-5-5.html) but unfortunately no success in my case.

I got the famous "Hyper-V cannot be installed: The processor does not have the required virtualization capabilities."

My solution:

1. Make sure you add the following string vhv.allow = "TRUE" to /etc/vmware/config of your ESXi 5.5 host. Note that the quotion mark have to be exactly as the same in the config file (I found out that in my first try, the marks where upside-down and the vSphere Client refused to let me "add to inventory" the VMX file, until I changed it).

2. Remove the Hyper-V VM from the inventory of your vCenter/ESXi host.

4. Upload the file back to the datastore and folder where your VM are located and register it (right click the VMX file and choose "Add to Inventory".

5. Now update the the VM to HW version 10 (yes I now it sucks, since you cannot edit the VM with the vSphere Client anymore).

6. Open your web vSphere client (that is, your browser) and logon to your vCenter server (yes you need vCenter, since you cannot edit ESXi 5.5 hosts with the vSphere Client, only with the web client that of course requires vCenter server....). Now edit your VM once more, but this time you will see a checkbox if you expand the CPU section that says "Expose hardware assisted virtualization to the guest OS". And here is the magic!
Enable it and you are good to go.

The final step was what solved the problem for me.

More background:
My lab enviroment for this is pretty cheap and simple, a gigabyte h67a-ud3h-b3 mainboard, with 32 GB RAM and Intel Core i5 2500 which supports SLAT/EPT. I also noted that if I ran the coreinfo.exe (from Technet) on the Hyper-V VM, it showed that everything was fine and that EPT was enabled, but Windows still refused to add the Hyper-V role, claiming my processor did not support some capabilities.

After reading a little, I found out that it might have something to with my BIOS version (of course I updated it), then it could be that some Gigabyte mainboards need to disable USB 3.0 ports in order for EPT to work, so I tried that also of course.

And last tip: You need to enable Promiscuous mode on your vSwitch in order for the nested VM running on Hyper-V to be able to connect to your LAN (and internet).