QEMU
How it works
In full-system emulation QEMU reproduces a virtual computer: an emulated CPU, memory and a set of devices (the device model). Guest code is translated block by block by TCG โ first into an architecture-independent intermediate representation (TCG ops) and then into native host code; when no dedicated JIT backend exists, the slower TCI interpreter is used. In user mode QEMU translates only the program's instructions, mapping guest system calls onto the host. When the guest architecture matches the host, QEMU can skip translation and run code directly on the CPU through the KVM accelerator (or Xen/HVF/Hyper-V), which exposes the processor's virtualization extensions. The "microvm" machine type trims the device model (no PCI or ACPI), cutting boot time and reducing attack surface โ making QEMU a convenient substrate for microVMs and agent sandboxes.
Problem solved
Running software and whole operating systems built for a CPU architecture different from the host, and the need for strong isolation of the execution environment. QEMU emulates foreign hardware in software and โ where possible โ accelerates virtualization in hardware, providing isolated machines for testing, CI and the safe execution of untrusted or agent-generated code.
Components
QEMU's dynamic binary translation engine: it translates guest code into an architecture-independent intermediate representation (TCG ops) and then into native host code. When no JIT backend exists, the TCI interpreter is used.
The hardware-virtualization path: when the guest architecture matches the host, QEMU hands execution to the KVM kernel module, reaching near-native performance. Xen, Apple HVF and Microsoft Hyper-V are also supported.
Official
The set of emulated devices and boards (e.g. q35) that make up the virtual computer: buses, timers, controllers and virtio devices exposed to the guest.
Official
A minimalist x86 machine type without PCI or ACPI, designed for short-lived guests and optimized for boot time and footprint. Inspired by Firecracker; convenient for microVMs and sandboxes.
Official
Implementation
Pure software emulation (TCG) carries a large performance overhead compared with native or KVM-accelerated execution.
KVM acceleration works only when the guest architecture matches the host and the CPU exposes virtualization extensions; otherwise QEMU falls back to the slower TCG.
The minimalist microvm machine type does not support PCI devices, ACPI, hotplug or live migration across QEMU versions, which limits its applicability.
Evolution
Fabrice Bellard releases the first version of QEMU โ a portable emulator based on dynamic binary translation.
The paper "QEMU, a Fast and Portable Dynamic Translator" (FREENIX) describes the architecture and translation mechanism.
After KVM landed in the Linux kernel (2.6.20), QEMU began serving as the userspace layer for KVM, combining emulation with near-native hardware virtualization.
Hyperparameters (configurable axes)
Choice between pure software emulation (TCG) and hardware virtualization (KVM/Xen/HVF/Hyper-V). Determines performance and whether a foreign architecture can run.
The emulated CPU architecture (x86-64, ARMv8, RISC-V, MIPS, PowerPC, SPARC and others) selected via the corresponding qemu-system-* binary.
The emulated board/machine model (e.g. q35, virt, microvm) that defines the device set, boot time and attack surface.
Allocation of virtual cores and guest RAM; kept deliberately small in microVMs for fast boot and density.
Hardware requirements
With KVM, QEMU uses the host CPU's virtualization extensions (VT-x/AMD-V), reaching near-native performance on matching architectures.
In TCG mode, emulation runs on any supported host regardless of hardware, at the cost of performance.