Skip to main content
Version: v4 (current)

Install QEMU

QEMU (short for "Quick Emulator") is a generic and open source machine emulator and virtualiser.

When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC). By using dynamic translation, it achieves very good performance.

When used as a virtualiser, QEMU achieves near native performance by executing the guest code directly on the host CPU. QEMU supports virtualisation when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualise x86, server and embedded PowerPC, 64-bit POWER, S390, 32-bit and 64-bit ARM, and MIPS guests.

See also: Virtualization and Hypervisors: Explaining QEMU, KVM, and Libvirt by Sumit Ghosh

Why use QEMU?

  • Like ESXi, its capable of PCIe-passthrough for GPUs. This is in contrast with Firecracker and VirtualBox which cannot.
  • Unlike ESXi, it's free.
  • When used with KVM, QEMU provides near-native levels of performance.
  • Can be used inside Kubernetes via Kubevirt
  • It's fast - not quite as fast as LXD, Firecracker, or Cloud-Hypervisor (formerly NEMU), but its far more mature, has a larger community, and more documentation available.
  • Unlike Multipass it can also create Windows and MacOS guests.
  • Unlike Firecracker it supports pinning memory addresses (and thus PCIe-passthrough) where firecracker cannot because it would break their core feature of over-subscription.
  • Can be run in a micro-vm configuration to achieve a smaller memory footprint (Inspired by Firecracker).

These qualities make QEMU well-suited for those seeking a highly-performant and fully-featured hypervisor.

Requirements

  • Linux host running Debian 12 or Ubuntu 22.04
  • VNC viewer software installed on the machine you will use to access the VM

Installation

  • Install QEMU and its dependencies

    sudo apt-get install -y qemu-kvm \
    bridge-utils \
    virtinst\
    ovmf \
    qemu-utils \
    cloud-image-utils \
    tmux \
    whois \
    git \
    jq \
    git-extras \
    guestfs-tools