At one point of my testing of various technologies including Windows Server 2012 a few years ago, I needed a test environment with two or more physical servers which can host virtual machines. Since I didn’t have that kind of environment, I tried to create nested virtualization on VMware ESXi 5.5. My troubles began when I started preparing the environment for the nested virtualization. There were a lot of articles and tutorials on the Internet touching this subject, but none did solve my problem in a full. I always received messages like “Hyper-V cannot be installed: A hypervisor is already running” or “Hyper-V cannot be installed: The processor does not have the required virtualization capabilities.” The search for a solution was like a labyrinth with no escape.
At the end, after reading many articles, I managed to solve the problem!
As a first step, we need configure ESXi server, because by default ESXi doesn’t support nested virtualization. We need to login to ESXi host over SSH and reconfigure the config file located at /etc/vmware/config and add a new line containing vhv.enabled = “TRUE”. This parameter is very important and I had a big headache with this parameter, because on ESXi 5.1 it was vhv.allow = “TRUE”. After this has been done, we can proceed to step 2.
After a successful configuration of the ESXi host, we can now create a new virtual machine. This task is no different than the usual creation of virtual machines on ESXi.
Step 3 is also very important for configuring virtual machine for nested virtualization. Under Options tab, we need to select Advanced/General and then Configuration parameters. We need to select Add Row and add new parameter:
NAME: hypervisor.cpuid.v0 VALUE: FALSE
Under CPU/MMU Virtualization we have to select Use Intel VT-x/AMD-V for instruction set virtualization and Inet EPT/AMD RVI for MMU virtualization. Save the settings and start installing Windows Server 2012.
If you happen to receive the same error message during Hyper-V enabling and after installing Windows Server, please recheck all the configuration parameters. Sometimes the installation process can overwrite the modified parameters back to their default values. Also, under the configuration parameters of virtual machine you can add parameter NAME: vhv.enabled VALUE: TRUE.