How to enable nested virtualization for VM in Hyper-V

If you want ability to run virtual machines inside virtual machines (Hyper-V inside virtual machines) you need to enable nested virtualization. Nested virtualization is great if you want test various hypervisor scenarios inside VMs. We will now enable nested virtualization for Windows 11 VM inside Hyper-V.

For nested virtualization to work, you need to have Intel CPU with VT-x and EPT technology and Windows Server 2016 or later, or Windows 10 or later (VM configuration 8.0). If you are running AMD CPUs, you need to have at least Windows Server 2022 or Windows 11 (VM configuration 9.3).

Enable nested virtualization for VM

Before running commands, make sure that a VM is shut down. Also, back important data, or export VM in case something goes wrong.

To enable nested virtualization for a VM, you need to run following command in Powershell (elevated)

Set-VMProcessor -VMName VMNameyouhave -ExposeVirtualizationExtensions $true

If you want to disable nested virtualization for a VM run following command in Powershell (elevated)

Set-VMProcessor -VMName VMNameyouhave -ExposeVirtualizationExtensions $false

If you need more information or options, please visit – https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/enable-nested-virtualization

Disclaimer