The header file for VZVirtualMachine contains some more information and hints regarding this error, that I can't see in the official doc and that helped me to resolve my issue.
This is the info from the header file for VZVirtualMachine.restoreMachineStateFrom(url):
The virtual machine must also be configured compatibly with the state contained in the file.
If the VZVirtualMachineConfiguration is not compatible with the content of the file, this operation will fail with a VZErrorRestore error indicating an invalid argument failure reason.
Files generated with saveMachineStateToURL:completionHandler: on a software version that is newer than the current version will also be rejected with an invalid argument failure reason.
In some cases, restoreMachineStateFromURL:completionHandler: can fail if a software update has changed the host in a way that would be incompatible with the previous format. In this case, an invalid argument error will be surfaced.
In most cases, the virtual machine should be restarted with startWithCompletionHandler:.
In my code I ran into the "If the VZVirtualMachineConfiguration is not compatible with the content of the file" case as the macAddress property of VZVirtioNetworkDeviceConfiguration the network device that my VM config used changed between the time the VM state was saved using VZVirtualMachine.saveMachineStateTo(url) and the attempt to restore the VM from the saved state.
The fix was to ensure that the macAddress remains the same. Afterwards restoring worked.
Topic:
App & System Services
SubTopic:
Core OS
Tags: