← Back to list

QEMU: The Beginnings

QEMU (Quick Emulator) is an amazing piece of software that allows to run multiple different guest OS on top of host OS. But when using it…

Suraj Kareppagol · 2026-05-01 17:43 · 0 claps · 2.8 min read
#c-programming #virtualization #qemu #software-development #coding
Open on Medium ↗
Wiki topics: GEN · Genomics & Sequencing 💻 · Programming

QEMU: The Beginnings

QEMU Logo

QEMU Logo

QEMU (Quick Emulator) is an amazing piece of software that allows to run multiple different guest OS on top of host OS. But when using it as a CLI it might be intimidating. Lets go through from scratch, build QEMU from source and we will run alpine OS on top Linux Mint.

Building QEMU from source

QEMU has several releases and at the time of this post QEMU 11.0.0 is released so lets use it. Follow the below steps to download and build it from source. Also you can directly get these steps from the download page.

wget https://download.qemu.org/qemu-11.0.0.tar.xz
tar xvJf qemu-11.0.0.tar.xz
cd qemu-11.0.0

The above commands are used to download the tar file and extract it. Once extracted, we will cd into the extracted directory.

sudo apt install make cmake gcc ninja-build meson libglib2.0-dev libgtk2.0-dev

Before configuring the build lets make sure we have everything installed. This is on Linux Mint and if you are using other distributions such as Fedora then the package names might change.

Now once we are in the extracted directory we will create a build directory such that we don’t pollute the source.

mkdir build
cd build

Lets configure the build. QEMU is very flexible when it comes to configuration, with the --help argument you will see a very large set of options to choose.

../configuration --help

Currently we will stick to just two options, --target-list=x86_64-softmmu and --enable-gtk. The former option will allow us to emulate full x86_64 systems and later will allows us to have a GUI window for the virtual machine.

../configure --target-list=x86_64-softmmu --enable-gtk

Once completed we will run the below two commands to build all the binaries and install them system wide.

make -j 4
sudo make install

Building QEMU from source

Building QEMU from source

Using QEMU CLI

Before we start using QEMU CLI we will download the alpine OS . It is a lightweight OS and we will be able to quickly download and use it. You can download it from official page or use the below command.

wget https://dl-cdn.alpinelinux.org/alpine/v3.23/releases/x86_64/alpine-standard-3.23.4-x86_64.iso

Using QEMU is similar to using a real system. We need explicitly configure all the options such as RAM, CPU Cores, Disk Image and others. Here Disk Image is important because the OS will be installed into it and at later this will be used to boot. For this particular requirement it provides qemu-img. Using this we can create a disk image of desired size and will pass it to the CLI such that OS can be installed and can be used later.

qemu-img create -f qcow2 alpine.qcow2 2G
qemu-system-x86_64 \
  -cdrom alpine-standard-3.23.4-x86_64.iso \
  -hda alpine.img \
  -boot d \
  -m 4096 \
  -smp 4 \
  -display gtk

Lets unpack this command.

  • -cdrom — Attaches the ISO image
  • -hda — Attaches the empty disk for installation
  • -boot d — Boots from CD-ROM first
  • -m 4096 — Allocates 4 GB RAM
  • -smp 4 — Allocates 4 CPU cores
  • -display gtk — Opens a graphical window

These commands are enough to get started. Once you install the OS and want to launch QEMU again use the below command. This time it boots from the disk image.

qemu-system-x86_64 \
  -hda alpine.img \
  -boot c\
  -m 4096 \
  -smp 4 \
  -display gtk

Alpine as Guest OS

Alpine as Guest OS

This was just an introduction to the world of QEMU. In the upcoming post I will explore more concepts both on how to use it and the related tools and how it works internally.


메타데이터
post_id
67d5906ca8a8
slug
qemu-the-beginnings-67d5906ca8a8
url
https://medium.com/@surajkareppagol.dev/qemu-the-beginnings-67d5906ca8a8
canonical_url
https://medium.com/@surajkareppagol.dev/qemu-the-beginnings-67d5906ca8a8
author_url
https://medium.com/@surajkareppagol.dev
status
ok
fetched_at
2026-06-21 07:44:09