Eric Radman : a Journal

OpenBSD on QEMU-aarch64

OpenBSD Apple ARM64 systems

Startup Script

qemu-system-aarch64 \
    -M virt \
    -accel hvf \
    -m 2048 \
    -cpu cortex-a57 -M virt,highmem=off \
    -drive file=/opt/homebrew/Cellar/qemu/8.2.1/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on \
    -drive file=install74.img,format=raw \
    -drive file=openbsd.qcow2,format=qcow2 \
    -nic vmnet-bridged,ifname=en0 \
    -nographic \
    -serial tcp::4444,server,telnet,wait

Networking

Supported options are shown by -help

% qemu-system-aarch64 -help | grep vmnet
-netdev vmnet-host,id=str[,isolated=on|off][,net-uuid=uuid]
                configure a vmnet network backend in host mode with ID 'str',
                vmnet-host interfaces within this isolated network
-netdev vmnet-shared,id=str[,isolated=on|off][,nat66-prefix=addr]
                configure a vmnet network backend in shared mode with ID 'str',
-netdev vmnet-bridged,id=str,ifname=name[,isolated=on|off]
                configure a vmnet network backend in bridged mode with ID 'str',
-nic [tap|bridge|user|vde|vhost-user|vmnet-host|vmnet-shared|vmnet-bridged|socket][,option][,...][mac=macaddr]
-net [user|tap|bridge|vde|vmnet-host|vmnet-shared|vmnet-bridged|socket][,option][,option][,...]

vmnet-shared will provide an address on a private subnet. vmnet-bridge allows a virtual machine to get an address on the local area network, but must be run as root.

ifconfig on my M1 Mac

bridge100: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=3<RXCSUM,TXCSUM>
    ether 4e:20:b8:1e:da:64
    Configuration:
        id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
        maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
        root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
        ipfilter disabled flags 0x0
    member: en0 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 6 priority 0 path cost 0
    member: vmenet0 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 21 priority 0 path cost 0
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active