TTR Networks

What is QEMU?

Quick Emulator

QEMU (Quick Emulator) is free, open-source software that runs virtual machines, by emulating another processor or by using hardware virtualisation.

QEMU has two main ways of running a guest. In full emulation, its Tiny Code Generator (TCG) translates the guest's machine instructions into the host's, so an x86 operating system can boot on an ARM computer, or the other way round. That works almost anywhere but is much slower than native. When the guest and host share an architecture, QEMU can hand execution to a hardware accelerator instead, such as KVM on Linux or Hypervisor.framework on macOS, and run at close to native speed while QEMU still provides the virtual hardware: disks (often qcow2 images), network cards and a serial console. It also has a user-mode emulator for running single programs built for another CPU, which is what lets Docker run amd64 containers on an ARM host.

Network engineers meet QEMU mostly in labs. Many router operating systems, including VyOS, are shipped as disk images or ISOs rather than containers, and lab tools such as GNS3, EVE-NG and containerlab use QEMU under the hood to run them. Each virtual NIC is usually attached to a tap interface on the host, which can be bridged into the rest of the lab so the VM sits on the same layer-2 segment as other devices. Common surprises are slow boots under emulation, guests with several virtual CPUs behaving less reliably under TCG than single-CPU ones, and VMs on the same segment clashing because they were given the same MAC address. See also veth pairs, which connect namespaces and containers in the same kinds of lab. The Packets That Never Come Back lesson runs VyOS as a QEMU virtual machine inside a container.

Lessons that use QEMU

  • Building a network lab on an Apple Silicon MacBeginner · 45 min

    Run real network labs on an M-series Mac: native FRR and Linux containers, x86-only images through Rosetta, and full x86 VyOS VMs under QEMU in Docker, with the pitfalls that stop most people and a starter lab that mixes all three.

  • IPv6 on VyOS: setup and routingBeginner · 55 min

    Number a site from an ISP's /48 on VyOS: WAN and blackhole routes, SLAAC with Router Advertisements, handing a /56 to a downstream router statically and with DHCPv6 prefix delegation, and the forward firewall IPv6 needs because there's no NAT. Every output comes from a real two-router VyOS lab.

  • Setting up VyOS with basic BGPIntermediate · 50 min

    Build a VyOS edge router from scratch: one upstream transit provider, one Internet Exchange route server, and the import and export policy that keeps both safe. Every command and output comes from a real VyOS lab.

  • Packets That Never Come BackIntermediate · 75 min

    Advanced packet capture with tcpdump, and how to find where packets die on a VyOS network: missing NAT and return routes, asymmetric routing through a stateful firewall, and MTU black holes, all diagnosed on a real VyOS router.

Related terms