Pcornel
Virtualization · Nested Virtualization

Nested KVM

Cheat sheet · https://pcornel.dk/topic.php?topic=3808

Back to the Topic

Answer

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.

Remember

  • nested=1 on the kvm_intel/kvm_amd module.
  • Use host-passthrough CPU for the L1 guest.
  • Reload module or reboot after change.

First checks

  • cat /sys/module/kvm_intel/parameters/nested — Y/1 on L0
  • echo 'options kvm_intel nested=1' > /etc/modprobe.d/kvm.conf — persist
  • qm set <vmid> --cpu host — expose VT to L1 (Proxmox)

Commands

qm set <id> --cpu host

Verify in this order

L0 KVM nested=1 → L1 with host CPU → L2

Where it usually breaks

First mismatch in management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back; preserve identity/native error/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3808

Confirmation

Confirm action

Continue?