Auto start VM upon app launch #5913
Replies: 3 comments
-
I have exactly the same question. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if there's a way to auto start a VM when UTM launches but it is possible to auto start a VM when the Mac logs in. Start “Automator”. Create an “Application” workflow Search for “Launch Application” action. Double click or drag it into the workflow to add. Select “Other” from the dropdown and then find “UTM.app”. Search for “Run Shell Script” action. Double click or drag it into the workflow to add. Change the shell script to (replace "Home Assistant" with the name of your Home Assistant VM)
To test the workflow, make sure UTM is not running or stop the VM. Click “Run” command in the top right of Automator and approve the permission prompt Verify UTM starts the VM. Save the Automator workflow as “UTM Start Home Assistant.app” Open “Login Items” in “Users & Groups” settings Drag or add the “UTM Start Home Assistant” application into the Login Items (the list UI might be buggy and doesn’t show it immediately, switch between the “Password” and “Login Items” tabs to refresh the list) Restart the computer. The first time the workflow runs there will be another permissions prompt, approve. Afterwards it shouldn’t prompt anymore. |
Beta Was this translation helpful? Give feedback.
-
Has anyone tried what @longzheng is suggesting? It seems that not many people are asking for this feature, which I find essential. I'm using a Mac mini M1 as a home automation server (due to its performance and low power consumption). I would like certain VMs to restart automatically after a power outage or a macOS update, without having to bother creating specific scripts for each machine I'm testing. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to have a VM auto launch when UTM launches? I run Home Assistant in a VM and it would be really great to have the VM auto launch if I ever have to restart my Mac..
Beta Was this translation helpful? Give feedback.
All reactions