Live data from Hacker News

Apple Virtualization Framework

developer.apple.com

61–70 of 127 posts

Re: Apple Virtualization Framework

#61
post #57

Earlier quoted context omitted.

I think this is being done because the Mach microkernel was designed to run multiple OS's at the same time. I think Apple finally has enough developers to start pushing into new areas such as a framework to advantage Mach.

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.

Re: Apple Virtualization Framework

#62
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…

> The only thing I'd like to see added to the framework is the ability for nested virtualization (which is now available in the M2 chips, but isn't built into M1 chips).

Is there an example of this working in any context? Until then I don't see how it can be considered available.

EDIT - Confirmed below it does work in Linux on metal - Props to the Asahi team!

Re: Apple Virtualization Framework

#64
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.

It’s easy from the user’s point of view. It’s not easy to write Rosetta.

Re: Apple Virtualization Framework

#66
Been using vftool to host docker instead of Docker.app. It's been alright so far, got rosetta set up inside to run x86 images. All it takes is a little startup script and some up front work to prepare a disk image with Ubuntu server.

Every once in a while, the guest Ubuntu kernel will oops about smp related things. Every time it boots its clock is reset almost a month in the past and I have to force sntp to correct it. After sleeping the host, the guest clock will not advance so it'll be behind several hours.

I'm not sure where to assign these issues: Ubuntu kernel? virtualization framework? vftool? bad configuration?

Re: Apple Virtualization Framework

#67
post #62

Earlier quoted context omitted.

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…

> The only thing I'd like to see added to the framework is the ability for nested virtualization (which is now available in the M2 chips, but isn't built into M1 chips). Is there an example of this working in any context? Until then I don't see how it can be considered available. EDIT - Confirmed below it does work in Linux on metal - Props to the Asahi team!

Yep, works in M2 in asahi linux, but I'm not sure Apple has it enabled in their framework.

Re: Apple Virtualization Framework

#68
post #63

Haven't apple been spending a lot of money on lawyers trying to stop people virtualising OSX?

on non Apple hardware

Right. I believe the idea is to virtualize macOS inside macOS. I think some developers use that to test on older OS releases.

Re: Apple Virtualization Framework

#69
post #62

Earlier quoted context omitted.

> The only thing I'd like to see added to the framework is the ability for nested virtualization (which is now available in the M2 chips, but isn't built into M1 chips). Is there an example of this working in any context? Until then I don't see how it can be considered available. EDIT - Confirmed below it does work in Linux on metal - Props to the Asahi team!

Yep, works in M2 in asahi linux, but I'm not sure Apple has it enabled in their framework.

Thanks for the confirmation, pretty awesome the Asahi team is delivering features before Apple can on their own hardware!

Re: Apple Virtualization Framework

#70
post #58
post #53

Earlier quoted context omitted.

I understand that you can use it with https://developer.apple.com/documentation/virtualization/run... ? What is the difference or improvement about using UTM (macOS newbie here :-) ) In the UTM page it says "Under the hood of UTM is QEMU, a decades old..." so are we talking about the same thing as Apple Virtualization Framework. I am confused qbout the QEMU mention.

There are two frameworks, Hypervisor.framework which is a low level abstraction of the processor's virtuazionation functionality, and Virtualization.framework which is basically a QEMU implementation.

I am confused by the different comments here: does UTM only uses QEMU or it also uses AVF if the chip architecture of the host and guest is the same?

Edit: I think the catch is that QEMU uses AVF if available [1].

[1] https://medium.com/code-uncomplicated/virtual-machines-on-ma...

Post reply on HN