openskills.info
QEMU and KVM logoCourse Preview

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

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