Abstract
Architecture specific notes for OpenBSD guests under QEMU, with working command lines where installation succeeds and failure points where it does not.
These notes generalise the working cases from
obsd.sh, a sysupgrade(8)
influenced helper for headless OpenBSD VMs with serial console output.
With current QEMU on an amd64 host, emulated systems are fast enough for
ports work; riscv64 builds gcc-16.1.0 in 1 to 2 days, close to a real
sparc64 machine.
alpha
OpenBSD/alpha is blocked by incomplete SRM emulation. The port expects bootinfo, PTBR, PROM state, and SRM disk callbacks; QEMU’s clipper PALcode is not a complete SRM console.
amd64
OpenBSD/amd64 works with standard qemu-system-x86_64 emulation and
virtio networking:
qemu-system-x86_64 \
-nographic \
-m 32G \
-smp 8 \
-hda amd64.qcow2 \
-netdev user,id=net0 \
-device virtio-net-pci,netdev=net0qemu-system-x86_64 \
-nographic \
-m 32G \
-smp 8 \
-hda amd64.qcow2 \
-netdev user,id=net0 \
-device virtio-net-pci,netdev=net0Serial console selection remains manual:
stty com0 115200
set tty com0arm64
OpenBSD/arm64 works on the QEMU virt machine with U-Boot from the
OpenBSD u-boot-aarch64 port:
qemu-system-aarch64 \
-machine virt \
-cpu cortex-a57 \
-nographic \
-bios /usr/local/share/u-boot/qemu_arm64/u-boot.bin \
-m 32G \
-smp 8 \
-drive file=arm64.qcow2,format=qcow2,if=none,id=hd0 \
-device virtio-blk-pci,drive=hd0,bootindex=1 \
-netdev user,id=net0 \
-device virtio-net-device,netdev=net0qemu-system-aarch64 \
-machine virt \
-cpu cortex-a57 \
-nographic \
-bios /usr/local/share/u-boot/qemu_arm64/u-boot.bin \
-m 32G \
-smp 8 \
-drive file=arm64.qcow2,format=qcow2,if=none,id=hd0 \
-device virtio-blk-pci,drive=hd0,bootindex=1 \
-netdev user,id=net0 \
-device virtio-net-device,netdev=net0armv7
OpenBSD/armv7 works on the QEMU virt machine with cortex-a15, U-Boot
from the OpenBSD u-boot-arm port, 3G of RAM, and a uniprocessor
guest:
qemu-system-arm \
-machine virt,virtualization=on \
-cpu cortex-a15 \
-nographic \
-bios /usr/local/share/u-boot/qemu_arm/u-boot.bin \
-m 3G \
-smp 1 \
-drive file=armv7.qcow2,format=qcow2,if=none,id=hd0 \
-device virtio-blk-device,drive=hd0,bootindex=1 \
-netdev user,id=net0 \
-device virtio-net-device,netdev=net0qemu-system-arm \
-machine virt,virtualization=on \
-cpu cortex-a15 \
-nographic \
-bios /usr/local/share/u-boot/qemu_arm/u-boot.bin \
-m 3G \
-smp 1 \
-drive file=armv7.qcow2,format=qcow2,if=none,id=hd0 \
-device virtio-blk-device,drive=hd0,bootindex=1 \
-netdev user,id=net0 \
-device virtio-net-device,netdev=net0At 4G of RAM, devices hang; OpenBSD/armv7 does not support SMP.
Virtio networking needs an OpenBSD if_vio.c alignment fix1. USB
networking avoids that path, but the installer and installed system use
different interface names, cdce0 and urndis0; other NICs, including
em0 and e1000, also hung.
The target disk has an MSDOS boot partition visible as i:, so
autopartitioning must fit within 14 OpenBSD partitions.
hppa
OpenBSD/hppa exposes several partial boot paths, but no usable
installer. C3700 and A400 load bsd.rd, then stop around SPID
setup. B160L prints the OpenBSD copyright, then hangs before
cpu_startup(). lif79.img reaches BOOT and can open dk0a:/bsd, but
ramdisk loading fails with a bogus heap allocation size.
i386
OpenBSD/i386 follows the same path as OpenBSD/amd64: headless boot, virtio networking, and manual serial console selection2.
qemu-system-i386 \
-nographic \
-m 32G \
-smp 8 \
-hda i386.qcow2 \
-netdev user,id=net0 \
-device virtio-net-pci,netdev=net0qemu-system-i386 \
-nographic \
-m 32G \
-smp 8 \
-hda i386.qcow2 \
-netdev user,id=net0 \
-device virtio-net-pci,netdev=net0landisk
OpenBSD/landisk has no matching QEMU machine. The port expects
IO-DATA LANDISK; QEMU provides only r2d-plus.
loongson
OpenBSD/loongson has no tested QEMU path to a serial installer.
Fuloong 2E does not produce usable serial installer output.
loongson3-virt reaches UEFI with non-free bios_loongson3.bin from
Loongson Community’s firmware repository,
but OpenBSD media contain bsd.rd without an EFI loader, so firmware
boot stops at the UEFI shell.
luna88k
OpenBSD/luna88k has no matching QEMU m88k system emulator.
macppc
OpenBSD/macppc reaches the ramdisk under qemu-system-ppc, but not a
usable installer. The guest hangs after printing the bad clock warning.
octeon
OpenBSD/octeon has no usable QEMU system target. QEMU includes an Octeon CPU model, but not the corresponding machine, firmware, and device set.
powerpc64
OpenBSD/powerpc64 requires a firmware handoff; direct -kernel bsd.rd
does not provide it. PowerNV with manually extracted pnor.BOOTKERNEL
images from talos-ii-v2.10.pnor gets farther than direct kernel
loading and reaches OpenBSD’s early Hello, World!, then hangs while
QEMU consumes CPU. pseries is not a supported OpenBSD/powerpc64
platform.
riscv64
OpenBSD/riscv64 works with OpenSBI and U-Boot from the OpenBSD
u-boot-riscv64 port:
qemu-system-riscv64 \
-machine virt \
-nographic \
-bios /usr/local/share/opensbi/generic/fw_jump.bin \
-kernel /usr/local/share/u-boot/qemu-riscv64_smode/u-boot.bin \
-m 32G \
-smp 8 \
-hda riscv64.qcow2 \
-netdev user,id=net0 \
-device virtio-net-device,netdev=net0qemu-system-riscv64 \
-machine virt \
-nographic \
-bios /usr/local/share/opensbi/generic/fw_jump.bin \
-kernel /usr/local/share/u-boot/qemu-riscv64_smode/u-boot.bin \
-m 32G \
-smp 8 \
-hda riscv64.qcow2 \
-netdev user,id=net0 \
-device virtio-net-device,netdev=net0sparc64
OpenBSD/sparc64 works on the QEMU sun4u machine:
qemu-system-sparc64 \
-machine sun4u \
-nographic \
-m 4G \
-smp 1 \
-hda sparc64.qcow2 \
-net nic,model=sunhme \
-net userqemu-system-sparc64 \
-machine sun4u \
-nographic \
-m 4G \
-smp 1 \
-hda sparc64.qcow2 \
-net nic,model=sunhme \
-net userQEMU supports only one CPU for the sun4u machine; higher memory also
hits OpenBIOS allocation failures:
out of malloc memory (28)!
Unhandled Exception 0x0000000000000030
TFTP through OpenBIOS did not work either:
Trying net...
No valid state has been set by load or init-programThe required OpenBSD
if_vio.cpatch was posted toopenbsd-bugsand is available at https://marc.info/?l=openbsd-bugs&m=178087375207004&w=2. ↩︎QEMU 11.0.1 and probably 11.0.0 has a separate i386 issue: https://gitlab.com/qemu-project/qemu/-/work_items/3537. ↩︎