I have been building virtual machines and running macOS 12 & 13 on them for over a week now using the "macOSVirtualMachineSampleApp" referenced in wwdc2022-10002 session "Create macOS or Linux virtual machines", but not without some initial issues and only after considerable sleuthing.
I need someone to explain what's going on.
I followed the instruction given at: "https://developer.apple.com/documentation/virtualization/running_macos_in_a_virtual_machine_on_apple_silicon_macs"
I ran "InstallationTool-Swift" and it created "VM.bundle" in my home directory as per the documentation. However...
Running "macOSVirtualMachineSampleApp-Swift" the VM fails to load and the app returns :"Thread 1: Fatal error: Missing Virtual Machine Bundle at /Users/myUserName/Library/Containers/com.example.apple-samplecode.macOSVirtualMachineSampleAppBA8MNGZ7WS.macOSVirtualMachineSampleApp/Data/VM.bundle/. Run InstallationTool first to create it."
The app seems to have created a series of nested folders in myUserName/Library/Containers/ and is looking for "VM.bundle" there!
Only after I copy "VM.bundle" to the location above will the VM load and run without issue.
"Path.swift" sets vmBundlePath = NSHomeDirectory() + "/VM.bundle/" and one would think "macOSVirtualMachineSampleApp" would look for it there.
Why isn't it? What am I missing?
Where in the code in "vmBundlePath" is being changed if that is in fact what's happening?
I want to teak the code so that when the installer creates "VM.bundle", the app runs it from there.
NOTE: "vmBundlePath" cannot be set to the location where "macOSVirtualMachineSampleApp" currently wants to find it because only after that app runs does the path get created but the installer needs that path to create the bundle.