-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MacOS] Start VM Headless/In Background #2280
Comments
I'm 99% sure this isn't currently possible, but I am also 99% sure it can be implemented. Here's how (which would work both on macOS and iOS):
Would that be adequate for your use case? |
That would work perfectly for me |
I think your use case is more suitable for QEMU. UTM is nothing but a fancy UI wrapper around QEMU, but it seems like your use case would be solved by launching the QEMU command line at startup. |
Yes |
Is there actually a command-line frontend for qemu delivered in the software for the Mac? I was searching in the pre-compiled installation folder but only found the qemu-system-* libs. Or do I correctly assume that you need to compile qemu by yourself in parallel to use the arguments? |
While, I could set this up manually, having the UTM GUI is really nice. I would personally find it helpful if you could setup UTM to start when I login, but minimized to the menu bar. Then be able to start/stop VMs from UTM as opposed to needing to (a) find/build a compiled qemu binary, and (b) share configurations b/w UTM and my qemu scripts. I don't think the full headless option as described above is really needed here. That seems very complicated (do-able, but complicated). But a menu-bar interface to manage VMs, and allow the VMs to operate w/o having a GUI window connected would be amazing. If those two things were possible, it would be great! |
+1 to what mbreese said. I would love to have a UTM icon in the top menu bar that would allow me to keep VMs running and start/stop them as needed. It would then be great to be able to connect to the GUI if desired as well, but that's very much secondary for me. |
+1 would love this for vagrant! |
Also throwing in my vote for being able to use UTM as a provider for Vagrant so I can run headlessly. I am a creature of the command line, and would love to be able to spin up/SSH into/teardown VMs with UTM on the back end. I'm still an Intel Mac, so I do it now with Vagrant and VirtualBox, but the latter won't be an option when I make the switch to M1. |
... and I'd be happy to chip in and write a Vagrant plugin. Some sort of CLI interface provided by UTM would certainly ease the integration. |
I recently implemented a URL scheme, maybe it can be used in your use case? Not merged yet due to crashing with a specific feature it introduces. See #2670 |
I just looked into:
and didnt notice #2670. Awesome work! Indeed it would. Invoking |
It's now (2.3.0 beta) possible to run VM at login. I've added a note to the Wiki on using the new URL scheme to run VMs at login. https://github.com/utmapp/UTM/wiki/URL-Scheme-–-Automation-for-UTM-app-&-VMs#auto-start-vm-on-mac This is written from a non-Terminal user's perspective, of course you don't have to invoke UTM from Automator. ;) |
@osy If I understand the code correctly, we'll need to change how a VM gets started since right now QEMU is launched after the VM window opens but in headless mode there won't be any window opening. |
@lucendio now that the utm urlscheme exists do you have enough for writing a vagrant plugin as you mentioned? |
@ITJamie as far as I can see, yes. But as always, issues are only uncovered along the way. I want to start on this next week. |
@lucendio Just to let you know, opening the Also it would probably only work with a VM in |
Has the SSH worked for anyone using the emulated VLAN? #3143 suggests using shared network to make it work. |
@conath it works for me pretty consistently. |
To clarify if I start a VM with UTM can I close UTM and thus the GUI and still leave the machine running in 3.0.3? then I can just use qemu CLI for interaction? UTM is great by the way. |
@johnalanwoods Thank you. UTM does not currently offer such a feature, and this issue is about starting a VM without a GUI. Feel free to create a new issue about your feature request and, if you do, please describe your use case in detail. |
Thank you! @conath |
One additional thing that would be very helpful here would be a |
I've created a macOS shortcut to do this and described it in the show and tell discussion category. |
This has now been added to 4.15:
(also possible to use |
This is great, thanks! Any way to hide the actual UTM screen of the VM? I see the --hide argument to start can hide the main UTM window, but I am asking about the actual VM window. |
You could make the VM headless, by removing the display device in the VM config. |
Although this use case is covered by QEMU, it is still beneficial to be able to have UTM launching at system boot, launching wanted VMs automatically in the background, and being able to manage them in the UI. By using QEMU directly, one loses all the benefits of UTM. A problem of current headless mode is that you can't have a display without rebooting the VM. It would be much better to be able to hide the display instead, either by an option to start the VM with hidden display, or by closing the window without killing the VM. |
Is there some way to start the VM in the background without needing to open the UTM app? I know UTM uses QEMU under the hood, is there a way to easily interface with the instance of QEMU provided by UTM?
The use case I'm trying to tackle is that it would be nice to have my UTM VM launch automatically in the background when my Mac boots up.
The text was updated successfully, but these errors were encountered: