Buildroot: Build a Minimal Linux Image and Boot It in QEMU

Build an embedded Linux image with Buildroot's qemu_x86_64_defconfig, then boot the kernel and root filesystem in QEMU without any hardware.

Embedded Published 3 min read

Buildroot generates a complete embedded Linux system (toolchain, kernel, root filesystem) by cross-compilation. This guide builds the ready-made configuration for QEMU’s x86-64 PC and boots it, so you can try the workflow without a development board.

What you need

The manual lists make (3.81 or later), gcc and g++ (4.8 or later), perl, bc, rsync, file, unzip and wget as mandatory build tools. make menuconfig additionally needs the ncurses development files. The manual says you can and should build everything as a normal user, so do not use root for the build.

Install the tools plus QEMU. The package names below are the usual ones for each distribution, and the dependency step is tested in a container.

✓ tested · debian,ubuntu
apt-get update
apt-get install -y build-essential libncurses-dev bc rsync file unzip wget cpio perl python3 bison flex qemu-system-x86
✓ tested · fedora
dnf install -y gcc gcc-c++ make ncurses-devel bc rsync file unzip wget cpio perl python3 bison flex patch diffutils which qemu-system-x86
✓ tested · arch
pacman -Sy --noconfirm base-devel ncurses bc rsync file unzip wget cpio perl python bison flex qemu-system-x86

Download and select a configuration

The download page offers archives named buildroot-<version>.tar.xz. At the time of writing, the latest stable release listed there is 2026.08.1; the long-term support release is 2025.02.19. Pick whichever fits your needs; the steps below are the same. If you want a refresher on unpacking .tar.xz files, the tar guide covers xz and other compression formats.

Buildroot ships ready-made defaults (defconfigs). make list-defconfigs shows the boards that have one, and qemu_x86_64_defconfig is the one the QEMU board readme describes.

✓ tested · debian,ubuntu,fedora,arch
mkdir -p /tmp/br-build
cd /tmp/br-build
wget -q https://buildroot.org/downloads/buildroot-2026.08.1.tar.xz
tar -xf buildroot-2026.08.1.tar.xz
make -C buildroot-2026.08.1 qemu_x86_64_defconfig
grep -c BR2_ buildroot-2026.08.1/.config

To change anything (for example, add a package), run make menuconfig inside the source directory. Leave it alone for a first build.

Build the image

Run make in the source directory. It downloads the sources of every component and compiles the toolchain, kernel and root filesystem, so it needs network access and can take a long time on a first run. It is not run in the article tests for that reason.

Before you start, check how much free space the build directory has with df. The disk usage guide explains df, du and ncdu.

cd buildroot-2026.08.1
make

When it finishes, output/images/ holds the files for the target. The manual notes that output/target/ is only an almost-complete root filesystem and should not be used on the target directly.

Boot the Buildroot image in QEMU

The board readme gives this command for the qemu_x86_64_defconfig setup. Run it from the Buildroot source directory.

qemu-system-x86_64 -M pc -kernel output/images/bzImage \
  -drive file=output/images/rootfs.ext2,if=virtio,format=raw \
  -append "rootwait root=/dev/vda console=tty1 console=ttyS0" \
  -serial stdio -net nic,model=virtio -net user

It loads the kernel image directly, attaches the ext2 root filesystem as a virtio disk, sends kernel messages to both the graphical console and your terminal, and gives the guest user-mode networking. The readme says the login prompt appears in the graphical window. You can add -smp N to emulate N CPUs.

Next steps

Use make menuconfig to select packages and system settings, then run make again.

Sources

  1. Buildroot project home page
  2. Buildroot download page
  3. The Buildroot user manual
  4. Buildroot board/qemu/x86_64/readme.txt

#Buildroot #Qemu #Embedded #Cross-Compilation #Rootfs

This article was drafted with AI assistance, fact-checked against the sources listed above and reviewed by a human editor before publication. Spotted an error? See our corrections policy.