The Quick Emulator (QEMU) is a free and open-source machine emulator and virtualizer. As a Virtual Machine Monitor (VMM) it supports a number of hypervisors, including the Linux-based Kernel-based Virtual Machine (KVM), Xen, MacOS's HVF, Windows' Hyper-V and a number of others. It is also capable of emulating a number of instruction set architectures on any supported host through its JIT binary translator known as the Tiny Code Generator (TCG). This allows it to emulate full systems or run individual programs compiled for one processor architecture on any other. QEMU supports the emulation of x86, ARM, PowerPC, RISC-V, and many others.

Licensing QEMU is free software originally developed by Fabrice Bellard; the first preview release was in 2003. Different components of QEMU are licensed under the GNU General Public License (GPL), BSD license, GNU Lesser General Public License (LGPL), or other GPL-compatible licenses.

Operating modes QEMU has multiple operating modes: User-mode emulation. In the user emulation mode, QEMU runs single Linux or Darwin/macOS programs that were compiled for a different instruction set. System calls are thunked for endianness and for 32/64-bit mismatches. Fast cross-compilation and cross-debugging are the main targets for user-mode emulation. System emulation. In the system emulation mode, QEMU emulates a full computer system, including peripherals. It can be used to provide virtual hosting of several virtual computers on a single computer. QEMU can boot many guest operating systems, including Linux, Solaris, Microsoft Windows, DOS, and BSD; it supports emulating several instruction sets, including x86, x86-64, MIPS, ARMv7, ARMv8, PowerPC, RISC-V, SPARC, ETRAX CRIS and MicroBlaze. Hypervisor support. In the hypervisor support mode, QEMU either acts as a virtual-machine manager (VMM) or as a device-emulation back-end for virtual machines running under a hypervisor. The most common is Linux's KVM, but the project supports a number of hypervisors, including Xen, Apple's HVF, Windows' WHPX, and NetBSD's NVMM.

Features QEMU supports the emulation of various architectures, including x86, MIPS64 (up to Release 6), SPARC (sun4m and sun4u), ARM (Integrator/CP and Versatile/PB), SuperH, PowerPC (PReP and Power Macintosh), ETRAX CRIS, MicroBlaze, and RISC-V. It supports saving the virtual machine state while all programs are running. Guest operating systems do not need patching to run inside QEMU.

The virtual machine can interface with many types of physical host hardware, including the user's hard disks, CD-ROM drives, network cards, audio interfaces, and USB devices. USB devices can be emulated entirely, or the host's USB devices can be used, although this requires administrator privileges and does not work with some devices.

Virtual disk images can be stored in QCOW format, which can significantly reduce image size. QCOW images only occupy the actual used disk space, not the full configured capacity. This means a configured 120 GB disk may only occupy a few hundred megabytes on the host, as QCOW does not store unused disk space in the image file.

The QCOW2 format also allows the creation of overlay images, which are files that store only the changes made from an original (unmodified) base image file. This enables the emulated disk's contents to be reverted to an earlier state. For instance, a base image could contain a fresh installation of a known working operating system, and overlay images can be used to record changes. Should the guest system become unusable (through virus attack, accidental system destruction, etc.), the user can delete the overlay and use an earlier emulated disk image.

QEMU can emulate network cards (of different models) that share the host system's connectivity by translating network addresses, effectively allowing the guest to use the same network as the host. The virtual network cards can also connect to network cards of other instances of QEMU or to local TAP interfaces. Network connectivity can also be achieved by bridging a TUN/TAP interface used by QEMU with a non-virtual Ethernet interface on the host OS using the host OS's bridging features.

QEMU integrates several services to allow the host and guest systems to communicate, for example: an integrated SMB server and network-port redirection (to allow incoming connections to the virtual machine). It can also boot Linux kernels without a bootloader.

QEMU does not depend on the presence of graphical output methods on the host system. Instead, it provides access to the guest OS screen via an integrated VNC server. It can also use an emulated serial line without any screen, with applicable operating systems.

Simulating multiple CPUs running SMP is possible.

QEMU does not require administrative rights to run unless additional kernel modules are used to improve speed (like KQEMU) or certain modes of its network connectivity model are utilized.

Tiny Code Generator Since QEMU Version 0.10.0 the Tiny Code Generator (TCG) replaced the previous DynGen system, which relied on GCC 3.x to work. -- a review of how the old dyngen worked

As QEMU runs basic blocks of target code are translated into a machine-independent intermediate representation known as TCG ops. The operations then go through simple optimization passes before being passed to the backend which will emit target code for the host's architecture. TCG requires dedicated code written to support every architecture it runs on, so that the JIT knows what to translate the TCG ops to. If no dedicated JIT code is available for the architecture, TCG falls back to a slow interpreter mode called TCG Interpreter (TCI).

Accelerator KQEMU was a Linux kernel module, also written by Fabrice Bellard, which notably sped up emulation of x86 or x86-64 guests on platforms with the same CPU architecture. This worked by running user mode code (and optionally some kernel code) directly on the host computer's CPU, and by using processor and peripheral emulation only for kernel-mode and real-mode code. KQEMU could execute code from many guest operating systems even if the host CPU did not support hardware-assisted virtualization. KQEMU was initially a closed-source product available free of charge but starting from version 1.3.0pre10 (February 2007), it was relicensed under the GNU General Public License. QEMU versions starting with 0.12.0 () support large memory which makes them incompatible with KQEMU. Newer releases of QEMU have completely removed support for KQEMU.

QVM86 was a GNU GPLv2 licensed drop-in replacement for the then closed-source KQEMU. The developers of QVM86 ceased development in January 2007.

Kernel-based Virtual Machine (KVM) has mostly taken over as the Linux-based hardware-assisted virtualization solution for use with QEMU following the lack of support for KQEMU and QVM86. QEMU can also use KVM on other architectures like ARM and MIPS.

Intel's Hardware Accelerated Execution Manager (HAXM) is an open-source alternative to KVM for x86-based hardware-assisted virtualization on NetBSD, Linux, Windows and macOS using Intel VT. Intel mostly solicits its use with QEMU for Android development. Starting with version 2.9.0, the official QEMU includes support for HAXM, under the name Hax.

QEMU also supports the following accelerators: hvf, Apple's based on Intel VT. whpx, Microsoft's Windows Hypervisor Platform based on Intel VT or AMD-V. tcg, QEMU's own Tiny Code Generator. This is the default.

Supported disk image formats QEMU supports a number of disk image formats.

Raw images (.img) simplest image that contain sector-by-sector contents of a disk QCOW2 (.qcow2) - native QEMU format supporting a number of features like snapshots, compression, and encryption VirtualBox Virtual Disk Image (.vdi) VMware Virtual Machine Disk (.vmdk) Virtual PC Virtual Hard Disk (.vhd, .vhdx)

It is capable of read only access with a number of other formats including:

Bochs - native format of the Bochs emulator Linux cloop - Linux Compressed Loop image macOS Universal Disk Image Format (.dmg) Parallels disk image (.hdd, .hds) CD/DVD images (.iso) that contain sector-by-sector contents of an optical disk (e.g. booting live OSes)

QEMU can also directly access host devices and partitions which allows it to work with other storage technologies like iSCSI, LVM, LUKS, NBD, NVMe and ZFS.

It can also support exporting a file-system into a Virtual VFAT device.

QEMU Object Model The QEMU Object Model (QOM) provides a framework for registering types that users can make and instantiating objects from those types.

QOM provides the following features: System for dynamically registering types Support for single-inheritance of types Multiple inheritances of stateless interfaces

Parallel emulation Virtualization solutions that use QEMU can execute multiple virtual CPUs in parallel. For user-mode emulation, QEMU maps emulated threads to host threads. QEMU can run a host thread for each emulated virtual CPU (vCPU) for full system emulation. This depends on the guest being updated to support parallel system emulation, currently ARM, Alpha, HP-PA, PowerPC, RISC-V, s390x, x86, and Xtensa. Otherwise, a single thread is used to emulate all virtual CPUs (vCPUs), which executes each vCPU in a round-robin manner.

Integration VirtualBox VirtualBox, first released in January 2007, used some of QEMU's virtual hardware devices, and had a built-in dynamic re-compiler based on QEMU. As with KQEMU, VirtualBox runs nearly all guest code natively on the host via the VMM (Virtual Machine Manager) and uses the re-compiler only as a fallback mechanism – for example, when guest code executes in real mode. In addition, VirtualBox did a lot of code analysis and patching using a built-in disassembler to minimize recompilation. VirtualBox is free and open-source (available under GPL), except for certain features.

Xen-HVM Xen, a virtual machine monitor, can run in HVM (hardware virtual machine) mode, using Intel VT-x or AMD-V hardware x86 virtualization extensions and ARM Cortex-A7 and Cortex-A15 virtualization extensions. This means that instead of para-virtualized devices, a real set of virtual hardware is exposed to the DomU, enabling it to use real device drivers.

QEMU includes several components: CPU emulators, emulated devices, generic devices, machine descriptions, user interface, and a debugger. The emulated devices and generic devices in QEMU make up its device models for I/O virtualization. They comprise a PIIX3 IDE (with some rudimentary PIIX4 capabilities), Cirrus Logic or plain VGA emulated video, RTL8139 or E1000 network emulation, and ACPI support.Demystifying Xen HVM APIC support is provided by Xen.

Xen-HVM utilizes device emulation based on the QEMU project to deliver I/O virtualization to virtual machines (VMs). Hardware is emulated through a QEMU "device model" daemon running as a backend in Dom0. Unlike other QEMU modes, such as dynamic translation or KVM, the hypervisor fully manages virtual CPUs, pausing them as necessary while QEMU handles memory-mapped I/O emulation.

KVM KVM (Kernel-based Virtual Machine) is a FreeBSD and Linux kernel module that allows a user space program access to the hardware virtualization features of various processors, with which QEMU can offer virtualization for x86, PowerPC, and S/390 guests. When the target architecture is the same as the host architecture, QEMU can make use of KVM particular features, such as acceleration.

Win4Lin Pro Desktop In early 2005, Win4Lin introduced Win4Lin Pro Desktop, based on a 'tuned' version of QEMU and KQEMU and it hosts NT-versions of Windows. In June 2006,win4lin VDS announcement Win4Lin released Win4Lin Virtual Desktop Server based on the same code base. Win4Lin Virtual Desktop Server serves Microsoft Windows sessions to thin clients from a Linux server.