Installing QEMU on Debian with XFCE Desktop

In this one-off tutorial, we will install QEMU on a fresh full-(DVD)-installation of Debian 12.5.

Preamble: QEMU is a virtualization framework for Linux, including tools to emulate full systems inside your machine, and to install and manipulate resources such as disks and other virtually emulated hardware. It also includes tools to help with booting and installing Operating Systems, and a GUI called virt-manager to utilize many of its features in a graphical window environment. Virt-manager is a bit limited though, compared to what QEMU can do on the command-line. QEMU is an advanced framework, used in industry for all sorts of things, including but not limited to DevOps, build systems, CI/CD, and more. All of that, however, is beyond the scope of this tutorial, and you can find information on advanced uses of QEMU in many other places online.

  1. First you’ll need Debian freshly installed (I’m installing it in virt-manager / QEMU while writing this, using an Arch Linux host).
  2. You might want to consider adding a swap partition but I usually enable a swap file instead, after installing Debian:
    sudo fallocate -l 1G /swapfile
    sudo chmod 600 /swapfile
    sudo mkswap /swapfile
    sudo swapon /swapfile

    Then I recommend adding the swap-mount to your /etc/fstab file:

    sudo nano /etc/fstab
    NAME TYPE SIZE USED PRIO
    /swapfile swap swap defaults 0 0

    After editing the /etc/fstab file you’ll want to reboot and log-in again.

Now it’s useful to remove the Debian CD/DVD entry from the APT configuration file to avoid unnecessary prompts:

sudo nano /etc/apt/sources.list

delete the “deb cdrom:” entry

Next, update Debian in case there’s any updates needed after installation:

sudo apt-get update
sudo apt-get upgrade -y

Now, we can install QEMU, complete with its default UI (virt-manager) using the apt-get (or apt) command:

sudo apt-get install virt-manager

Now that virt-manager is installed, you can either launch it from a terminal:

virt-manager

(enter your regular user SUDO password when prompted)

There you have it, QEMU is installed and ready to use.

Next steps would be Creating a new virtual machine, configuring it, and installing an Operating System.

There are many tutorials online dealing with how to create, configure, and install an Operating System using QEMU on its own, or through virt-manager. If you’re up for a challenge, try installing a new virtual machine without virt-manager. Or try installing QEMU itself without (or without) using APT.

See https://qemu.org for more information about QEMU and other ways to install it on various distributions, and for links to full documentation.

Leave a comment

Your email address will not be published. Required fields are marked *