Skip to content

[Req]: Add ACPI VM guest preference on host event like shutdown #846

Description

@extremefuture

Component

Guest Additions/Other

What problem are you facing?

When the host OS shuts down or reboots, I would like a graceful shutdown of the guest OS. There currently is no user preference on how VirtualBox handles closing the VM based on the host OS actions. There seems to be no VirtualBox native support for this.

How can we fix this?

You can offer the two new VM settings: "Close VM action on Host OS shutdown" and "Close VM action on user closing VM". For each, you could offer the following 4 choices: "Send ACPI shutdown to guest OS", "Suspend VM", "Close immediately", and "Attempt to cancel OS Shutdown". Hopefully you can implement all 4 or any other actions you think make sense.

What alternatives or workarounds exist?

The only workaround I am aware of when the Host OS is Windows, is to "create a text file named shutdown-vm.bat on your host machine. Add this command to the file:"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "Your_VM_Name" acpipowerbuttonReplace "Your_VM_Name" with the actual name or UUID of your virtual machine.

  1. Open Task Scheduler on your Windows host.
  2. Create a Basic Task or Task, and name it something like VirtualBox Auto-Shutdown.
  3. Set the trigger to On an event or use a script tied to the system shutdown event (or use local group policy script hooks for shutdown). Alternatively, use a trigger on Log off or system events.
  4. Set the action to Start a program and browse to your shutdown-vm.bat file."

Anything else we should know?

Thanks for all the contributions you give to the community.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions