QEMU and KVM
QEMU models a complete computer in software. On Linux, KVM lets QEMU run supported guest code through the host CPU's virtualization features instead of translating every instruction.
itVirtualization, containers, and orchestration | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: QEMU and KVM
QEMU is the workshop that assembles a computer inside a process: processor, memory, disk, network card, firmware, display, and the small collection of odd devices that make a guest believe it has arrived somewhere physical. KVM is the Linux kernel facility that lets a compatible guest processor run with hardware assistance. The names arrive as a pair because the arrangement needs both. One builds the stage. The other lets the actors move at a useful speed.
The useful distinction is that QEMU can work without KVM. Its Tiny Code Generator, or TCG, translates guest instructions when the guest architecture differs from the host or acceleration is unavailable. KVM is for supported Linux host and guest combinations. It is not the bit that supplies disks or networking, which is fortunate because a kernel API would make a rather severe desktop environment.
A machine type defines the board the guest sees, and a CPU model defines its visible processor features. Then come devices. An emulated device imitates familiar hardware. A virtio device is designed for virtual machines and needs a guest driver. Each device has a frontend for the guest and a backend for the host resource. Keep those sides separate and many configuration mysteries become less mystical.
Storage has one quietly alarming property: a qcow2 overlay is not an independent disk. It reads unchanged blocks from its backing file. Move or delete the base and the overlay loses part of its past, which is an inefficient form of archaeology. A disk is also not the whole running machine. Memory, virtual CPU state, and device state are elsewhere when the guest is alive.
Control has layers too. A direct QEMU command line is precise. The human monitor is for interactive inspection. QMP is the JSON control channel for applications. libvirt adds a managed domain definition and lifecycle tools such as virsh. If libvirt starts the VM, change the domain definition, not the process command line that will vanish at the next restart.
Read Intro for the full QEMU and KVM execution path. Slides compress the machine, device, storage, and control choices into a map. Cheatsheet is the lookup page when an image chain, CPU model, or KVM failure needs a first boundary. Reference is where the official option details live, ready for the moment the long command line decides it has more nouns than a reasonable machine should need.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.qemu.org/
Supports
- QEMU project identity and official documentation entry point
- https://www.qemu.org/docs/master/system/introduction.html
Supports
- Complete machine model of CPU, memory, and emulated devices
- Accelerator roles, supported host combinations, and TCG default
- Architecture and machine-specific configuration warning
- https://www.qemu.org/docs/master/about/emulation.html
Supports
- TCG system and user-mode emulation
- Cross-architecture emulation scope
- https://www.qemu.org/docs/master/system/qemu-manpage.html
Supports
- Accelerator, machine, CPU, memory, boot, device, display, and network options
- Multiple accelerator fallback behavior
- Runtime machine configuration
- https://www.qemu.org/docs/master/system/device-emulation.html
Supports
- Device frontend, bus, backend, passthrough, and virtio concepts
- Guest-visible device and host-backend separation
- https://www.qemu.org/docs/master/system/images.html
Supports
- Raw and qcow2 characteristics
- Snapshots, backing files, image chains, and locking
- Distinction between disk and complete virtual machine state
- https://www.qemu.org/docs/master/tools/qemu-img.html
Supports
- Image create, info, check, convert, map, and rebase operations
- Warning against modifying images in use
- Format and backing-chain inspection
- https://www.qemu.org/docs/master/system/qemu-cpu-models.html
Supports
- Host passthrough, named CPU models, and feature configuration
- CPU model tradeoffs for performance and migration
- QEMU and libvirt CPU configuration forms
- https://www.qemu.org/docs/master/system/monitor.html
Supports
- Human monitor purpose and commands
- Runtime inspection and control
- https://www.qemu.org/docs/master/interop/qmp-intro.html
Supports
- QMP as a JSON protocol for application control
- Machine-oriented command and event interface
- https://www.qemu.org/docs/master/system/security.html
Supports
- Virtualization and non-virtualization security-use distinctions
- Supported machine types for the virtualization security model
- Device, process, and deployment attack-surface considerations
- https://docs.kernel.org/virt/kvm/index.html
Supports
- Canonical Linux KVM documentation index
- KVM API, device, and architecture documentation
- https://docs.kernel.org/virt/kvm/api.html
Supports
- File-descriptor and ioctl structure of the KVM userspace API
- System, virtual machine, and virtual CPU object creation
- Guest memory registration, run structure, and exit handling
- https://libvirt.org/drvqemu.html
Supports
- Libvirt management of QEMU with KVM, TCG, and other accelerators
- Process security architecture and migration compatibility
- https://libvirt.org/formatdomain.html
Supports
- Domain definitions for CPU, memory, storage, networking, and devices
- QEMU and KVM domain configuration vocabulary
- https://github.com/sindresorhus/awesome
Supports
- Starting index used for the required awesome-list discovery
- https://github.com/Wenzel/awesome-virtualization
Supports
- Discovery of Firecracker, crosvm, Cloud Hypervisor, and rust-vmm
- Curated virtualization ecosystem and KVM and QEMU sections
- https://firecracker-microvm.github.io/
Supports
- Firecracker as a KVM-based virtual machine monitor
- Minimal device model and microVM workload focus
- https://crosvm.dev/book/
Supports
- crosvm as a virtual machine monitor
- Per-device sandboxing, KVM origins, devices, architecture, and operation
- https://www.cloudhypervisor.org/
Supports
- Rust virtual machine monitor for modern cloud workloads
- Minimal emulation, virtio, passthrough, API, and migration scope
- https://github.com/rust-vmm/community
Supports
- Community for reusable Rust virtual machine monitor components
- KVM interface and virtio component ecosystem
- https://www.qemu.org/docs/master/devel/migration/compatibility.html
Supports
- Cross-release migration compatibility and versioned machine types
- https://www.qemu.org/docs/master/devel/migration/main.html
Supports
- Migration save and restore of configured guest device state
- https://www.qemu.org/2018/02/09/understanding-qemu-devices/
Supports
- Virtio device behavior and reduced device-register exits
- https://www.qemu.org/2018/01/04/spectre/
Supports
- CPU model, host kernel, firmware, microcode, and migration implications of mitigations
- https://www.qemu.org/2018/08/15/qemu-3-0-0/
Supports
- Active block mirroring and post-copy migration recovery changes
- https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio
Supports
- Virtio specification standardization
- https://www.proxmox.com/en/products/proxmox-virtual-environment/overview
Supports
- Proxmox VE placement in the KVM and QEMU platform ecosystem
- https://docs.openstack.org/nova/latest/admin/configuration/hypervisors/kvm.html
Supports
- OpenStack Nova KVM hypervisor configuration
- https://kubevirt.io/user-guide/architecture/
Supports
- KubeVirt architecture and QEMU-based virtual machine lifecycle
- https://www.qemu.org/blog/category/releases/index.html
Supports
- QEMU release dates and release archive
