Last Week on My Mac: How virtualization is important to the future of macOS

The more I look at the changes Apple has introduced to bring lightweight virtualization to macOS, the more suspicious I become. Virtualizing a guest operating system on Macs has always been important to some, but hardly a cornerstone of macOS. We’ve had fine commercial products such as VMware and Parallels, and outstanding alternatives like UTM. So why should Apple have invested so much in its Virtualization framework on Apple silicon Macs?

What may at first seem just another API has taken Apple some years to implement, as lightweight virtualization goes much deeper than might appear. As a form of what’s often known as para-virtualization, its easily accessible devices have required implementation of the Virtio open standard, and in the case of the accelerated display device available to macOS guests, giving access to the GPU and Metal.

There are signs that this goes back well before WWDC 2020 and the release of Apple’s Developer Transition Kit. When Craig Federighi announced the details of Apple silicon in June 2020, he identified three pillars supporting a diversity of apps on Apple Silicon: Universal apps, Rosetta 2 and Virtualization. The latter was promoted for hosting Linux and Docker, and Andreas Wendker demonstrated a pre-release version of Parallels Desktop running Linux as a guest. Conspicuous by their absence at that time were the two most popular and important guest operating systems, Windows and macOS.

Big Sur brought the essential foundation for lightweight virtualization in its Hypervisor framework, which had already been working on Intel Macs with hardware support in the VT-x feature set including Extended Page Tables (EPT) and Unrestricted Mode. Hardware support is also required on Apple silicon, this time described by Apple as “the Virtualization Extensions”, presumably referring to AArch64 virtualization as documented by arm.

It wasn’t until Monterey, though, that Apple was able to offer lightweight virtualization on top of its Hypervisor, presumably because of the engineering work required to implement those virtio and other devices, and some of those are only now being completed in Ventura. Benjamin Poulain’s account at WWDC 2022 included an impressive demonstration of how simple it is to implement in code, and left us with the invitation to experiment, saying on behalf of the virtualization team “we cannot wait to see what you will do next with this technology”.

Does Apple really invest several years of engineering effort involving both hardware and software development just to see what third-party developers might do with it?

Let’s look forward to a macOS of the future, maybe around version 16 or later. Many older apps that have coped with Monterey, particularly those that haven’t been ported to Universal binaries, no longer run in the current release. Continuing support for Rosetta 2 in new versions of macOS is getting harder to justify, and Apple’s management has itchy feet for phasing out Intel support.

How then do those users still dependent on older Intel-only apps look to the future? They don’t want to have to pay for a full virtualization environment like today’s products from VMware or Parallels, but being able to run their apps in Monterey using free or far cheaper lightweight virtualization is a more attractive proposition.

These lightweight virtualizers also run entirely within a sandbox, without any system extensions, but with Rosetta 2 support when needed. The security consequences of running an old, vulnerable version of macOS are well mitigated by virtualization which doesn’t give access to iCloud, for instance. Thus lightweight virtualization makes it easier, safer and cheaper for ordinary users to run old versions of macOS, which in turn gives Apple greater scope to accelerate macOS into the future without having to care so much about supporting the past.

There’s also scope for those software developers who feel unable to invest in updating an app to run native in a future macOS on Apple silicon hardware to bundle it into a lightweight virtual machine, a container similar to Docker, perhaps, yet still deliver similar performance and features.

Universal apps have had great impact on Apple silicon Macs since day one. Rosetta 2 has been decisive in the success of Apple’s big gamble. The time has come to see what that third pillar can do with virtualization.