UTM for Developers
Tags: rust, tauri, utm, virtualmachine
Published: 2023-07-17 07:13:30

[UTM](https://getutm.app/) 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](https://www.qemu.org/), 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](https://mac.getutm.app/).

## Setting up a macOS Virtual Machine

### To create a macOS virtual machine:

1. Click on “Create Virtual Machine”
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2vi2r8wb0mnlm55z9jb2.png)
2. Choose “Virtualize”
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y6ec1qpsuuzdphv2h1ug.png)
3. Select “macOS 12+”
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70vze0a5dwz5y4sac8h2.png)
4. Select an IPSW (iPhone Software, although this name is used for all Apple operating systems) or let UTM download it automatically
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iezsjhgbbqujadxwogvy.png)
5. Configure system settings like CPU cores and storage
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ivl7b5cytrrssfiruzk8.png)
6. Save the configuration and UTM will automatically download the macOS installer and install the OS on the virtual hard drive
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/62xc6ov752edc22u7q29.png)

### 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](https://docs.getutm.app/guides/windows/#instructions)
2. Build the Windows ISO file
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e9r2khrlycro2b5kh0pe.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xu7ik57trvkazmhwhc5r.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qq1pyktdfdvtfqcsc2up.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/weh6r8boc2du9xh46804.png)
3. Create a new virtual machine in UTM and choose “Windows”
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lm8r9emb49kqly3gvusp.png)
4. Uncheck the “Directly boot ISO/CD image” option and ensure “Install drivers and SPICE tools” is checked
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/572nia39ldv0anlbm6b0.png)
5. Upload the ISO file you created earlier
6. Configure other settings like memory, CPU cores, and storage as needed
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/buo05f7w2x1dh1lvohvx.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4be35pfywvrjydwt4kxu.png)
7. After saving the configuration, UTM will boot the Windows installer, and you can follow the usual Windows installation process
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rqvl6gtfnpd1r1j4dzrn.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rvkyjhng4ptjhh3acwx6.png)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/troui9tze18o7517lmhq.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/08wsovcehjpf29tov58i.png)
2. Locate the shared folder in “/users/<user>/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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1nl6v41cacy30susqd3u.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5pegusmzaa5citrcemm.png)

For more detailed guidance on setting up and managing virtual machines with UTM, you can [watch the livestream replay on YouTube](https://www.youtube.com/watch?v=yT65eKlAYNQ).

---

_Author: Jonas Kruckenberg, DevRel_