UTM
UTM copied to clipboard
Add button for ACPI shutdown
Background
There's three ways to turn off a physical computer:
- Login, ask the operating system to shutdown (may require admin permission)
- Yank the power cord.
- Press a physical button on the computer to indicate you want to shutdown.
Abstract
UTM supports the first two. I hope we can support 3., which is called ACPI shutdown.
Proposal
In the GUI this can be done by changing what happens when you click the shut down button.
Currently it asks if you are sure you want to yank the power cord "CONFIRMATION: this may corrupt the VM and any unsaved changes will be lost. To quit safely, shut down from the guest."
But this could be changed instead to show a dialog box with options:
- Soft shutdown (ACPI, requires OS support)
- Hard shutdown (immediate stop, may corrupt VM)
- Cancel
Note you may also be able to shut down inside the guest operating system.
alternative dialog:
How would you like to shutdown the VM?
- ACPI shutdown
- Hard shutdown
- Cancel
(hard shutdown button is red to indicate a slightly dangerous action, both shutdown action would prompt for confirmation and hard shutdown may include info that vm might corrupt, may also apply to restarts if that exists)
It is my opinion that such a feature will lead to "complexity creep". Most (90%) of people won't know what "ACPI shutdown" means or how it's different from other kinds of shutdown. Most people also won't need such an option. Maximum flexibility will come at a cost of a more difficult to understand UX. In most cases, you can trigger an ACPI shutdown directly from the guest.
In order to shutdown from the guest you need to login. And then you need the root password.
It's a lot of steps. So maybe other people also like the ACPI option.
ACPI and a way to type CTRL-ALT-DELETE are basic things nearly all VM GUIs have.
Agree we need a “safe shutdown” button. See https://github.com/utmapp/UTM/issues/3859#issuecomment-1114787051, closes 3859
...Most (90%) of people won't know what "ACPI shutdown" means or how it's different from other kinds of shutdown...
To be honest UTM is already pretty "complex" as such pieces of specialized software are. I tend to believe most users with the need to emulate/virtualize are more tech-savvy to begin with.
+1
Just curious:
- Will this require spice guest tools or any acpi-compliant os?
- When approximately will 4.1 be released with this feature (beta and stable)?
Thanks in advance for adding this feature!
this feature requires ACPI functioning systems because it uses ACPI stuff
The way QEMU implemented it is more generic. Any hw can hook on to that call. In practice I think it’s probably most useful in ACPI systems.
+1
+1
@osy sometimes I find myself clicking the power button accidentally instead of holding it down. I know this is petty and thank you for configuring the ACPI, but do you think it would be possible in settings to add a toggle to "show advanced shutdown options by default"? Many thanks in advance, and I love your software!
I had no idea that holding down the power button showed more options until reading this.
It would be nice if the defaults were the safest for the user: closing the window could save a snapshot that is restored next time, and hitting the power button would attempt an ACPI shutdown, after some timeout a dialogue could ask if you want to force shutdown.
I didn't either, maybe either what anonymousaga suggests or let people set the default action.
For me having a setting to define default close action, as one can with VirtualBox, will be the only way to gracefully handle host shutdowns and reboots.
Without that I'm left with complex hooks into the host shutdown process to run an SSH shutdown command on all guests. It's a mess.
A bare minimum is a pop up on any close request asking what type of shutdown is required, Request Shutdown, Force, or Cancel.
I'd love to have a setting that would either send ACPI shutdown for all running guests on host user log out or shutdown/reboot. The second option could be to save a snapshot. This would block UTM quitting until all guests gracefully exit.
I believe you'll find the newest build does now save state of guest VMs that are capable of being suspended when the host application is requested to quit.
Automatically save state when you close a VM This will only work on VMs that support save states. If your VM does not support it, you will get an error message with an explanation.
https://docs.getutm.app/updates/v4.4/
Great stuff, I'll wait until the GL_ARB_clear_texture bug is resolved before trying this, but it looks good.