Post

Replies

Boosts

Views

Activity

Reply to What does VZError code=12 mean when restoring VM state?
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:
May ’25
Reply to What does VZError code=12 mean when restoring VM state?
Hi, I'm getting the same error with my code when running it with my GUI app (no VNC or similar) and trying to restore a snapshot with VZVirtualMachine.restoreMachineStateFrom(url) Failed to restore with error: Error Domain=VZErrorDomain Code=12 "The virtual machine failed to restore with error “invalid argument”." UserInfo={NSLocalizedFailure=An error occurred while restoring the virtual machine., NSLocalizedFailureReason=The virtual machine failed to restore with error “invalid argument”.} Snapshot was written successfully without errors using VZVirtualMachine.saveMachineStateTo(ur) and also prio check with VZVirtualMachineConfiguration.validateSaveRestoreSupport() does't fail. Any other ideas what could cause this error?
Topic: App & System Services SubTopic: Core OS Tags:
May ’25