-
-
Notifications
You must be signed in to change notification settings - Fork 819
Guest-initiated shutdown leaves VM process running #1184
Description
Description
When shutting down a macOS VM from inside the guest (clicking Apple menu > Shut Down), the VM process on the host does not terminate. lume ls continues to show the VM as running with an assigned IP and VNC port.
Shutting down from the host side via lume stop <name> works correctly.
Steps to Reproduce
- Start a macOS VM:
lume run <name> - Inside the guest macOS, click Apple menu > Shut Down
- Wait for the guest to complete shutdown
- On the host, run
lume ls
Expected Behavior
The VM process should terminate and lume ls should show the VM as stopped.
Actual Behavior
The VM remains in running status indefinitely. lume stop also hangs when attempted after a guest-initiated shutdown (times out after 10 SIGINT attempts, then requires SIGKILL).
The only way to stop it is to manually kill the lume process from the host.
Environment
- lume version: v0.2.85 and v0.2.86
- macOS host: Apple Silicon, Darwin 25.3.0
- Guest OS: macOS (pulled via lume)
- Reproduced in: Both normal boot and recovery mode (
--recovery-mode true)
Notes
This likely relates to Apple's Virtualization.framework guest shutdown event not being properly observed/handled by lume. The VZVirtualMachine API provides a guestDidStop delegate method that should be used to detect guest-initiated shutdowns and clean up the VM process accordingly.