Configure a nested VM as a host
Nested Virtualization is a functionality in Windows Server 2016 and above that allows you to run Hyper-V inside a Hyper-V virtual machine. In other words, with nested virtualization, a Hyper-V host itself can be virtualized. Nested virtualization can be enabled out-of-band by using PowerShell and Hyper-V host configuration.
You can leverage this functionality to reduce your infrastructure expense for development and test scenarios without the need for individual hardware.
System Center - Virtual Machine Manager (VMM) 1801 and later, you can enable and disable the nested virtualization feature through VMM console. You can configure the nested Virtual Machine (VM) as a host in VMM and perform host operations from VMM, on this VM. For example, VMM dynamic optimization will consider a nested VM host for placement.
Virtualization applications other than Hyper-V are not supported in Hyper-V virtual machines, and are likely to fail. This includes any software that requires hardware virtualization extensions.
Before you start
Ensure the following prerequisites are met:
- A Hyper-V host running Windows Server 2016, Windows Server 1709.
- A Hyper-V VM running Windows Server 2016, Windows Server 1709.
- A Hyper-V VM with configuration version 8.0 or greater.
- An Intel processor with VT-x and EPT technology.
Procedure - configure a nested VM as a host
Enable the nested virtualization on a VM and then configure it as a host. Administrators/delegated administrators can configure nested virtualization by using VMM. Use the following two procedures:
Enable nested virtualization on an existing virtual machine
- Identify the VM that meets the above prerequisites.
Ensure the VM is in stopped state.
Browse the selected VM’s Properties.
- On General, select Enable Nested Virtualization.
Configure the nested VM as a host
Enable the following inbound and outbound firewall rules on the nested VM that you want to configured as the host.
Inbound Firewall rules
- File and printer sharing
- Windows remote management (HTTP-In)
- Windows management Instrumentation
Outbound Firewall rules
- File and printer sharing
- Windows management instrumentation (WMI-Out)
Ensure the VM is in running state. Start the VM if it is not running.
Right-click the VM and select Configure as a Host. The Add Resource wizard appears.
Run through the wizard, select the options as appropriate and complete the wizard.
Disable nested virtualization
- Select the host or VM for which nested virtualization is enabled.
- Ensure the VM is in stopped state. Stop the VM if it is running.
- Browse the VM Properties.
On General, clear the Enable Nested Virtualization check box.
Check the note at the bottom of the wizard page before you disable nested virtualization.