Besides keeping a reference to all virtual machine objects, is there a way to track the state of virtual machines.
Track Virtual Machines
It seems that VZVirtualMachine.state is a KVO property. So you can add an observer and get notifications when the virtual machine state changes.
What kind of "state" are you interested in tracking?
You should be able to track the runtime state of a virtual machine, such as whether the virtual machine is paused, via the VZVirtualMachine object and all the sub-objects that are properties of the VZVirtualMachine.
Outside of the Virtualization.framework API, you will see a process named "com.apple.Virtualization.VirtualMachine" running on your system, this is the process responsible for running the virtual machine.
Thanks, I guess my question is what happens to the virtual machine once you no longer have a reference to the VZVirtualMachine.
Hence my questions about keeping a reference to all objects. (along with using KVO as @dverevkin suggesting and keeping all the references this is what I do now)