Skip to content
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

Add button for ACPI shutdown #4001

Closed
fulldecent opened this issue May 11, 2022 · 19 comments
Closed

Add button for ACPI shutdown #4001

fulldecent opened this issue May 11, 2022 · 19 comments
Labels
enhancement New feature or request
Milestone

Comments

@fulldecent
Copy link
Contributor

Background

There's three ways to turn off a physical computer:

  1. Login, ask the operating system to shutdown (may require admin permission)
  2. Yank the power cord.
  3. 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:

  1. Soft shutdown (ACPI, requires OS support)
  2. Hard shutdown (immediate stop, may corrupt VM)
  3. Cancel

Note you may also be able to shut down inside the guest operating system.

@fulldecent fulldecent added the enhancement New feature or request label May 11, 2022
@JacksonChen666
Copy link

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)

@osy
Copy link
Contributor

osy commented May 12, 2022

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.

@fulldecent
Copy link
Contributor Author

fulldecent commented May 12, 2022

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.

@conath
Copy link
Contributor

conath commented May 13, 2022

Agree we need a “safe shutdown” button. See #3859 (comment), closes 3859

@peterneutron
Copy link

...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.

@alejandroacostaalamo
Copy link

Agree we need a “safe shutdown” button. See #3859 (comment), closes 3859

+1

1 similar comment
@mbbee
Copy link

mbbee commented Jul 1, 2022

Agree we need a “safe shutdown” button. See #3859 (comment), closes 3859

+1

@anonymousaga
Copy link

+1

@osy osy added this to the Future milestone Sep 3, 2022
@osy osy modified the milestones: Future, v4.1 Nov 23, 2022
@osy osy closed this as completed in fda1fe3 Nov 26, 2022
@anonymousaga
Copy link

Just curious:

  1. Will this require spice guest tools or any acpi-compliant os?
  2. When approximately will 4.1 be released with this feature (beta and stable)?

Thanks in advance for adding this feature!

@JacksonChen666
Copy link

JacksonChen666 commented Nov 26, 2022 via email

@osy
Copy link
Contributor

osy commented Nov 26, 2022

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.

@fgclue

This comment was marked as spam.

@anonymousaga
Copy link

@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!

@stuaxo
Copy link

stuaxo commented Sep 1, 2023

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.

@mbk5631
Copy link

mbk5631 commented Oct 1, 2023

I didn't either, maybe either what anonymousaga suggests or let people set the default action.

@Mister-A
Copy link

Mister-A commented Oct 2, 2023

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.

@wpiekutowski
Copy link

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.

@Mister-A
Copy link

Mister-A commented Nov 3, 2023

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/

@stuaxo
Copy link

stuaxo commented Nov 3, 2023

Great stuff, I'll wait until the GL_ARB_clear_texture bug is resolved before trying this, but it looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests