Objective

Hands-on practice with nested vms with kvm in a Linux environment.

Tools & Technologies

  • KVM
  • qemu
  • virsh
  • virt-manager
  • libvirt

Key Commands

egrep -c '(vmx|svm)' /proc/cpuinfo
apt install qemu-kvm libvirt-daemon virt-manager
virsh list --all
virt-install --name test --memory 1024

Lab 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