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.
- Open Task Scheduler on your Windows host.
- Create a Basic Task or Task, and name it something like VirtualBox Auto-Shutdown.
- 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.
- 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.
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.
Anything else we should know?
Thanks for all the contributions you give to the community.