Live data from Hacker News

Apple Virtualization Framework

developer.apple.com

71–80 of 127 posts

Re: Apple Virtualization Framework

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

Re: Apple Virtualization Framework

#72
post #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 i…

Does vftool use https://developer.apple.com/documentation/virtualization or https://developer.apple.com/documentation/hypervisor ?

https://github.com/evansm7/vftool appears to indicate the former, but I thought the latter was required for rosetta so interested to try this.

EDIT - looks like I had this backwards, vftool indeed supports https://developer.apple.com/documentation/virtualization which is the newer framework that supports Rosetta. The older framework is https://developer.apple.com/documentation/hypervisor

Re: Apple Virtualization Framework

#73
post #38

Where can we obtain a "macOS restore image" ? I imagine they are not as easy to come by as an Ubuntu ISO.

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 days, I just make sure the Time Machine backups keep going, and I'll use CCC on a one-shot basis to make occasional disk clones (makes for a much faster restore).

Re: Apple Virtualization Framework

#74
post #70
post #58

Earlier quoted context omitted.

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

Yes UTM uses HVF via QEMU, some comments above say it can also use Virtualization.framework.

Re: Apple Virtualization Framework

#77
post #18

Earlier quoted context omitted.

Perhaps I am reading what you wrote wrong but are you saying it can use Rosetta within an ARM Linux VM to run x86 applications in the VM?

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

On the run so apologies for not reading the docs you attached yet but I’ve been having a helluva time trying to cross-compile rust from an M1 for x86_64. Will this method help in this situation? I’ve tried running an x86_64 vm in emulation to compile rust bits it excruciatingly slow.

Re: Apple Virtualization Framework

#78
post #38

Where can we obtain a "macOS restore image" ? I imagine they are not as easy to come by as an Ubuntu ISO.

You download them from Apple. https://mesu.apple.com/assets/macos/com_apple_macOSIPSW/com_... is the canonical updater data source. https://mrmacintosh.com/apple-silicon-m1-full-macos-restore-... is that in HTML form, and there's various tools like https://github.com/munki/macadmin-scripts/blob/main/getmacos... for automating it.

Re: Apple Virtualization Framework

#79
post #24

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.

"Being done", I'm not sure anything is happening here other than a happy user pointing out that Apple have some advances in this area, but .. your point is that this has been there all along. Alas, if only there were the hardware at scale which supported Apples' Mach implementation, at favourable economies. One way this is favourable to this dev is if Apple finally give me a machine which I can use to Build All the T…

I build windows and Linux and iOS and macOS all on my MacBook Pro.

Re: Apple Virtualization Framework

#80
post #7
post #3

Earlier quoted context omitted.

Just a question: would anyone be interested in a good blog post explaining my journey with OSDEV and Virtualization.framework ?

Don't ask, do. This is a fascinating subject. I'd be quite happy to see how a fat MacOS machine is being used as a build-server for multiple generations of MacOS versions, as well as how it could be used (via Linux VM's) to also build for Android, Linux, Windows, etc. Essentially, this subject is all about the build server destination; there is an award for how many different targets you can get from the same code-ba…

Would be great to run GitHub actions locally that use whichever VM is required.
Post reply on HN