
Hyper-V Nested Virtualization in Windows 10
Microsoft release the build 10565 last week for insiders on fast ring which contains a preview of nested virtualization. This allow you to install Hyper-V in a guest virtual machine and running other guest VM on this new Hypervisor. You can also run multiple Hyper-V server on the same physical machine. It’s perfect for your demos and lab test !
Because it’s a preview, there are some known issues :
- Both hypervisors need to be the latest versions of Hyper-V on windows 10 build 10565.
- Dynamic memory must be OFF. This will prevent the VM from booting.
- Runtime memory resize will fail.
- Applying checkpoints to a running VM will fail.
- VM which hosts other VMs cannot be live migrated.
- Save/restore will fail.
- Once nested virtualization is enabled in a VM, MAC spoofing must be enabled for networking to work in its guests.
- Hosts with Virtualization Based Security (VBS) enabled cannot expose virtualization extensions to guests. You must first disable VBS in order to preview nested virtualization.
- This feature is currently Intel-only. Intel VT-x is required.
- You need at least 4 GB of host RAM.
For more details, visit this page.
Now let’s get started :
1- Create a VM
2- Run the enablement script.
This script will check your configuration,and enable nested virtualization for a VM. The VM must be off.
Invoke-WebRequest https://raw.githubusercontent.com/Microsoft/Virtualization-Documentation/master/hyperv-tools/Nested/Enable-NestedVm.ps1 -OutFile ~/Enable-NestedVm.ps1 ~/Enable-NestedVm.ps1 -VmName <VmName>
3- Install Hyper-V in the guest
Set-VMNetworkAdapter -VMName <VMName> -MacAddressSpoofing on
4- Option : Enable networking
Remember, MAC Spoofing must be enabled once nested virtualization is enabled.
Run this command on the host as an administrator to enable networking :
Set-VMNetworkAdapter -VMName"VName"-MacAddressSpoofing on
5- Create nested VMs !
Comments: 2
Is there a way to enable the virtualization flag on the host again too?
would like to run HAXM inside hyper-v host, which is currently not possible, because the hypervisor is hiding the intel vt-x flag
Hello,
You can find the option to enable Intel VT-X in the bios on your physical host.
I hope this help !