Virtualization.framework — stop completion and storage release

Hello Apple Developer Support,

We are evaluating a macOS VM controller using VZVirtualMachine and would appreciate clarification:

  1. Does stop(completionHandler:) have any documented maximum completion time? What should a controller do if completion never arrives?
  2. After successful completion, are all backend writes finished and disk-image resources released, or is additional teardown required?
  3. What documented sequence establishes that the VM’s complete writable storage set—including disk images and macOS auxiliary storage—can safely be deleted, replaced or restored?
  4. Do these guarantees depend on caching/synchronization mode or macOS version?

We understand that forced stop does not guarantee a clean guest shutdown or application consistency. Our question concerns host-side storage quiescence and resource release.

Documentation references would be helpful. Thank you.

Answered by RemiHansenDev in 918422022

Following up with a narrower question: after VZVirtualMachine.stop(completionHandler:) completes successfully, what documented teardown sequence confirms that Virtualization.framework has stopped accessing the VM’s disk images and macOS auxiliary storage, so those files can safely be deleted or replaced?

If stop completion alone is insufficient, which additional lifecycle event or resource-release step should the controller await?

Documentation references would be appreciated. Thank you.

Accepted Answer

Following up with a narrower question: after VZVirtualMachine.stop(completionHandler:) completes successfully, what documented teardown sequence confirms that Virtualization.framework has stopped accessing the VM’s disk images and macOS auxiliary storage, so those files can safely be deleted or replaced?

If stop completion alone is insufficient, which additional lifecycle event or resource-release step should the controller await?

Documentation references would be appreciated. Thank you.