How to install/run Hyper-V host as a VM(nested) on vSphere 5 or 6?

By | May 27, 2015

Yesterday I prepared a lab for a presentation for my customers about Zerto 4.0 new features and replication between VMware vSphere and Microsoft Hyper-V 2012 R2. Unfortunately I didn't have enough physical machines to install mentioned hypervisors so I decided to run/install Hyper-V hosts as virtual machines (nested). Yes, it is possible to run some Hyper-V hosts on VMware vSphere 🙂 I used one physical HP DL 380p G8 with 128GB of RAM.

To be able to run nested Hyper-V hosts, you need to follow the below steps:

  1. Create a new VM on vSphere with Windows 2012 R2 installed on it.
  2. Power off the VM.
  3. If use Web Client please right click on VM and select Edit Settings. On Virtual Hardware tab, collapse CPU and change CPU/MMU Virtualization option to Hardware CPU and MMU.
    Change CPU virtualization option via Web Client

    Change CPU/Mem virtualization options via Web Client

    via Standard Client: please right click on VM and select Edit Settings. On Options tab please click on CPU/MMU Virtualization option and select Use Intel VT-x/AMD-V for instructions set virtualization and Intel EPT/AMD RVI for MMU virtualization.

    CPU/Mem virtualiation options via Standard Client

    Change CPU/Mem virtualiation options via Standard Client

  4. Click OK to save new settings.
  5. Right click on VM and remove it from inventory.

    Remove VM from inventory.

    Remove VM from inventory.

  6. Locate the VM folder on datastore, download a VM .vmx file to your desktop.

    A vmx file

    A vmx file

  7. Open the VM vmx file and add two below options at the end of file. Save the file.

    hypervisor.cpuid.v0 = "FALSE"
    vhv.enable= "TRUE"

  8. Upload the file again to datastore.
  9. Add to inventory/Register the VM again.

    Register a VM via Web Client.

    Register a VM via Web Client.

  10. Power on VM and please add Hyper-V role. (Server Manager --> Add Role --> Hyper-V)

    Add a Hyper-V role.

    Adding a Hyper-V role.

  11. As you can see everything works well and virtual machines can be created inside nested Hyper-V as well 🙂
    Nested Hyper-V with VM running on it.

    Nested Hyper-V with VM running on it.

     

If you do not do steps 3-9 (miss adding the parameter: hypervisor.cpuid.v0 = "FALSE") you will get the following error:

Hyper-V cannot be installed - missed a parameter in a vmx file

Hyper-V cannot be installed - missed a parameter in a vmx file

Hyper-V cannot be installed: A hypervisor is already running