Skip to main content

QEMU

QEMU is a machine emulator and virtualizer. It is used throughout the embedded notes here — see Buildroot and U-Boot.

Install

Build from source on Debian/Ubuntu:

# Remove the apt package if present
sudo apt-get remove --auto-remove qemu

sudo apt install build-essential
sudo apt install -y ninja-build
sudo apt install -y libglib2.0-dev libpixman-1-dev

wget https://download.qemu.org/qemu-6.2.0.tar.xz
qemu_ver=$(echo qemu-* 2>&1 | grep -oP 'qemu-\K.*(?=\.tar\.xz)')
tar xvJf qemu-$qemu_ver.tar.xz

cd qemu-$qemu_ver
./configure
make -j$(($(nproc) - 1))
sudo make install

cd ..

# Remove the source tree after installing
rm -R qemu-$qemu_ver

Run

qemu-system-arm -M vexpress-a9 -m 256 -kernel u-boot -nographic

# Press Ctrl-a then x to exit QEMU