There are two supported methods of booting FreeBSD/arm64 under QEMU: using U-Boot, or using an UEFI firmware image. To use U-Boot, install u-boot-qemu-arm64 package, and then run:

    % qemu-system-aarch64 -m 4096M -cpu cortex-a57 -M virt  \
        -bios /usr/local/share/u-boot/u-boot-qemu-arm64/u-boot.bin \
        -serial telnet::4444,server -nographic \
        -drive if=none,file=VMDISK,id=hd0 \
        -device virtio-blk-device,drive=hd0 \
        -device virtio-net-device,netdev=net0 \
        -netdev user,id=net0

Be sure to replace "VMDISK" with the path to the virtual machine image.

Prepopulated images are available under https://download.freebsd.org/releases/VM-IMAGES/ or https://download.freebsd.org/snapshots/VM-IMAGES/

Qemu comes with a UEFI firmware image. To boot the VM image run:

    % qemu-system-aarch64 -m 4096M -cpu cortex-a57 -M virt  \
        -bios edk2-aarch64-code.fd -serial telnet::4444,server -nographic \
        -drive if=none,file=VMDISK,id=hd0 \
        -device virtio-blk-device,drive=hd0 \
        -device virtio-net-device,netdev=net0 \
        -netdev user,id=net0

Be sure to replace "VMDISK" with the path to the virtual machine image.

NOTE: if you are booting a 12.x image, use -device virtio-blk,drive=hd0 and -device virtio-net,netdev=net0 instead, e.g.:

    % qemu-system-aarch64 -m 4096M -cpu cortex-a57 -M virt  \
        -bios edk2-aarch64-code.fd -serial telnet::4444,server -nographic \
        -drive if=none,file=VMDISK,id=hd0 \
        -device virtio-blk,drive=hd0 \
        -device virtio-net,netdev=net0 \
        -netdev user,id=net0

To connect to the virtual console run telnet localhost 4444.

To boot on ThunderX under KVM:

    % qemu-system-aarch64 -m 4096M -cpu host,pmu=off -M virt,gic-version=3 \
        -bios QEMU_EFI.fd -serial telnet::4444,server -nographic \
        -drive if=none,file=VMDISK,id=hd0 \
        -device virtio-blk-device,drive=hd0 \
        --enable-kvm

To install FreeBSD on linux aarch64 using virt-install with UEFI:

virt-install \
        --name test-aarch64-1 \
        --ram 20480 \
        --vcpus 32 \
        --network network=default,model=virtio \
        --graphics none \
        --video virtio \
        --console pty,target.type=virtio \
        --serial pty \
        --rng /dev/random \
        --cdrom /tmp/FreeBSD-15.0-CURRENT-arm64-aarch64-20250306-27bf5c405bf2-275806-disc1.iso \
        --disk pool=default,size=40,format=qcow2,bus=virtio,discard=unmap,cache=none \
        --boot loader=/usr/share/AAVMF/AAVMF_CODE.no-secboot.fd,loader.readonly=yes,loader.type=pflash,loader_secure=no,nvram.template=/usr/share/AAVMF/AAVMF_VARS.fd \
        --osinfo freebsd14.0

To boot on Apple Silicon hardware (M1, M2) and macOS with HVF acceleration:

    % qemu-system-aarch64 -m 4096M -cpu host -M virt,accel=hvf \
        -bios edk2-aarch64-code.fd -serial telnet::4444,server -nographic \
        -drive if=virtio,file=VMDISK,id=hd0 \
        -device virtio-net,netdev=net0 -netdev user,id=net0


CategoryVirtualization

arm64/QEMU (last edited 2025-03-31T21:02:58+0000 by BradDavis)