When running a macOS virtual machine using Virtualization.framework, I am encountering a reproducible issue where the kernel’s internal VM slot counter (hv_apple_isa_vm_quota) is not decremented after a guest-initiated shutdown.
This leads to subsequent VM launches failing with VZErrorVirtualMachineLimitExceeded, even though no active VMs appear to be running.
Steps to Reproduce:
Create a valid VZVirtualMachineConfiguration for a macOS guest
Initialize and start a VZVirtualMachine instance
Inside the guest macOS, perform a normal shutdown (Apple menu → Shut Down)
Wait until VZVirtualMachine.state becomes .stopped
Attempt to start the same VZVirtualMachine instance again
Expected Behavior:
The VM should restart successfully.
The kernel should release the VM slot once the guest shuts down, allowing a new VM instance to start without requiring any host-side intervention.
Actual Behavior:
start() fails with:
Domain: VZErrorDomain
Code: 6 (VZErrorVirtualMachineLimitExceeded)
Description: “The number of virtual machines exceeds the limit. The maximum supported number of active virtual machines has been reached.”
Despite the VM reporting .stopped, the system continues to behave as if a slot is still allocated.
Workarounds Tested:
The following approaches did not resolve the issue:
Releasing and recreating the VZVirtualMachine instance
Introducing delays (5s, 30s, 60s) before restarting
Terminating all processes related to Virtualization.framework
The only reliable recovery is a full macOS host reboot, which resets the VM quota state.
Environment:
macOS 26.5 (Tahoe)
Apple Silicon: M4 Max
Virtualization.framework (system-provided)
Impact:
This issue makes reliable VM lifecycle management difficult for applications relying on Virtualization.framework (e.g., UTM and similar tools). In automated environments (CI/CD, testing pipelines), it can cause persistent VM launch failures and require full host reboots, interrupting all workloads.
Suspected Issue:
It appears the kernel VM slot counter (hv_apple_isa_vm_quota) is not consistently decremented when a VM exits via guest-initiated shutdown, despite the VZVirtualMachine transitioning to .stopped.
This suggests a race condition or missing cleanup path in the shutdown lifecycle handling.
Request:
Could you confirm whether this is a known issue or expected behavior, and whether there is a recommended API-level workaround to ensure VM slot cleanup after guest shutdown?