UTM for Developers

July 6, 2023

UTM makes it easy to set up and manage macOS and Windows virtual machines. This can be especially useful for developers such as Tauri contributors who need to test their applications across multiple platforms, or for those looking to experiment with different operating systems without affecting their primary system.

In this tutorial, we set up macOS and Windows virtual machines on UTM, a macOS application that provides a GUI wrapper for QEMU, a powerful open-source emulator and virtualizer. UTM allows you to easily manage and run virtual machines without memorizing complex commands. It also has special handling for macOS, making it simpler to install compared to other virtual machine software.

Before you get started, download and install UTM.

Setting up a macOS Virtual Machine

To create a macOS virtual machine:

  1. Click on “Create Virtual Machine”
  2. Choose “Virtualize”
  3. Select “macOS 12+“
  1. Select an IPSW (iPhone Software, although this name is used for all Apple operating systems) or let UTM download it automatically
  2. Configure system settings like CPU cores and storage
  3. Save the configuration and UTM will automatically download the macOS installer and install the OS on the virtual hard drive

Setting up Windows Virtual Machine

For a Windows virtual machine:

  1. Make sure you have the necessary prerequisites installed (such as Homebrew). See the instructions provided in the Windows install guide on the UTM website for detailed information. Here’s the guide for Windows 11 from UTM’s website
  2. Build the Windows ISO file
  1. Create a new virtual machine in UTM and choose “Windows”
  2. Uncheck the “Directly boot ISO/CD image” option and ensure “Install drivers and SPICE tools” is checked
  3. Upload the ISO file you created earlier
  4. Configure other settings like memory, CPU cores, and storage as needed
  5. After saving the configuration, UTM will boot the Windows installer, and you can follow the usual Windows installation process

Managing Virtual Machines

Both macOS and Windows virtual machines can be customized and managed through UTM’s user interface. You can adjust settings, add devices, and even set up shared folders to share files between the host and guest operating systems. Shared folders serve as a great method for passing files between the host OS and the VM guest. In order to make this possible:

  1. Enable the shared folder in the macOS settings under “General” > “Sharing” > “File Sharing”
  1. Locate the shared folder in “/users/<user>/Public” (Note: you can drag the folder into the sidebar for easier access)
  2. The VM guest will now show up in your host machines Finder under “Network”

For more detailed guidance on setting up and managing virtual machines with UTM, you can watch the livestream replay on YouTube.