Overview
Nested virtualization allows you to run Hyper-V inside a Hyper-V virtual machine. The guest VM acts as a hypervisor and can create and manage its own virtual machines, just like the physical host. This capability is essential for lab environments where you want to test Hyper-V features, practice VM management, or simulate multi-tier infrastructure without dedicating additional physical hardware. It is also widely used in DevOps pipelines, training environments, and testing Windows Server roles that depend on virtualization.
By default, a Hyper-V VM does not expose virtualization extensions to its guest operating system. Attempting to install the Hyper-V role inside a VM without first enabling nested virtualization results in an error. This guide demonstrates the complete process: setting up VMs on a physical Hyper-V host, encountering the virtualization error, enabling nested virtualization via a single PowerShell command on the physical host, and successfully installing and verifying the Hyper-V role inside the guest VM.
Step 1 – Prepare the Hyper-V Environment
This guide assumes the Hyper-V role is already installed on the physical Windows Server host. Open Hyper-V Manager on the physical server to confirm that your virtual machines are created and visible. For this example, the environment includes a VM named NYC-SVR1 along with other VMs (NYC-DC1, NYC-SVR2, and others). NYC-SVR1 will be the VM that runs the nested Hyper-V instance. In Hyper-V Manager, right-click NYC-SVR1 and click Connect to open the VM console.

Step 2 – Attempt to Install Hyper-V on the VM (The Error)
Inside the NYC-SVR1 VM, open Server Manager and launch Add Roles and Features. Proceed through the wizard: select Role-based installation, select the local server, and on the Server Roles page, scroll down and check Hyper-V. Add the required features when prompted and continue through the wizard pages. When you reach the Confirmation page and click Install, you will encounter an error – the Hyper-V role cannot be installed because the VM’s processor does not have virtualization extensions exposed by the host hypervisor.

Step 3 – Shut Down the VM and Enable Nested Virtualization
To resolve the error, the VM must be shut down (not just paused or saved). From inside the VM, open the Start menu and shut down. Wait for Hyper-V Manager on the physical host to show the VM status as Off.
Next, open PowerShell as Administrator on the physical Hyper-V host (not inside the VM). Run the following command, replacing the VM name with your VM’s exact name as it appears in Hyper-V Manager:
Set-VMProcessor -VMName "NYC-SVR1" -ExposeVirtualizationExtensions True
This command instructs the physical hypervisor to expose its virtualization extensions to the processor seen by the guest VM. The command completes with no output on success. The VM must remain off while this command runs.

Step 4 – Restart the VM and Install Hyper-V
With nested virtualization enabled, start NYC-SVR1 from Hyper-V Manager. Connect to the VM and open Server Manager again. Launch Add Roles and Features and proceed through the wizard exactly as before: Role-based installation, select the local server, and check Hyper-V on the Server Roles page. This time, the role is accepted without error. Continue through the wizard pages. On the Create Virtual Switches page, configure virtual switches for the nested VMs if required, or skip and configure them later. Click Next.

Step 5 – Configure Migration and Default Stores
The Add Roles and Features wizard presents two additional Hyper-V configuration pages before the confirmation screen. On the Virtual Machine Migration page, configure live migration settings if this nested Hyper-V instance will participate in a failover cluster. For a standalone lab VM, leave the default settings and click Next. On the Default Stores page, set the default locations where virtual hard disk (.vhdx) files and VM configuration files will be stored on the NYC-SVR1 disk. Set these to paths with sufficient free space. Click Next to proceed to the Confirmation page.

Step 6 – Install and Confirm
On the Confirmation page, review the list of roles and features to be installed: Hyper-V and Hyper-V Management Tools should both be listed. Click Install. The installation progress bar runs. Unlike the first attempt, no error appears. The wizard completes successfully with a message confirming the Hyper-V role is installed. The server may prompt for a restart – restart the NYC-SVR1 VM to complete installation.

Step 7 – Verify Nested Hyper-V
After the installation completes (and the VM restarts if required), verify that the Hyper-V role is functioning inside the nested VM. From Server Manager inside NYC-SVR1, click Tools in the top-right corner. Hyper-V Manager appears in the Tools dropdown, confirming the role is installed and the management console is available. Click Hyper-V Manager to open it. The console shows the NYC-SVR1 server node in the left pane, confirming that this VM is now a functioning Hyper-V host capable of creating and managing its own virtual machines.

Best Practices and Considerations
- Processor Compatibility – Nested virtualization requires that the physical host’s processor supports virtualization extensions (Intel VT-x or AMD-V). Most modern server-class processors do. However, not all cloud providers expose these extensions to their VMs – check your provider’s documentation before attempting nested virtualization on cloud-hosted Hyper-V
- Performance Overhead – Nested virtualization adds a layer of abstraction, which carries CPU and memory overhead compared to bare-metal virtualization. For lab and testing purposes this is acceptable, but do not use nested Hyper-V for production workloads where performance is critical
- Memory Allocation – Allocate sufficient RAM to the outer VM (NYC-SVR1) to support both its own operating system and the memory requirements of the VMs it will host. A practical minimum for a useful nested Hyper-V lab is 8-16 GB assigned to the outer VM
- The VM Must Be Off – The
Set-VMProcessor -ExposeVirtualizationExtensions Truecommand only works when the VM is in the Off state. Running it against a running or saved VM will produce an error. Always shut down the VM completely before running the command - Use Generation 2 VMs When Possible – Generation 2 VMs provide UEFI firmware and better performance for nested scenarios compared to Generation 1. When creating the outer VM that will host nested Hyper-V, prefer Generation 2 if the guest OS supports it