Use this when enabling nested virtualization on KVM or Proxmox.
Nested KVM
Nested 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.
1. Nested KVM: enable module parameter and use host CPU model.
2. AMD default on.
3. Reload module with VMs stopped.
4. L1 sees vmx/svm.
5. Performance acceptable for labs.
L0 KVM nested=1 → L1 with host CPU → L2
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
cat /sys/module/kvm_intel/parameters/nested # Y
egrep -c '(vmx|svm)' /proc/cpuinfo # in L1, > 0
Step 2 Common mistakes Narrow the fault
- Forgetting to reload
kvm_intel/kvm_amdafter enabling nesting (or reboot). - L1 CPU model without vmx/svm.
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.
- nested=1 on the kvm_intel/kvm_amd module.
- Use host-passthrough CPU for the L1 guest.
- Reload module or reboot after change.
cat /sys/module/kvm_intel/parameters/nested— Y/1 on L0echo 'options kvm_intel nested=1' > /etc/modprobe.d/kvm.conf— persistqm set <vmid> --cpu host— expose VT to L1 (Proxmox)
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Nested KVM on a KVM host:
cat /sys/module/kvm_intel/parameters/nested # Y
echo 'options kvm_intel nested=1' > /etc/modprobe.d/kvm-nested.conf # kvm_amd for AMD
modprobe -r kvm_intel && modprobe kvm_intel
qm set 150 --cpu host # Proxmox L1 VM
# libvirt: <cpu mode='host-passthrough'/>
Nested is enabled by default on recent kernels for both Intel and AMD; L1 VMs with nested guests cannot always be live-migrated.
ReferenceConfiguration & state1 section · depth on demand
Enabling nested KVM
cat /sys/module/kvm_intel/parameters/nested # Y or 1
echo "options kvm_intel nested=1" > /etc/modprobe.d/kvm-nested.conf
modprobe -r kvm_intel && modprobe kvm_intel
Documented example, not captured output (use kvm_amd on AMD). Give the L1 VM CPU type host (Proxmox: qm set <id> --cpu host). Inside L1, ls /dev/kvm should exist.
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 → Nested KVM. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/docs.html · confidence 94%