-
-
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
Initial socket support draft #5081
base: main
Are you sure you want to change the base?
Conversation
This adds support for a utm.socket that can be used to list, start and stop VMs.
FYI we had a socket command interface that was removed in favor of the scripting bridge interface d6fc3cd |
That's interesting! Maybe I'm holding the scripting interface wrong, as I'm trying to figure out how to do this headless in an automated fashion. Utmctl doesn't like being run form within an ssh session. |
The way apple events works depends on the GUI app running under some logged in user. So no, you can’t do it from just a ssh session. However, I don’t think you’ll get it working well with sockets either because of sandboxing. You’d need to launch the GUI somehow no matter what. |
Yes, I can launch UTM as a launch item for the automatically logged in user on the host. Building a different headless executable seems much more involved. |
In essence, what I'd like is something like tart.run, without the restriction to HVF only, if that makes sense? |
I think you may be better off using QEMU directly if you’re thinking about building a headless version. |
osy, if it was for non-HVF applications yes. What I like a lot about UTM is
I'm mostly interested in macOS on macOS. For Apple Silicon this is HVF, for Intel it's qemu. Using a common interface like utm has its appeal here. Just dealing with the graphical session is a bit annoying over high latency networks. If there is a way to run utmctl from a ssh shell that would pretty much solve all my needs right now, hence trying to sidestep the graphical login topic by using a unix socket for commandeering UTM. (To be fair though, it doesn't commandeer UTM directly right now, but just re-uses the UTMData structure and it's methods). |
FYI what you're referring to is Virtualization.framework, that's the higher level framework used for macOS-on-macOS on Apple Silicon HVF is the low level hypervisor, similar to kvm on Linux |
After some experimentation here's what also works:
Now that feels a bit convoluted, but allows us to obtain almost the same functionality like this without modifying utm.
I wonder if adding a socket interface to The motivation is to control UTM from the command line of a non-graphical session. |
This adds support for a
utm.socket
that can be used to list, start and stop VMs.It allows controlling
UTMData
through a socket (if UTM is launched with--with-socket
):The idea here is to launch UTM as a service, and then use the socket to communicate and control starting, stopping, ... VMs.
This is an initial draft, to start a discussion around whether or not such a feature is desirable, better approaches to it and so forth.