Skip to content

Guest-initiated shutdown leaves VM process running #1184

@fujiwarakasei

Description

@fujiwarakasei

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

  1. Start a macOS VM: lume run <name>
  2. Inside the guest macOS, click Apple menu > Shut Down
  3. Wait for the guest to complete shutdown
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions