Nested Virtualisation in Hyper-V

Guide on how to enable Nested Virtualization, allowing you to run Hyper-V inside a Hyper-V Virtual Machine.

What is Nested Virtualization?

It enables you to install Hyper-V (or Docker/WSL2) inside a VM.

Prerequisites

One-Command Enable (PowerShell)

You must run this command on the HOST system (Physical PC).

  1. Open PowerShell as Administrator.
  2. Run:
Set-VMProcessor -VMName "YourVMName" -ExposeVirtualizationExtensions $true

Optional: Enable MAC Address Spoofing (Required for L2 networking):

Get-VMNetworkAdapter -VMName "YourVMName" | Set-VMNetworkAdapter -MacAddressSpoofing On

Configuring the VM (Guest)

Now boot the VM. Inside the VM, you can now install Hyper-V:

Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart

AMD Processors

Previously, nested virtualization was Intel-only. Since Windows 10 build 19636 (and Server 2022), it works on AMD Ryzen/Epyc too. The command is essentially the same.

User