QEMU
QEMU
QEMU supports a number of hypervisors (known as accelerators) as well as a JIT known as the Tiny Code Generator (TCG) capable of emulating many CPUs.
KVM
Linux
Arm (64 bit only), MIPS, PPC, RISC-V, s390x, x86
Xen
Linux (as dom0)
Arm, x86
Hypervisor Framework (hvf)
MacOS
x86 (64 bit only), Arm (64 bit only)
Windows Hypervisor Platform (whpx)
Windows
x86
NetBSD Virtual Machine Monitor (nvmm)
NetBSD
x86
Tiny Code Generator (tcg)
Linux, other POSIX, Windows, MacOS
Arm, x86, Loongarch64, MIPS, PPC, s390x, Sparc64
QEMU Options
Machine
Define the machine type, amount of memory etc
CPU
Type and number/topology of vCPUs. Most accelerators offer a host
cpu option which simply passes through your host CPU configuration without filtering out any features.
Accelerator
This will depend on the hypervisor you run. Note that the default is TCG, which is purely emulated, so you must specify an accelerator type to take advantage of hardware virtualization.
Devices
Additional devices that are not defined by default with the machine type.
Backends
Backends are how QEMU deals with the guest’s data, for example how a block device is stored, how network devices see the network or how a serial device is directed to the outside world.
Interfaces
How the system is displayed, how it is managed and controlled or debugged.
Boot
How the system boots, via firmware or direct kernel boot.
Device Emulation
Device Front End
All devices can be specified with the --device
command line option.
A front end is often paired with a back end, which describes how the host’s resources are used in the emulation.
Device Buses
In most cases the BUS a device is attached to can be inferred, for example PCI devices are generally automatically allocated to the next free address of first PCI bus found.
In complicated configurations you can explicitly specify what bus (
bus=ID
) a device is attached to along with its address (addr=N
).
Some devices, for example a PCI SCSI host controller, will add an additional buses to the system that other devices can be attached to.
which would be a bar device (with the ID of baz) which is attached to the first foo bus (foo.0) at address 1. The foo device which provides that bus is itself is attached to the first PCI bus (pci.0).
Device Back End
The back end describes how the data from the emulated device will be processed by QEMU.
Serial devices will be backed by a
--chardev
which can redirect the data to a file or socket or some other system.Storage devices are handled by
--blockdev
which will specify how blocks are handled, for example being stored in a qcow2 file or accessing a raw host disk partition.
Device Pass Through
Exposing a single USB device on the host system to the guest.
Dedicating a video card in a PCI slot to the exclusive use of the guest.
Last updated