Use this when you need to run a hypervisor inside a VM for a lab, CI or training, or when nested VMs will not start.
Nested Virtualization
Nested virtualization runs a hypervisor inside a VM, exposing VT-x/AMD-V to the guest so it can start its own VMs. It is used for labs, CI and training, at the cost of extra overhead and limited vendor support.
1. Nested virtualization runs hypervisors inside VMs.
2. Enable on L0 and expose VT to L1.
3. For labs, CI and training.
4. Performance and features are reduced.
5. Check networking (MAC spoofing/promiscuous).
L0 host → L1 hypervisor VM → L2 VMs
Context & applicabilityCommon mistakes · platform/version boundaries
- Running production workloads nested.
- Forgetting memory and CPU overhead of two hypervisor layers.
- L1 VMs without enough vCPUs for their own guests.
Operational reference
Fast context before you go deeper.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
A nested hypervisor is a hypervisor running inside a VM (L1) that starts its own VMs (L2).
Subtopic Nested Hyper-VNested Hyper-V runs Hyper-V inside a Hyper-V VM on Intel or AMD hosts.
Subtopic Nested KVMNested KVM is enabled with the kvm_intel or kvm_amd module option nested=1 (check /sys/module/kvm_intel/parameters/nested) and a guest CPU model like host-passthrough, so the guest sees vmx or svm.
Subtopic Nested ESXiNested ESXi runs VMware ESXi as a VM — usually on ESXi or Workstation — for labs and testing.
Subtopic CPU Virtualization ExtensionsNested virtualization needs the CPU virtualization extensions (Intel VT-x with EPT, AMD-V with NPT) exposed to the guest, for example kvm_intel nested=1, Set-VMProcessor -ExposeVirtualizationExtensions or vhv.enable on ESXi.
Subtopic Performance ImpactNested virtualization adds overhead because every VM exit in the L2 guest is handled by both hypervisor levels.
Subtopic Nested Virtualization TroubleshootingTroubleshoot nested virtualization by checking that the L1 guest sees vmx/svm (lscpu, systeminfo), the host nested option is on, the CPU model passes the flags through, and virtual switches allow the nested VMs' MAC addresses.
- Nested is for labs, not production performance.
- Guest must see vmx/svm or the inner hypervisor refuses to start.
- Nested VM networking needs MAC spoofing or promiscuous mode.
cat /sys/module/kvm_intel/parameters/nested— nested enabledGet-VMProcessor <vm> | fl ExposeVirtualizationExtensions— Hyper-Vgrep -cE 'vmx|svm' /proc/cpuinfo— inside L1
ReferenceWhy it matters1 section · depth on demand
Uses and limits
Uses: labs (vSphere/Hyper-V/Proxmox clusters on one host), CI testing of hypervisors, WSL2 and Windows Sandbox inside VMs, Kubernetes with KubeVirt. Limits: lower performance (especially I/O and many VM exits), often unsupported for production, live migration of the L1 VM may be blocked, and networking needs promiscuous mode/MAC learning for nested guests.
ReferenceHow it works1 section · depth on demand
In depth
Nested virtualization runs a hypervisor (L1) inside a VM on a host hypervisor (L0), which runs its own VMs (L2). Hardware support: Intel VMCS shadowing, AMD nested paging/VMCB clean bits reduce the overhead of L1 exits.
Use cases: labs and training (vSphere, Hyper-V, Proxmox clusters on one box), CI pipelines testing hypervisor code, WSL2/Docker Desktop/Android emulators inside VMs, cloud instances running KubeVirt or Firecracker. Avoid it for production workloads that need predictable performance.
ReferenceImportant terms & boundaries1 section · depth on demand
Common uses
- Labs and training (running ESXi, Hyper-V or Proxmox inside VMs).
- WSL2, Windows Sandbox and VBS/Credential Guard inside Windows VMs (they use Hyper-V).
- CI pipelines building VM images.
- Testing hypervisor upgrades.
Performance is lower, especially for I/O-heavy and VM exit-heavy workloads, and vendor support for production use is limited.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Nested Virtualization. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/docs.html · confidence 94%