How to run macOSVirtualMachineSampleApp?

Hello, I am very new to Xcode and trying to build and run a simple project that installs and runs a VM. The sample code is provided by apple at

https://developer.apple.com/documentation/virtualization/running_macos_in_a_virtual_machine_on_apple_silicon_macs

The code has two apps. One that installs the bundle and another that runs it. I am able to create the bundle but don't know how to run the app macOSVirtualMachineSampleApp. Every time I start run I get the following.

create VM.bundle: the base directory already exists.

Which means I am running InstallationTool app every time. How do I run the macOSVirtualMachineSampleApp?

I can see that in products folder both apps have been created but I only see Installationtool command line tool when I go to that location.

Answered by MobileTen in 709339022


Overview This sample code project demonstrates how to install and run macOS virtual machines on Apple Silicon using the Virtualization framework. There are two separate applications included in the Xcode project: InstallationTool, a command line tool that installs macOS onto a virtual machine from a restore image. You can use the installation tool to download the restore image of the most current macOS release from the network, or, if you already have previously saved a restore image, directly install macOS with your own restore image. The installation tool creates a VM Bundle in your home directory and stores the resulting virtual machine images there.

macOSVirtualMachineSampleApp, a macOS app that launches and controls the macOS virtual guest that loads and runs macOS from the VM Bundle. You run the installation tool from inside Xcode or the command line to install the macOS image. After it successfully installs the image, you run the macOSVirtualMachineSampleApp to run the macOS guest operating system. The macOSVirtualMachineSampleApp starts the virtual machine and configures a graphical view that you interact with. The virtual Mac continues running until you shut it down from inside the guest OS, or you quit the macOSVirtualMachineSampleApp.

Accepted Answer


Overview This sample code project demonstrates how to install and run macOS virtual machines on Apple Silicon using the Virtualization framework. There are two separate applications included in the Xcode project: InstallationTool, a command line tool that installs macOS onto a virtual machine from a restore image. You can use the installation tool to download the restore image of the most current macOS release from the network, or, if you already have previously saved a restore image, directly install macOS with your own restore image. The installation tool creates a VM Bundle in your home directory and stores the resulting virtual machine images there.

macOSVirtualMachineSampleApp, a macOS app that launches and controls the macOS virtual guest that loads and runs macOS from the VM Bundle. You run the installation tool from inside Xcode or the command line to install the macOS image. After it successfully installs the image, you run the macOSVirtualMachineSampleApp to run the macOS guest operating system. The macOSVirtualMachineSampleApp starts the virtual machine and configures a graphical view that you interact with. The virtual Mac continues running until you shut it down from inside the guest OS, or you quit the macOSVirtualMachineSampleApp.

How to run macOSVirtualMachineSampleApp?
 
 
Q