Robots Atlas>ROBOTS ATLAS
Infrastructure

QEMU

2003ActiveUpdated: 19 November 2026Published
Key innovation
Dynamic binary translation (TCG) emulates full machines of foreign CPU architectures in software, while on matching guest/host architectures QEMU hands execution to hardware virtualization (KVM) โ€” combining emulation and virtualization in a single tool.
Category
Infrastructure
Abstraction level
Building block
Operation level
Agent runtimeDeploymentTooling
Use cases
Full-system emulation of foreign CPU architecturesMachine virtualization with KVM accelerationIsolated sandboxes and microVMs for AI agent codeCross-compilation and cross-debugging (user mode)Testing, CI and running untrusted codeEmbedded-systems development and hardware-platform emulation

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

TCG (Tiny Code Generator)CPU execution emulation via code translation

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.

KVM acceleratorVirtualization acceleration on matching architecture

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

Device model / machine typeReproducing the hardware seen by the guest

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

microvm machine typeLightweight microVM / sandbox substrate

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

Implementation pitfalls
TCG emulation is slower than nativeMedium

Pure software emulation (TCG) carries a large performance overhead compared with native or KVM-accelerated execution.

Fix:Where the guest architecture matches the host, use KVM (or Xen/HVF/Hyper-V); reserve TCG for foreign architectures.
KVM requires matching architecture and virtualization extensionsMedium

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.

Fix:Verify virtualization extensions (VT-x/AMD-V) and architecture match before assuming acceleration.
microvm drops PCI, ACPI, hotplug and migrationLow

The minimalist microvm machine type does not support PCI devices, ACPI, hotplug or live migration across QEMU versions, which limits its applicability.

Fix:Use microvm for short-lived, disposable guests (sandboxes/microVMs); choose q35/virt for full VMs.

Evolution

Original paper ยท 2005 ยท USENIX ATC 2005 (FREENIX Track) ยท Fabrice Bellard
QEMU, a Fast and Portable Dynamic Translator
Fabrice Bellard
2003
First QEMU release
Inflection point

Fabrice Bellard releases the first version of QEMU โ€” a portable emulator based on dynamic binary translation.

2005
QEMU paper published at USENIX

The paper "QEMU, a Fast and Portable Dynamic Translator" (FREENIX) describes the architecture and translation mechanism.

2007
QEMU becomes userspace for KVM
Inflection point

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)

Accelerator (tcg / kvm)Critical

Choice between pure software emulation (TCG) and hardware virtualization (KVM/Xen/HVF/Hyper-V). Determines performance and whether a foreign architecture can run.

Target architectureCritical

The emulated CPU architecture (x86-64, ARMv8, RISC-V, MIPS, PowerPC, SPARC and others) selected via the corresponding qemu-system-* binary.

Machine type (-M)High

The emulated board/machine model (e.g. q35, virt, microvm) that defines the device set, boot time and attack surface.

vCPUs and memoryMedium

Allocation of virtual cores and guest RAM; kept deliberately small in microVMs for fast boot and density.

Hardware requirements

Primary

With KVM, QEMU uses the host CPU's virtualization extensions (VT-x/AMD-V), reaching near-native performance on matching architectures.

Good fit

In TCG mode, emulation runs on any supported host regardless of hardware, at the cost of performance.