One of the test tasks required to install Hyper-V virtualization role on Windows 10 virtual machine (applicable to Windows Server 2016 as well) running on a VMWare ESXi host. It meant I need to provide nested virtualization of Hyper-V on VMWare ESXi.
First of all, a couple of words about nested virtualization. Nested Virtualization allows to run a hypervisor inside of a virtual machine running on another hypervisor. In Hyper-V, full support for nested virtualization appeared in Windows Server 2016 / Windows 10 Anniversary Update. In VMWare this technology has been working for a long time (appeared in ESXi 5.0).
I have a VMWare ESXi 6.0 virtualization host running a Windows 10 1709 virtual machine.
When trying to install a Hyper-V hypervisor role (the component is called Hyper-V Hypervisor) from the Control Panel -> Programs & Features -> Turn Windows features on or off, this option turned out to be inactive. The reason is as follows:
Hyper-V cannot be installed: The processor does not have the required virtualization capabilities
To enable nested virtualization for this VM with Windows 10 guest OS, open the virtual machine settings using vSphere web client (The VM must be off). In the CPU section check the option “Expose hardware assisted virtualization to the guest OS” (This option is not available in the vCenter C# thin client).
hypervisor.cpuid.v0 = “FALSE”
mce.enable = “TRUE”
vhv.enable= "TRUE"
In the VMware vSphere client, these options can be added in the VM settings: Options -> General -> Configuration Parameters. Add two new row with the same parameters (Add Row).
Start your Windows 10 virtual machine and try to install the Hyper-V role again. Now Windows doesn’t detects that it is running inside another hypervisor, but a new error appears:
Hyper-V cannot be installed: the processor does not support second level address translation (SLAT).
It means that besides supporting the virtualization, the VM processor must support SLAT technology, i. e. virtualization of memory pages and their direct control by the guest OS. In Intel terms, this feature is called Extended Page Tables (EPT), and AMD calls it Rapid Virtualization Indexing (RVI).
Make sure that the processor (vCPU) supports SLAT using the following command:
systeminfo
The command in Hyper-V Requirements section should return that there is no SLAT support:
Second Level Address Translation: No
In this case, you need to change the parameters of the virtual machine processor. In CPU/MMU Virtualization section of the vSphere web client, select Hardware CPU and MMU.
In the thin vSphere client, the same option is located in the CPU/MMU Virtualization section of the Options tab and called ‘Use Intel VT-x/AMD-V for instruction set virtualization and Intel EPT/AMD RVI for MMU virtualization’.
Start Windows 10 virtual machine and make sure that its processor supports SLAT now. Then you can install all components of the Hyper-V role and run other virtual machines inside this Windows 10 VM.