top | item 23922846

macOS 11 Virtualization Framework to Run Linux in a VM

172 points| _venkatasg | 5 years ago |developer.apple.com | reply

181 comments

order
[+] saagarjha|5 years ago|reply
Notably, Apple still has not released an Apple silicon chip that can do virtualization. So as far as I can tell, this framework is currently not testable on their systems using the A12Z.
[+] bonyt|5 years ago|reply
What were they doing with the A12Z when they demoed Linux running in a VM at WWDC, then?
[+] musicale|5 years ago|reply
> Notably, Apple still has not released an Apple silicon chip that can do virtualization

Even if Apple's ARM chips are not classically virtualizable (and I don't know whether that is the case), that was indeed the case for the x86 (pre VT-x) when two fairly straightforward solutions were applied: binary translation of non-virtualizable instructions (VMware approach) and paravirtualization (Xen approach.) This sparked the x86 virtualization revolution even before hardware support was available from intel and AMD.

Other approaches that could potentially work on a "non-virtualizable" ARM CPU include user-mode Linux, emulation, microkernels (similar to paravirtualization - recall Xnu contains mach and presumably still has the ability to outsource system calls and paging) and containers.

[+] api|5 years ago|reply
AFAIK this is an ARM IP module they can just add.
[+] vlod|5 years ago|reply
Rather than use Intel CPUs in laptops with an ARM touchbar, maybe they'll use ARM CPUs with Intel in the touchbar.

Then virtualization will just occur in the touchbar using emojis as feedback. ;)

[+] innagadadavida|5 years ago|reply
Is virtualization that hard to do on ARMs? With chip talent Apple has, I’d be surprised if they don’t pull this off at least as well as Intel.
[+] stock_toaster|5 years ago|reply
Looks like this is just the "Virtualization Extensions" (apple silicon support) for the hypervisor framework (which has been around since 10.10 and is used by xhyve, and I believe the macos docker port?): https://developer.apple.com/documentation/hypervisor

Is that correct?

[+] saagarjha|5 years ago|reply
No, this looks separate. You'll notice the APIs have to do with virtualized networks and filesystems, rather than lower-level hypervisor tasks (creating and running virtual machines, servicing exits, etc.)
[+] ytch|5 years ago|reply
Maybe we can view it as a high-level API of hypervisor framework?
[+] ArgyleSound|5 years ago|reply
High level ObjC APIs vs lower level C APIs
[+] pjmlp|5 years ago|reply
Ironically the "Year of Desktop Linux" seems to be running GNU/Linux inside VMs on macOS, Windows and even ChromeOS.
[+] raghava|5 years ago|reply
Year of "virtualized Linux on Desktops!" - growing strong since 2010, powered by Docker, k8s and Cloud.
[+] naetius|5 years ago|reply
The real question here is how documented/open the boot loader is gonna be and if (how) it'll be possible to just boot whatever ARM64 code instead of going down the hypervisor way.
[+] sys_64738|5 years ago|reply
Isn’t this just the HV FW that exists already? Would you really expect the API to change between x86 and Apple ARM chips?
[+] rafaelturk|5 years ago|reply
Well hopefully not, however given that x86 and ARM are different CPUs API will likely change
[+] antoncohen|5 years ago|reply
I'm assuming Big Sur on ARM will be virtualizing ARM, not emulating Intel, meaning a VM will need to run an ARM Linux distro.

In the short term I expect that to be problematic. First party packages in the distro's package manager will be fine, but I expect it might be hard to find some third-party software compiled for ARM Linux. And any Docker containers in the Linux VM will need to use multi-arch or ARM Docker images.

[+] LawnGnome|5 years ago|reply
I don't think it'll be all that bad: one advantage of Raspberry Pis having been out for several years is that there's already been some demand for ARM and ARM64 builds of software.

Closed source, commercial software might be a bit more of a crapshoot, of course, but this should provide a fair bit of impetus.

[+] hiphipjorge|5 years ago|reply
There might be nothing available on this page right now, but wow is this useful. I recently started doing some macOS dev and realized that this is a pretty big limitation when it comes to my normal CI workflows. I know there are some projects that dockerize macOS but they did not seem simple to work with.
[+] m463|5 years ago|reply
> wow is this useful.

I agree.

I liked that you could run docker on osx, but there was no support for something like FROM macosx:10.6

Maybe it will be possible? If apple put 1/1000th of the effort into virtualization/containers that they put into emojis...

[+] mgliwka|5 years ago|reply
Many hosted CI solutions (i.e. Travis, Github Actions) support OS X natively.
[+] beamatronic|5 years ago|reply
I don’t understand the headline. I already run Ubuntu, which is Linux, under Virtual Box, on Mac.
[+] nine_k|5 years ago|reply
I suppose the idea is to not need VirtualBox, like in WSL under Windows.
[+] saagarjha|5 years ago|reply
Apple’s CPUs have historically not been able to do this. Apple is adding APIs to make this possible.
[+] Alupis|5 years ago|reply
Is it possible yet to virtualize an OSX install without breaking the EULA?
[+] kbutler|5 years ago|reply
"(iii) to install, use and run up to two (2) additional copies or instances of the Apple Software within virtual operating system environments on each Mac Computer you own or control that is already running the Apple Software, for purposes of: (a) software development; (b) testing during software development; (c) using macOS Server; or (d) personal, non-commercial use."

https://www.apple.com/legal/sla/docs/macOSCatalina.pdf

[+] wmf|5 years ago|reply
Yes, the EULA allows running macOS on macOS. (I realize this isn't what you want.)
[+] josteink|5 years ago|reply
> Is it possible yet to virtualize an OSX install without breaking the EULA?

Has a single court of law yet made a ruling to set a precedent saying they are legally binding?

If no, I’ll just keep treating EULAs like what they are: a corporate wish list of unlawful restrictions they want to impose on their customers.

Why should anyone care about that?

[+] cV6WB|5 years ago|reply
“No overview available.”
[+] tonyedgecombe|5 years ago|reply
Documentation has been my biggest frustration with Apple development.
[+] skee0083|5 years ago|reply
Linux is just an app that runs in macOS and windows.
[+] skissane|5 years ago|reply
Ignoring the "just" (it is much more than just that), running one OS under another is scarcely a new thing.

In early 1977, Unix V6 was an app that run on Interdata OS/32 [1]. (Within a few months, it had gained the ability to run directly on the Interdata 7/32 hardware, without the need for the rather primitive OS/32 operating system to sit under it.)

AT&T's 1979-1980 port of Unix to IBM mainframes ran it on top of the TSS/370 operating system [2]. (TSS was IBM's original, and ultimately unsuccessful, attempt to deliver timesharing for S/360 mainframes – TSO under MVS, and VM/CMS, succeeded where TSS largely failed. But TSS hung on for a few more years, sustained by the handful of customers using it, and AT&T decided it was the best base for their mainframe Unix port, and IBM was wiling to support them in that.)

[1] http://bitsavers.informatik.uni-stuttgart.de/bits/Interdata/...

[2] https://www.bell-labs.com/usr/dmr/www/otherports/ibm.pdf

[+] saagarjha|5 years ago|reply
There's an app called iSH on TestFlight that gives you precisely that for iOS as well ;)
[+] beervirus|5 years ago|reply
> No overview available.

Cool, why is this even posted?

[+] saagarjha|5 years ago|reply
Because it shipped as part of the SDK in the Big Sur beta today.
[+] mrpippy|5 years ago|reply
The header file likely has comments that didn’t make it into these docs.
[+] olliej|5 years ago|reply
Right? It doesn’t look like any of it is documented?
[+] nikolay|5 years ago|reply
So, you create a problem... and then you create a solution. Windows 10 with Terminal, winget, WSL2 with soon X Window beats macOS as a development platform.
[+] baddox|5 years ago|reply
Well, no. What’s the problem they created?