Running macOS in a Virtual Machine

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

I want to know whether I can launch the virtual machine using terminal. If so, what are the commands to do so?

Does it require Xcode or Xcode Command Line Tools to be installed beforehand?

Replies

macOS does not include a built-in user-facing VM product. The Virtualization framework is an API that allows third-party developers to build VM products.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I am developer. And I was successful in setting up the virtual machine using Xcode. I need more clarity on how to set up the same using terminal.

The first instruction under "Configure the Sample Project" says Run InstallationTool from within Xcode or in _Terminal

I want the commands to run the InstallationTool in the terminal.

If you’re referring to the Running macOS in a Virtual Machine on Apple Silicon Macs sample code, InstallationTool is a product of that sample. You have to build that tool first and then you can run it from Terminal:

% cd PPP
% ./InstallationTool-Objective-C 
2023-01-23 09:33:54.954 InstallationTool-Objective-C[5903:333731] Attempting to download the latest available restore image.
…

where PPP is the path to the tool’s build directory.

The tool runs without any arguments, in which it downloads the latest restore image, but you can also point it as a specific .ipsw.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I've got my first VM up and running using the sample tools provided by Apple. Many thanks for the demo source code.

Firstly, is there any official documentation from Apple regarding .ipsw files? I can't find anything doing a search through the general apple support site, although I see some results containing mention of Apple Configurator. Not being a sys admin, I'm not sure where that rabbit hole might lead. I've need had a need to deal with .ipsw files before.

I see the majority of developers/users are accessing software from sites like ipsw.com. This is not something I am willing to do. I don't download or install software from unofficial sources. I can't believe others take this risk.

I'm on an M1 Air, and I want to run older versions of macOS in a VM in order to set up testing environments for the various feature releases related to the Endpoint Security API. So running previous versions like 10.15, 10.15.1, 10.15.4, as separate VMs.

Is this even possible using the VM technology, or will I have to resort to using multiple macOS installs on a single machine?

The VM documentation does mention you can use .ipsw files instead of the built-in download feature, so how do I get hold of the ones I need, or how at least, do I create them from installer images?