Skip to content

macOS: add graceful power-down quit policy - #7829

Open
synrest wants to merge 1 commit into
utmapp:mainfrom
synrest:upstream/graceful-quit
Open

macOS: add graceful power-down quit policy#7829
synrest wants to merge 1 commit into
utmapp:mainfrom
synrest:upstream/graceful-quit

Conversation

@synrest

@synrest synrest commented Aug 18, 2026

Copy link
Copy Markdown

Summary

  • Add a “Running VMs on quit” setting with “Save State (Default)” and “Request Power Down” options.
  • When requested, resume paused non-suspended VMs, ask all running VMs to shut down gracefully, and wait for every candidate before terminating UTM.
  • Cancel application termination and show a visible error when a shutdown request fails or the VMs do not stop within 45 seconds.
  • Isolate repeated Quit attempts so delayed completion from an earlier attempt cannot affect a later attempt.

Save State remains the default behavior.

Related to #5912.

Testing

Tested by a human on an Intel Mac running macOS Sequoia with QEMU x86_64 Debian 13 guests. Apple Virtualization was not runtime-tested.

Validated:

  • A single running guest shut down cleanly before UTM exited.
  • A paused, non-suspended guest was resumed and shut down cleanly.
  • Two simultaneous guests both stopped before UTM exited.
  • PostgreSQL 17 logs confirmed clean shutdown and clean subsequent startup.
  • A guest-side systemd power-key inhibitor exercised the 45-second timeout, visible error, and cancelled termination.
  • A repeated Quit while inhibited waited for a fresh timeout and produced exactly one new error.
  • Removing the inhibitor allowed a subsequent Quit to succeed.
  • The final Settings picker wording and native layout were visually verified.

The author acknowledges that this change has been tested and/or reviewed by a human in accordance with UTM’s AI contribution guidelines.

Allow users to request guest shutdown when quitting UTM while preserving Save State as the default. Wait for all selected virtual machines to stop, resume paused non-suspended guests, and cancel termination with a visible error when shutdown fails or times out.

Related to utmapp#5912.

Assisted-by: Codex:gpt-5.6-sol
Assisted-by: ChatGPT:GPT-5.6-Sol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant