The URL scheme
utm is associated with the UTM app. To launch or bring to foreground UTM, open the URL
utm:// (for example Safari, Shortcuts “Open URL” action, Automator).
Commands marked ⚠️ can result in data loss or corruption in the guest VM, as the VM is shut down improperly.
| || ||The VM with the provided name is started, if it’s not already started.|| |
| || ||The VM with the provided name is stopped immediately. ⚠️|| |
| || ||The VM with the provided name is stopped immediately, then started again. ⚠️|| |
| || ||The VM with the provided name is paused. (not supported for all VMs)|| |
| || ||The VM with the provided name is resumed (un-paused).|| |
| || ||The VM with the provided name receives the supplied text as keyboard input.|| |
| || ||The VM with the provided name receives a mouse click down and up event at the specified pixel location.|| |
| || ||Downloads the ZIP file (progress shown in UTM with cancel button), then extracts and imports the contained || |
Note on the
sendText action: you can send ASCII Control Codes to the VM, here are some common ones:
- Esc is
- Delete (backspace) is
- Tab is
- Enter is
The parameters like
url need to be URL encoded so they are received correctly. For example, if the VM “Ubuntu 20.04” should be addressed, the name parameter is “Ubuntu%2020.04”. If you’re using Shortcuts “Open URL” action, this is done automatically. Otherwise you can use apps like Boop or websites like DuckDuckGo or Dan’s Tools URL Encode Decode to perform the encoding.
- URL action with the parameter utm://start?name=Ubuntu 20.04
- Open URLs action
First, create a Shortcut to launch the VM as shown above. Then, select the shortcut in the list and choose File → Add to Dock.
The Shortcut will appear in your Dock. Hold down the ⌘ (cmd) key while clicking on the icon in the Dock to reveal the Shortcut file in Finder. A Finder window will open in the folder ~/Applications/. Add the Shortcut file to your Login Items (System Preferences → Users and Groups → Login Items):
To stop the VM from starting at login, open the Login Items page again, select the Shortcut in the list, and press the minus button (-).
Here is an example Workflow created in Automator:
- Get Specified Text: utm://start?name=Ubuntu%2020.04
- Extract URLs from Text
- Display Webpages
To start a VM automatically when you log in to your Mac, create an Automator workflow like above to start the VM you want. Then add it to your Login Items (System Preferences → Users and Groups → Login Items).