Run Hyper-V in a Virtual Machine with Nested Virtualization

By definition, nested virtualization is a feature that allows you to run a Hypervisor inside of a guest virtual machine. Along with the release of Windows Server 2016 lots of cool new features made their appearance and one of those is the support for nested virtualization.

Prerequisities  

  • A Hyper-V host running Windows Server 2016 or Windows 10 Anniversary Update (1607).
  • A Hyper-V VM running Windows Server 2016 or Windows 10 Anniversary Update (1607).
  • A Hyper-V VM with configuration version 8.0 or greater.
  • An Intel processor with VT-x and EPT technology.

 

Configure Nested Virtualization

  1. First of all, create a virtual machine!
  2. While the virtual machine is in the OFF state, run the following Powershell commandlet on the physical Hyper-V host to enable Nested Virtualization for the VM Guest.

Set-VMProcessor -VMName “NameoftheVMGuest” -ExposeVirtualizationExtensions $true 

  1. Start the virtual machine.
  2. Install Hyper-V Role within the virtual machine, just like you would for a physical server.

Disable Nested Virtualization

You can disable nested virtualization for a stopped virtual machine using the following PowerShell commandlet:

 Set-VMProcessor -VMName “NameoftheVMGuest” -ExposeVirtualizationExtensions $false 

Recommendations

  • Do not enable dynamic memory for the nested Hyper-V, just prealocate all the memory from the start. Recommended at least 4GB of Ram.
  • Enable MAC Address Spoofing, that is why you need to route the packets properly since you will be using a virtual switch within another virtual switch (inception). 
  • VMware ESXi Hypervisor also supported as a nested option.

 

George Markou

My Name is George Markou, IT Pro, Geek and Fancy Gadgets enthusiast. I am focused on Virtualization and Cloud Technologies.

%d bloggers like this: