Armv7 Virtualization
The Setup: required packages
% sudo pkg install qemu
As of this wrirting, I used qemu 8.1.3, though I've done this with older versions. I suspect that 8.2 will be fine, but I haven't tried it yet.
The Setup: EDK2 prep
% mkdir qemu-armv7% cd qemu-armv7% dd if=/dev/zero of=pflash0.img bs=1m count=64% dd if=/dev/zero of=pflash1.img bs=1m count=64% dd if=/usr/local/share/qemu/edk2-arm-code.fd of=pflash0.img conv=notrunc% dd if=/usr/local/share/qemu/edk2-arm-vars.fd of=pflash1.img conv=notrunc
This will create the needed flash images. pflash0.img can be shared among all the VMs you want, but you should have a specific pflash1.img per VM (though if you don't set any specific UEFI environment variables, it could be shared since you won't have multiple writers). There's no easy way to manage the per-VM vars file if you need to have different and do this on a large scale.
The Setup: A quick QEMU script
#!/bin/shqemu-system-arm \-M virt \-m 512 \-drive file=pflash0.img,format=raw,if=pflash,readonly=on \-drive file=pflash1.img,format=raw,if=pflash \-drive file=$1.img,if=virtio,cache=writethrough \-nographic
Will run whatever image you want to download. I run the GENERICSD.img that we publish. FreeBSD-13.2-RELEASE-arm-arm7-GENERICSD.img for example. You'll need to specify the image name. The virutal machine for arm, at least, will include the virtio network device (vtnet) if no other network is specified. Handy for scripts, but not always a good thing...
The bug: vtnet
-device rtl8139,netdev=network0 -netdev user,id=network0 \
No comments:
Post a Comment