7 ms·
Run FreeBSD 13.1 for ARM64 in QEMU on Apple Silicon Mac with HVF Acceleration
- sneak 4y agoFunnily enough, this tutorial uses the linux-style dd numeric syntax (lowercase M) which fails on macOS (I think it inherited dd from freebsd a looong time ago) and needs bs=1M (not bs=1m).
- codetrotter 4y agoAll of the commands given in the guide are provided exactly as they should be run, and you can copy paste all of them directly into your terminal on macOS without any changes. That includes all of the dd commands. These run as they should on macOS with the syntax given in the guide. Assuming you are using the same version of macOS as me; macOS Monterey Version 12.5
- irusensei 4y agoThat's true for most versions but I just tested on Monterey and bs=nM now works. Since this is a M1 specific we just need to check if Big Sur behaves the same.
- wyldfire 4y agoIs HVF Apple-specific? Is it related to ARMv8.3/8.4 Nested Virtualization? Does Graviton 3 or some other commercial offering have this support too?
- AceJohnny2 4y agoYes. HVF is the QEMU driver for Apple/macOS Hypervisor.Framework
- AreYouSirius 4y ago
- jjtheblunt 4y agoWhat does this offer that BSD-mutant MacOS native on Apple Silicon lacks?
- heavyset_go 4y agoThe actual FreeBSD and *BSD parts of macOS are ancient.
- irusensei 4y agoIt can't be that old considering they even have pf.
- heavyset_go 4y agoI'm looking at it from the perspective of XNU. Most of FreeBSD's interesting and modern features are not in its userland, but in its kernel and/or exposed to the userland from there. The BSD parts of XNU are literally decades old, and were lifted before jails were a thing.
- musicale 4y agojail(2) and jail_attach(2) pls. Also looks like macOS still supports union mounts and chroot.
- bydo 4y agoThe stuff with licenses Apple likes is relatively up to date; it's definitely not bleeding edge, but no worse than you'd get from Debian or RHEL. The criticism macOS gets for shipping ancient software is because one of the licenses they don't like is the GPL3. So there's a GPL2 version of bash from 2007, rsync is from 2006, etc. The end user can, of course, install newer versions of these separately.
- heavyset_go 4y agoThe FreeBSD and *BSD parts of XNU are ancient, which is what I'm referring to, as is some of the userland.
- sitkack 4y agoThis is super cool, but I see folks having problems with networking. Maybe I'll try in a month.
- codetrotter 4y agoMost of the comments are from past versions of the document. I debated removing them but the issue with ping acting weird remains so I decided to leave the comments for now. But networking in general appears to work, aside from the ping strangeness. For example, using pkg to install packages works fine. Likewise, portsnap fetch extract, and when you build packages from ports the system is able to fetch over the network without apparent issues. Edit: I cleaned up the comments on the gist a little, leaving the ones that are still relevant (the ones about ping), while removing some comments that were talking about problems that are out of date.
- sitkack 4y agoCool. I'll give it a try then. I didn't even know you could remove comments on a gist. TIL.
- bpye 4y agoIt looks like the vmnet patches made it into QEMU - maybe try setting the network device to use that: -netdev vmnet-macos,id=net,mode=bridged -device virtio-net-pci,netdev=net Note: You'll need to run QEMU as root to use vmnet, non-root usage requires an entitlement.
- brettdong 4y agoQEMU needed to be patched for network to work on M1 Mac hosts back then. I don’t know if the patches landed in newer versions of QEMU.
- IronWolve 4y agoWhen I saw qemu/utm on m1 mac, I was wondering how hard it would be to run the same utm arm images on windows with qemu, surprisingly, not bad. Hardest part was the missing documentation to get everything working, as UTM is pretty automated on osx.
- pram 4y agoYou can also use UTM which is a GUI for qemu with HVF turned on already. Pretty useful, I've run everything from Windows 11 to Snow Leopard in it. https://mac.getutm.app https://mac.getutm.app