ARTICLEkhronokernel.com8 min read

Exploring macOS Virtual Machine Limitations and Workarounds

By Mykola Grymalyuk

Exploring macOS Virtual Machine Limitations and Workarounds

AI Summary

During my internship as a Mac Admin, I delved into the intricacies of macOS Virtual Machines, particularly on Apple Silicon using Apple's Virtualization framework. A key limitation I encountered was the restriction to only two active macOS guest VMs on a single host, as dictated by macOS' Software License Agreement. This limitation is enforced within the closed-source part of the macOS kernel, rather than in userspace, as I initially suspected.

After extensive research, I discovered that the VM limit is controlled by a kernel variable, hv_apple_isa_vm_quota, which can be overridden using specific boot arguments. However, these modifications require booting a development kernel, which involves fetching the appropriate Kernel Debug Kit and configuring the Mac to boot this custom kernel. This process allows for bypassing the VM limitation, enabling more than two active VMs.

To implement this, I built a development kernel collection using Apple's tools and configured my Mac to boot it. This involved disabling System Integrity Protection and setting custom boot arguments. Once configured, I successfully ran multiple VMs simultaneously, pushing the limits of my M2 Pro MacBook Pro.

Despite the success, using a custom kernel collection has drawbacks, such as the inability to perform streamlined OS updates. Reverting to the stock kernel is necessary for updates, which involves resetting the boot policy in recoveryOS.

This exploration not only revealed Apple's hidden kernel features but also highlighted the potential for enthusiasts to push beyond documented limitations. Future improvements could include automating the kernel collection building process or developing a kernel extension to simplify the quota override.

Key Concepts

macOS Virtual Machines

Virtual machines (VMs) on macOS allow users to run multiple instances of macOS or other operating systems on a single Mac, using virtualization software to emulate hardware.

Kernel Modification

Kernel modification involves altering the core part of an operating system to change its behavior or capabilities, often requiring advanced technical knowledge and tools.

Category

Technology
M

Summarized by Mente

Save any article, video, or tweet. AI summarizes it, finds connections, and creates your to-do list.

Start free, no credit card