UTM for Developers

crabnebuladev

CrabNebula

Posted on July 17, 2023

UTM for Developers

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” Image description
  2. Choose “Virtualize” Image description
  3. Select “macOS 12+” Image description
  4. Select an IPSW (iPhone Software, although this name is used for all Apple operating systems) or let UTM download it automatically Image description
  5. Configure system settings like CPU cores and storage Image description
  6. Save the configuration and UTM will automatically download the macOS installer and install the OS on the virtual hard drive Image description

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 Image description Image description Image description Image description
  3. Create a new virtual machine in UTM and choose “Windows” Image description
  4. Uncheck the “Directly boot ISO/CD image” option and ensure “Install drivers and SPICE tools” is checked Image description
  5. Upload the ISO file you created earlier
  6. Configure other settings like memory, CPU cores, and storage as needed Image description Image description
  7. After saving the configuration, UTM will boot the Windows installer, and you can follow the usual Windows installation process Image description Image description

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” Image description Image description
  2. Locate the shared folder in “/users//Public” (Note: you can drag the folder into the sidebar for easier access)
  3. The VM guest will now show up in your host machines Finder under “Network” Image description Image description

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


Author: Jonas Kruckenberg, DevRel

💖 💪 🙅 🚩
crabnebuladev
CrabNebula

Posted on July 17, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

UTM for Developers
rust UTM for Developers

July 17, 2023