3 ms·
[addendum: per u/pm215 Hypervisor.Framework does still apparently exist and supported on apple silicon apparently, I assume the absence of hardware docs just m
by olliej 3y ago
[addendum: per u/pm215 Hypervisor.Framework does still apparently exist and supported on apple silicon apparently, I assume the absence of hardware docs just makes it miserable. OTOH maybe the Asahi GPU drivers, etc can work in that model? I really haven't ever done anything substantially more than what the WWDC demos do so am not a deep fount of knowledge here :D, to avoid confusion with replies I have not edited or changed my original comment. I kind of wish that HN UX exposed edit histories for comments, or provided separate addendum/correction options]
Virtualization.Framework is how you have to do virtualization on apple silicon as it is the userspace API layer that interacts with the kernel. There is no API you can use.
Virtualization.Framework is pretty much everything you need out of the box for a generic "I have an isolated virtual machine" model, basically it's just missing a configuration UI and main()
There are a couple of WWDC sessions over the last few WWDCs on using the framework, configuring rosetta, and improvements in the 2023 OS update
https://developer.apple.com/videos/play/wwdc2022/10002 https://developer.apple.com/videos/play/wwdc2022/10002
https://developer.apple.com/videos/play/wwdc2023/10007 https://developer.apple.com/videos/play/wwdc2023/10007
[1] commercial VM products probably require more work to compete in the market, things like the transparent desktop, window hosting, etc
- Someone 3y agoApple also documents the Virtualization framework fairly well at https://developer.apple.com/documentation/virtualization https://developer.apple.com/documentation/virtualization, with links to various code samples. For example, https://developer.apple.com/documentation/virtualization/running_linux_in_a_virtual_machine https://developer.apple.com/documentation/virtualization/run...: “This sample configures a virtual machine for a Linux-based operating system. You run the sample from the command line, and you specify the locations of the Linux kernel to run and initial RAM disk to load as command-line parameters. The sample configures the boot loader that the virtual machine requires to run the guest operating system, and it configures a console device to handle standard input and output. It then starts the virtual machine and exits when the Linux kernel shuts down.”
- stuff4ben 3y agoInteresting! I really need a cheap way to spin up an Apple Silicon container to create binaries for an open source project on GitHub. I don't want to spend money on an Apple Silicon runner in GitHub and I also don't want to run the build directly on my M2 MacBook Pro along with my other development work.
- pm215 3y agoYou don't have to use Virtualization.Framework. Hypervisor.Framework is the lower level API -- https://developer.apple.com/documentation/hypervisor https://developer.apple.com/documentation/hypervisor ; QEMU uses that.