A lot of people ask us about possibility of Hyper-V support nested virtualization? Well, we used to say “No”
What is nested virtualization? For those who do not know, it mean
- Installing Hyper-V hypervisor on physical host
- Then setting up guest virtual machine on that host, install with Hyper-V roles and run few VMs.
One of the common scenario we love to do this is for lab testing.
[Using Windows Server 2016 TP4 as Host]
1. Install Host with Windows Server 2016 TP4
2. Create a base image of Windows Server 2016 TP4. Refer to below link:- http://www.ms4u.info/2016/02/create-windows-server-2016-base-image_27.html
Make sure the virtual machine has configure the following settings:-
- Disable Dynamic Memory
- Set vCPU more than 1
- Enable MAC Address spoofing
- Enable virtualization extension on the vCPU by using Powershell
get-vmprocessor -vmname <target virtual machine> | fl *
Enable Virtualization Extension on target VM:
Set-VMProcessor -VMName <target virtual machine> -ExposeVirtualizationExtension $true
Lastly, boot up target virtual machine, enable Hyper-V roles and create guest virtual machine.
[Using Windows 10 as Host]
Your host should at least running Windows 10 Build 10565. For more detail, you can refer to Windows Insider Preview:- Nested Virtualization
Prior version of Windows 10 Build 10565 cannot setup nested virtualization.
Guest virtual machine:-
- create a VM running Windows 10 Build 10565
- Run Enable-NestedVm.ps1 while the VM is turn off. This script will check your configuration and change anything which is incorrect.
- Install Hyper-V Roles
- Create nested VM