Apple Virtualization framework

On this page 7

The Apple Virtualization framework is a high-level macOS programming interface that lets applications create and run virtual machines with a few hundred lines of Swift or Objective-C code. Introduced in macOS Big Sur and greatly expanded on Apple silicon, it builds on the lower-level Hypervisor framework and supplies ready-made virtual devices for storage, networking, graphics, audio and input, so developers do not have to write their own device emulation.

Within Apple silicon & compatibility, the framework is the official path for running Linux and macOS guests on M-series Macs. It powers tools such as UTM in its Apple mode, several container runtimes and the virtualization layer of commercial products, and it is the reason a modern Mac can boot an ARM64 Linux distribution in seconds without third-party kernel extensions.

How the Virtualization framework runs a guest

The framework sits on top of the hardware virtualization extensions of the CPU. On Apple silicon, the processor provides an exception level reserved for a hypervisor, and macOS exposes it through the Hypervisor framework. The Virtualization framework wraps this capability in objects that describe a complete machine and its devices.

A developer builds a VZVirtualMachineConfiguration, chooses a boot loader, assigns CPU cores and memory, attaches devices and then starts a VZVirtualMachine. Guest code executes directly on the physical cores, so CPU-bound work runs at near-native speed, while device access goes through paravirtualized VirtIO devices that avoid the cost of emulating real hardware.

The table lists the main building blocks a configuration combines.

ComponentFramework classPurpose
Linux boot loaderVZLinuxBootLoaderBoots a kernel and initial RAM disk directly
EFI boot loaderVZEFIBootLoaderBoots standard ARM64 distribution images
macOS platformVZMacPlatformConfigurationDefines hardware model and machine identifier
Block storageVZVirtioBlockDeviceConfigurationAttaches disk images to the guest
Network deviceVZVirtioNetworkDeviceConfigurationProvides NAT or bridged networking
Shared directoryVZVirtioFileSystemDeviceConfigurationShares host folders through virtio-fs
Graphics deviceVZMacGraphicsDeviceConfigurationOffers accelerated display for macOS guests
Core components of a virtual machine configuration

Supported guests and platform requirements

The framework supports two guest families: Linux on any supported Mac and macOS on Apple silicon. Windows is not an officially supported guest, although ARM64 Windows can be started through EFI by some tools without official drivers or support. Intel guests cannot run natively, because the framework virtualizes the host architecture rather than emulating another CPU.

Capabilities have grown with each release of macOS, and the available features depend on both the host version and the guest type. The table summarizes the most relevant milestones.

macOS versionKey additionPractical effect
macOS Big SurFirst release of the frameworkLinux guests with basic VirtIO devices
macOS MontereymacOS guests on Apple siliconVirtual Macs for testing and CI
macOS VenturaEFI boot, virtio-fs, Rosetta for LinuxStandard distributions and x86-64 Linux binaries
macOS SonomaSave and restore of machine stateSuspending and resuming virtual machines
macOS SequoiaApple Account sign-in in macOS guestsBroader use of iCloud-dependent software
Feature availability by macOS version

Apple’s license for macOS allows up to two additional macOS virtual instances per Mac for purposes such as development and testing, which limits large-scale macOS hosting on a single machine.

How it compares with other virtualization options

The Virtualization framework is one of several layers and products for running other systems on a Mac. Choosing between them depends on whether the goal is a quick Linux environment, a full Windows desktop or a custom hypervisor.

OptionLevelBest suited for
Virtualization frameworkHigh-level system APILinux and macOS guests with minimal code
Hypervisor frameworkLow-level CPU and memory APICustom hypervisors with own device models
Parallels DesktopCommercial applicationWindows on ARM with integration features
UTMOpen-source applicationApple mode for speed, QEMU mode for emulation
Boot CampNative dual bootWindows on Intel-based Macs only
Virtualization framework compared with related options

The key trade-off is simplicity versus control. The Virtualization framework handles devices, memory ballooning and graphics for the developer, but it offers only the devices Apple provides, whereas the Hypervisor framework allows any device model at the cost of far more engineering work.

Typical uses on Apple silicon Macs

The framework is most valuable where isolated, reproducible environments are needed. Because a virtual machine boots quickly and its disk is a plain file, teams can clone, reset and discard environments with little overhead, especially on APFS volumes that support instant file clones.

  • Continuous integration runners that start a clean macOS guest for each build and test job.
  • Linux development environments for server software, containers and kernel testing.
  • Container runtimes that run a lightweight Linux virtual machine to host OCI containers.
  • Beta testing of new macOS releases without risking the main installation.
  • Security research and malware analysis in disposable, isolated guests.

With Rosetta for Linux, an ARM64 Linux guest can also execute x86-64 Linux binaries by sharing the translator through a virtio-fs mount, which helps teams that still depend on Intel-only build tools.

Limitations and common pitfalls

The framework is deliberately narrow, and several limitations surprise new users. Knowing them early avoids choosing the wrong tool for a project.

SymptomCauseRemedy
App cannot start a virtual machineMissing virtualization entitlementSign the app with com.apple.security.virtualization
x86-64 Windows will not bootNo cross-architecture emulationUse an ARM64 guest or a QEMU-based tool
No USB device passthroughFramework lacks general USB passthroughUse network sharing or another product
Weak 3D performance in LinuxLimited accelerated graphics for LinuxPrefer headless or lightweight desktop use
macOS guest refuses older versionRestore image must match host supportDownload a compatible IPSW restore image
Frequent problems and their causes

A further consideration is memory sizing. Guest memory is allocated from the host’s unified memory, so assigning too much starves macOS and triggers swapping, while assigning too little slows the guest. A balanced starting point is no more than half of the host RAM for a single guest.

A plain-language summary

The Apple Virtualization framework is a toolkit built into the Mac that lets an app create a computer inside the computer. That inner computer can run Linux or another copy of macOS, completely separate from your normal system.

Think of it as a ready-made kit for building a model house. Apple supplies the walls, doors and wiring, so app makers only have to put the pieces together. The result is fast and safe, because the guest system uses the real processor but cannot touch your own files unless you share them.

An example from practice

A small software team builds an iOS app and needs every code change tested on a clean macOS installation. Instead of maintaining several physical test Macs, the team uses a Mac mini with an M-series chip and 32 GB of memory as a build host.

A CI tool based on the Apple Virtualization framework keeps a prepared macOS guest image with Xcode installed. For each pull request, it creates an instant APFS clone of the image, boots it with 4 CPU cores and 12 GB of memory, runs the build and tests, and deletes the clone afterward. Two guests can run in parallel, in line with the macOS license limit.

Each job starts from an identical state in under a minute, test results stop depending on leftovers from earlier builds, and the team retires two aging Intel test machines.