3 ms·
Yes, I already run the native build of macOS in a bespoke hypervisor for experimentation purposes (most of the hardware is passed through), and macOS already ha
by marcan_42 5y ago
Yes, I already run the native build of macOS in a bespoke hypervisor for experimentation purposes (most of the hardware is passed through), and macOS already has a VM-specific ARM kernel that in principle doesn't even require any proprietary CPU features and would run on any ARM machine (the native one wouldn't, it needs custom Apple instructions). I'm pretty sure someone already tried the macOS vmkernel on QEMU/KVM on another ARM box and it boots to a shell. I think it even has virtio support and there's a QEMU Guest Agent built into macOS these days (yes, really).
There's just one catch. The desktop environment requires GPU acceleration to even start, and your two options are emulating the proprietary Apple GPU, or emulating the paravirtualized Metal GPU they developed for VMs. Neither is likely to be particularly easy... it's why I tell people to not expect to be able to run a macOS VM on Linux on an M1 Mac, unless they want to write a whole Metal implementation. A plain kernel in single user mode? Sure. macOS desktop? Good luck :-).
For macOS on macOS on Apple hardware, Apple have their paravirt GPU support on both sides so it basically "just works" with minimal work from the third-party hypervisors that build on those frameworks.
- exikyut 5y agoCould you pass the GPU (and all attendant hardware) transparently through Linux into a macOS VM, a bit like PCI passthrough (IIRC) is used for Windows VMs? ....hmm, now I think about that I realize it wouldn't have many non-tinkering oriented use cases. Right now I can only think of out-of-band firewalling.
- marcan_42 5y agoIt's... complicated. And yeah, at that point, it wouldn't have many use cases. The hypervisor I wrote for research purposes passes through all the hardware (except the UART), which is easier than trying to do it on top of Linux. But it also doesn't try to be a secure hypervisor or anything like that (it would be trivial for the guest to take over).
- toyg 5y ago> The desktop environment requires GPU acceleration to even start, and your two options are emulating the proprietary Apple GPU, or emulating the paravirtualized Metal GPU they developed for VMs. That basically enforces in hardware what has always been the commercial position of OSX: open kernel, closed (and ruthlessly guarded) desktop libraries.