KVM (KVM)
KVM is built into the Linux operating system and lets any Linux machine create and run virtual machines. Instead of installing separate hypervisor software, Linux itself becomes the hypervisor. This means a standard Linux server can host multiple virtual machines using the same hardware acceleration that enterprise products use, at no additional cost.
Kernel-based Virtual Machine (KVM) is a Linux kernel module (merged in kernel 2.6.20, 2007) that leverages hardware virtualization extensions (Intel VT-x, AMD-V) to turn Linux into a Type 1 hypervisor. KVM provides the core virtualization infrastructure; QEMU provides device emulation (virtual disks, NICs, USB); and libvirt provides a management API.
Architecture stack:
- KVM kernel module (
/dev/kvm): handles CPU virtualization and memory management using hardware extensions. Each VM is a standard Linux process with additionalioctl()calls to/dev/kvm. - QEMU: userspace emulator that provides virtual hardware (virtio devices for optimal performance). Handles I/O operations that the guest OS cannot perform directly.
- libvirt: management daemon (
libvirtd) providing a unified API for VM lifecycle, networking (virtual bridges, NAT), and storage pool management. CLI tool:virsh.
Performance features:
- virtio: paravirtualized I/O drivers that bypass hardware emulation for near-native performance (virtio-net, virtio-blk, virtio-scsi)
- Huge pages: large memory pages (2MB/1GB) reduce TLB misses for memory-intensive VMs
- CPU pinning: bind vCPUs to specific physical cores for consistent performance
- PCI passthrough (VFIO): assign physical devices (GPUs, NICs) directly to VMs via IOMMU
KVM is the foundation for Proxmox VE, OpenStack, and Google Cloud Platform’s compute engine. AWS Nitro is a KVM derivative.
KVM setup and VM creation
# Verify KVM support
$ lsmod | grep kvm
kvm_intel 368640 4
kvm 1028096 1 kvm_intel
# Install KVM + management tools (Debian/Ubuntu)
$ sudo apt install qemu-kvm libvirt-daemon-system virtinst
# Create a VM with virt-install
$ sudo virt-install \
--name ubuntu-server \
--ram 4096 --vcpus 4 \
--disk size=40,format=qcow2,bus=virtio \
--network bridge=br0,model=virtio \
--os-variant ubuntu24.04 \
--cdrom /var/lib/libvirt/images/ubuntu-24.04-server.iso \
--graphics vnc
# Check KVM performance
$ virsh domstats ubuntu-server --cpu-total --balloon KVM is the most widely deployed hypervisor in the world when counting cloud infrastructure. Google Cloud, IBM Cloud, and DigitalOcean all run on KVM. Proxmox VE wraps KVM with a web UI, clustering, ZFS integration, and backup tools, making it accessible for homelabs and small businesses. For homelab builders running Proxmox on Beelink or similar mini PCs, KVM is what actually creates and runs the virtual machines behind the Proxmox interface. The virtio drivers are critical for performance; always install them in guest VMs (Linux includes them by default; Windows needs the virtio driver ISO). KVM’s position inside the Linux kernel means it benefits from every kernel security update and performance improvement automatically.