Skip Navigation

Installing QEMU on Linux

QEMU is available in the package repositories of most major Linux distributions, so installing it should be straightforward. QEMU has the best overall support on Linux hosts, so it is less finicky to get working on Linux than it is on Mac or Windows hosts.

Page Contents

Installation

Many distributions split QEMU into multiple packages, so you might need to install more than one of them. Note that you do NOT need libvirt, virt-manager, or any QEMU frontends. It isn’t possible to document the exact installation process for each distribution; however, I have noted a few of them below.

Alpine Linux

QEMU is in the community repository for Alpine Linux. A basic installation can be performed using:

apk add qemu qemu-img qemu-modules qemu-system-aarch64 qemu-system-arm qemu-system-x86_64 qemu-tools

Support for additional architecture targets can be added by installing additional qemu-system-* packages. See the Alpine Package Browser for a list.

Be sure to add your user account to the kvm and qemu groups to enable hardware acceleration and network configuration support.

Arch / Artix / Manjaro Linux

Install the qemu-full package:

pacman -S qemu-full

Add your user account to the kvm group to enable hardware acceleration.

Ubuntu / Linux Mint / Derivatives

At least on Linux Mint, try:

apt install qemu-system

Since the packages are in the Universe repository, package names may shift with time. Search for qemu-related packages using:

apt-cache search qemu

The kvm Group

On most distributions, you will need to add your regular user account to the kvm group to get access to hardware acceleration (Kernel-based Virtual Machine support). Some distributions might use a different group for this purpose. Check the ownership of /dev/kvm to be sure:

ls -l /dev/kvm

If you do not have a /dev/kvm file, then hardware virtual machine extensions are probably turned off in your BIOS/UEFI firmware. Most distributions will load the appropriate kvm module automatically if the extensions are enabled. However, if you’re running a custom kernel or an esoteric distribution, you may need to load the appropriate module manually.

Nested Virtualization

On Linux hosts with KVM acceleration, it is possible to enable nested virtualization, which permits running accelerated virtual machines inside Linux virtual machines. This is a niche use case, but it is pretty easy to enable.

Create a file at /etc/modprobe.d/kvm.conf with the following contents.

If you have an AMD CPU:

options kvm_amd nested=1

If you have an Intel CPU:

options kvm_intel nested=1

Once the file has been created, unload and reload the corresponding module:

modprobe -r kvm_amd
modprobe kvm_amd

Or for Intel:

modprobe -r kvm_intel
modprobe kvm_intel

Firmware Files

Look for firmware files (e.g. for UEFI booting) in /usr/share/qemu on most distributions.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.