Live data from Hacker News

Apple Virtualization Framework

developer.apple.com

81–90 of 127 posts

Re: Apple Virtualization Framework

#81
post #30

Please God let them use this to virtualize macOS inside iPadOS. Not as a daily driver but for the occasional use of a full desktop OS (when plugged into a keyboard/mouse). Then I could stop traveling with two devices once and for all.

If we can’t have native macOS on the iPad this would be the next best thing. Imagine having Linux or macOS on the iPad that is treated like any other app (sans memory limits and etc.). You could have a full blown desktop at the ready when iPadOS isn’t up to the task. The iPad could finally utilize the m1 processor to its fullest.

FWIW this is how it works on ChromeOS today. From the Linux terminal app (crostini lxc container) qemu launches macOS, Windows and Linux vms. They even support nested virtualization on my Framework Chromebook - so vms can run inside those vms.

I agree if Apple implemented virtualization on iPad/iPhone this same way it would be a huge for unlocking their full usefulness and capabilities while still maintaining host isolation/sandbox.

Re: Apple Virtualization Framework

#82
This is not news, right? And there was not any significant updates recently? So it is upvoted just because, right?

This is not a rhetorical question, I am trying to understand if I missed something important.

Re: Apple Virtualization Framework

#83
post #6

Has there been a significant development? Been using it with https://mac.getutm.app/ for a while

I've also been using the Apple Virtualization option with Linux VMs in UTM and have had zero issues whatsoever. The biggest benefit to doing so in my opinion isn't necessarily the noticeably better performance, but the RAM usage. I've noticed that Linux VMs in UTM that run using the Apple Virtualization Framework use significantly less RAM compared to otherwise because the framework provides dynamic memory allocation…

Somehow I cannot get a Fedora 38 (or for that matter, Rocky/Alma 9) installer to boot with this option, it all works fine on QEMU, though.

There could be knobs to twist but UTM doesn’t expose any, so…

Re: Apple Virtualization Framework

#84
post #57

Earlier quoted context omitted.

Mach was designed to run multiple OS interfaces in the same way that Windows NT was - multiple compatibility layers on top of a common kernel (e.g. WSL1). What is being discussed here is virtualization, for which Mach is no more suited than Linux, Windows, Sys V Unix etc.

Mach was designed to make clean separation between operating systems and hardware. Notice how easily Apple moves between hardware? The unsung hero is Mach and the design patterns that NeXT/Apple framework built on top of it.

I'm certainly not an xnu specialist but from what I understand, you've basically got a BSD kernel (a "macrokernel") running in privileged mode that (roughly) just has a few services replaced by or connected to Mach ones. So I'm not really sure they get much portability benefit specifically from Mach versus "more traditional" kernels.

Re: Apple Virtualization Framework

#85
post #39

I tried a bunch of different options and landed on multipass. I'm curious whether someone has found a good option for running x86 images on m1 chips. I'm generally happy with the multipass VMs I'm creating but they are arm architecture so then if i use docker images inside them I'm limited to arm images. Maybe I just haven't explored how to run x86 correctly within multipass? I'm finding that usually arm images are a…

Translating x86 -> arm or vice-versa is always going to be slow. No amount of software will ever overcome that. If you are using arm you really need to embrace it. Running x86 on arm is only a hack - whether it's apple or some random github - it will only ever be a hack. It is one thing to dev on arm and deploy to x86 but expecting x86 to perform remotely close to the same exp on arm isn't something that's going to happen.

Having said that..

If you really want to run x86 images on arm, and while we're definitely not 1:1 with docker (and don't want to be) we're interested in people's experiences with https://ops.city as there is native hardware accelerated arm support and x86 on arm. (I'm with the company behind it.) It's definitely going to be more performant than a docker image since docker/k8s not only rely on a full blown linux but also abuse iptables, et al. It also has support for bridging (outside of the vm) and 9pfs so that would help alleviate your pain.

Re: Apple Virtualization Framework

#87
post #29

Earlier quoted context omitted.

UTM also have their own docs on it: https://docs.getutm.app/advanced/rosetta/ And FYI, this is also available in Docker Desktop for macOS, which allows better performance when running x86_64 containers compared to the older solution where Docker was using qemu.

Do you have any sources for that? I basically gave up on Docker for M1 since the qemu performance is terrible. Last time I checked, Rosetta only worked for one-off binaries, wouldn’t really allow docker to run more x86 code inside.

I'm not sure what you're asking here?

Rosetta is a tool for running x86-64 binaries on an arm64 OS.

I think you're asking if rosetta lets you run an x86 kernel, to which the answer is no - the whole point of this framework is to support virtualization, e.g. the OS is running directly on the hardware. The moment the OS can't do that, there is no point in doing anything other than emulation.

Re: Apple Virtualization Framework

#88
It's kind of wild that Apple provides code samples you can use to directly create your own VMs. Has ended up being the most straightforward way to run virtualized macOS on a macOS host that I've found, and comes with the nice benefit that your can read the code yourself and fiddle with the knobs.

https://developer.apple.com/documentation/virtualization/run...

Re: Apple Virtualization Framework

#89
post #57

Earlier quoted context omitted.

Mach was designed to run multiple OS interfaces in the same way that Windows NT was - multiple compatibility layers on top of a common kernel (e.g. WSL1). What is being discussed here is virtualization, for which Mach is no more suited than Linux, Windows, Sys V Unix etc.

Mach was designed to make clean separation between operating systems and hardware. Notice how easily Apple moves between hardware? The unsung hero is Mach and the design patterns that NeXT/Apple framework built on top of it.

Every modern operating system was designed to easily move hardware. (It also helps a lot that all hardware is basically the same thing.)

Re: Apple Virtualization Framework

#90

Earlier quoted context omitted.

It used to come on DVD's, now you can create one from within mac os

Yeaahhh ... the secure enclave seems to have pooched the idea of a USB stick booter. Restore Mode works fine. I used to use CCC (Carbon Copy Cloner) to make a mirror, but it doesn't like to boot from the mirror (it does, but I can't use any of the secure stuff). Also CCC destabilizes my system. If I have it running all the time, I crash -a lot-. Since I yanked it, I haven't had a hard system crash in months. These da…

Yeaahhh ... the secure enclave seems to have pooched the idea of a USB stick booter. Restore Mode works fine.

Maybe I misunderstood you, but you can make a bootable USB stick from the installer app:

https://support.apple.com/en-us/HT201372

Post reply on HN