To set up nested virtualization, which allows running Hyper-V inside an Azure virtual machine, you must first select a compatible virtual machine size. You should choose either the Large (nested virtualization) or Medium (nested virtualization) size during deployment. Before beginning, make sure you have an active Azure subscription and a configured Azure lab plan. You will also need specific Azure role-based access control (RBAC) permissions, such as the Lab Creator, Owner, Contributor, or Lab Services Contributor role, to manage the environment.
Once the host virtual machine is running, you configure it by establishing a Remote Desktop (RDP) connection to the template VM. To enable the hypervisor features, you must run Windows PowerShell with administrative privileges. You begin by temporarily bypassing the execution policy to allow setup scripts to run on the system. After downloading and running the official configuration script, the host installs the Hyper-V role and configures the virtual switch needed for inner guest VMs to communicate.
To prepare the VM host, complete the following steps:
Set-ExecutionPolicy bypass -force to allow the setup script to run.Set-ExecutionPolicy default -force.Nested virtualization is highly beneficial for creating isolated training environments and testing complex software deployments. By utilizing Hyper-V isolation, developers can run containerized applications with an extra layer of security. This capability relies on physical hardware features, specifically modern processors that support Intel VT-x or AMD-V virtualization extensions. The Azure hypervisor passes these hardware extensions directly down to the outer VM, enabling it to act as a host for inner guest VMs.
A layered stack diagram showing how Azure physical hardware passes Intel VT-x or AMD-V extensions through the Azure hypervisor to an outer host VM, which runs Hyper-V to support inner guest VMs.
While nested virtualization is powerful, it is restricted to Microsoft technologies, meaning third-party hypervisors are not supported on the Azure host. Additionally, memory management requires careful planning during the lifecycle of the inner virtual machines. While enabling the feature does not block dynamic memory capabilities, you cannot adjust these memory boundaries while the guest VM is running. You must transition the nested VM to an off state before making any changes to its memory allocation.
Eager to master hybrid server management? Discover how to administer Windows Server Hybrid Core Infrastructure on Azure, setting your path towards the Microsoft Certified: Azure Hybrid Infrastructure Administrator Associate certification!
Prepare and test your skills

Prepare and test your skills

Nested virtualization requires deploying either a Large (nested virtualization) or Medium (nested virtualization) virtual machine size. In addition to an active Azure subscription and a configured Azure lab plan, you need Azure role-based access control (RBAC) permissions such as Lab Creator, Owner, Contributor, or Lab Services Contributor.
While nested virtualization supports dynamic memory, you cannot adjust memory allocation boundaries while the inner guest virtual machine is actively running. You must turn off the nested virtual machine before making any modifications to its memory settings.
No, nested virtualization on Azure is restricted to Microsoft technologies and does not support third-party hypervisors on the host virtual machine. The Azure hypervisor passes physical Intel VT-x or AMD-V hardware extensions directly to the outer virtual machine specifically to run Hyper-V.