Nested VMs with KVM
Objective
Hands-on practice with nested vms with kvm in a Linux environment.
Tools & Technologies
KVMqemuvirshvirt-managerlibvirt
Key Commands
egrep -c '(vmx|svm)' /proc/cpuinfoapt install qemu-kvm libvirt-daemon virt-managervirsh list --allvirt-install --name test --memory 1024Lab Steps
01
Check Virtualization Support
Verify CPU virtualization extensions are available and nested virtualization is enabled.
02
Install KVM Stack
Install QEMU, libvirt, and virt-manager on the host system.
03
Create VM with virsh
Define and create a VM using virt-install or virsh define with XML.
04
Manage VMs
Start, stop, snapshot, and clone VMs using virsh and virt-manager.
Challenges Encountered
- Nested virt requires intel_iommu=on or AMD equivalent
- Default NAT network may conflict with host network
Key Takeaways
- KVM performance is near-bare-metal with VirtIO drivers
- Snapshots in libvirt use qcow2 internal or external snapshot mechanisms