Introduction
QEMU (Quick Emulator) is an open-source machine emulator and virtualizer. In emulation mode it can run software built for one CPU architecture on another. When paired with KVM on Linux, it becomes a high-performance hypervisor capable of running virtual machines at near-native speed. QEMU underpins many cloud platforms and virtualization tools.
What QEMU Does
- Emulates full systems including CPU, memory, storage, and network devices for 20+ architectures
- Provides near-native VM performance when combined with KVM hardware acceleration
- Creates and manages disk images in qcow2, raw, vmdk, and other formats
- Supports live migration of running VMs between physical hosts
- Offers user-mode emulation for running individual binaries built for foreign architectures
Architecture Overview
QEMU uses a Tiny Code Generator (TCG) for dynamic binary translation when emulating foreign architectures. With KVM enabled, it offloads CPU virtualization to the Linux kernel via /dev/kvm, handling only device emulation in userspace. QEMU models each VM as a process with threads for vCPUs and I/O. Virtio paravirtualized devices provide efficient disk, network, and memory balloon interfaces between guest and host.
Self-Hosting & Configuration
- Install via package managers:
apt install qemu-systemordnf install qemu-kvm - Enable KVM by loading the
kvm_intelorkvm_amdkernel module - Create disk images with
qemu-img create -f qcow2for copy-on-write snapshots - Pass
-enable-kvm -cpu hostfor best performance on compatible hardware - Use
-nic userfor simple NAT networking or-nic tapfor bridged access
Key Features
- Supports x86, ARM, RISC-V, MIPS, PowerPC, s390x, and many more architectures
- Snapshot and rollback of entire VM state including memory and disk
- Live migration for moving VMs between hosts with minimal downtime
- Virtio device framework for high-throughput paravirtualized I/O
- Serves as the backend for libvirt, Proxmox, OpenStack, and Firecracker
Comparison with Similar Tools
- VirtualBox — desktop-focused with a GUI; QEMU is more flexible and powers production cloud infrastructure
- VMware ESXi — enterprise hypervisor with proprietary management; QEMU/KVM is free and equally performant
- Firecracker — micro-VM engine built on KVM for serverless; QEMU provides full system emulation with richer device support
- Hyper-V — Windows-native hypervisor; QEMU/KVM is the Linux standard and supports cross-architecture emulation
FAQ
Q: How does QEMU relate to KVM? A: KVM is a Linux kernel module that provides hardware virtualization. QEMU uses KVM for CPU acceleration and handles device emulation, networking, and disk I/O.
Q: Can QEMU run macOS guests? A: Technically possible with the right configuration, but Apple restricts macOS to Apple hardware in their EULA.
Q: What is qcow2? A: QEMU Copy-On-Write v2 is a disk image format supporting snapshots, compression, and thin provisioning.
Q: Is QEMU suitable for production workloads? A: Yes. With KVM acceleration, QEMU powers major cloud providers and enterprise virtualization platforms like OpenStack and Proxmox.