Configuring Nested Hyper-V on ESXi 5.5

In order to allow for installation of a nested Hyper-V on ESXi 5.5, there is a requirement to configure the virtual machine settings once the guest operating system has been deployed.

Firstly, we need to add two items to the existing virtual machine configuration file in a powered off state. Prior to making these changes we will make a backup of the current virtual machine configuration in the event we need to roll back.

cp /vmfs/volumes/<datastore>/<virtual machine>.vmx /vmfs/volumes/<datastore>/<virtual machine>.vmx.backup

In order to  enable nested Virtualization Technology to run 64-bit virtual machines the following is required to added to the configuration file using a text editor.

vhv.enabled = "TRUE"

Now in order to run a hypervisor inside a virtual machine, we will add the following item to override the default setting.  This prevents the error message “Hyper-V cannot be installed: A hypervisor is already running” if you attempt to install the Hyper-V server role in the guest operating system.

hypervisor.cpuid.v0 = "FALSE"

Finally, we need to expose hardware virtualization to the guest operating system so that the processors support the required virtualization capabilities. If you do not expose the hardware virtualization you will receive the error message “The processor does not have the required virtualization capabilities” on installing the Hyper-V server role.

This can be performed using the vSphere Web Client to edit the virtual machine CPU settings as below:

 

VMHyperVCPUSettings

 

Once , the above configuration changes have been applied to the virtual machine you should be able to install the Hyper-V server role.

 

 

Setting the number of cores per CPU in a virtual machine

In order to configure multicore CPU support in VMware, follow the below steps:

 
1.Power off the virtual machine.

2.Right-click on the virtual machine and click ‘Edit Settings’.

3.Click Hardware and select ‘CPUs’.

4.Choose the number of virtual processors.

5.Click the ‘Options’ tab.

6.Click ‘General’, in the ‘Advanced’ options section.

7.Click ‘Configuration Parameters’.

8.Include ‘cpuid.coresPerSocket’ in the Name column

9. Enter a value fo the number of cores per CPU.

10. Power on the virtual machine.