Running Raspberry Pi OS inside QEMU is a convenient way to test configurations or perform lightweight development without real hardware. However, the process can appear stalled during boot, especially when emulating ARM on x86_64. Here’s a step-by-step guide based on what worked for me when running Raspberry Pi OS under QEMU on an Ubuntu 24 system inside Hyper-V.

Step 1: Install QEMU on Ubuntu#

First, install QEMU and ARM support packages:

sudo apt update
sudo apt install qemu-system-arm qemu-efi qemu-utils -y

These packages enable running ARM-based images such as Raspberry Pi OS on an x64 host system.

Step 2: Download Raspberry Pi OS Image#

Download and decompress the official 64-bit Raspberry Pi OS image:

wget https://downloads.raspberrypi.com/raspios_arm64/images/raspios_arm64-2023-02-22/2023-02-21-raspios-bullseye-arm64.img.xz
unxz 2023-02-21-raspios-bullseye-arm64.img.xz
qemu-img resize 2023-02-21-raspios-bullseye-arm64.img 8G

Step 3: Mount the Image to Access Boot Files#

Set up a loop device and mount its first partition to retrieve the kernel and device tree files:

sudo losetup -Pf 2023-02-21-raspios-bullseye-arm64.img
mkdir boot
sudo mount /dev/loop22p1 boot/

(Adjust /dev/loop22p1 if QEMU assigns a different loop index. use losetup -l)

Step 4: Run the Image in QEMU#

Start the emulation using the Raspberry Pi 3B machine profile:

qemu-system-aarch64 -nographic -M raspi3b -m 1024 -cpu cortex-a53 \
-kernel boot/kernel8.img \
-dtb boot/bcm2710-rpi-3-b.dtb \
-drive file=2023-02-21-raspios-bullseye-arm64.img,format=raw \
-append "console=ttyAMA0,115200 root=/dev/mmcblk0p2 rw rootwait"

The system runs in nographic mode, meaning all output is redirected to your terminal.

Step 5: Be Patient During Boot#

After starting QEMU, the screen may remain blank for the first half a minute or more. On my setup, nothing appeared for around 40 seconds before the boot log started scrolling. This delay can be confusing, but it’s completely normal for ARM emulation.

Step 6: Exit QEMU Cleanly#

To stop the emulation, press the following key combination:

Ctrl + A, then X

QEMU will terminate cleanly and return you to the host shell.