When the host is being shut down an automatic Save State of a headless VM is triggered. Is it possible to change it to automatic shutdown instead?
I couldn't find any solution. The only hint was to set "VBoxManage setextradata VM-name GUI/DefaultCloseAction Shutdown", but that apparently doesn't affect headless VMs.
When I run QEMU VM on Linux and the host is shutting down it waits for all the VMs to shut down. I would like to achieve the same behavior with VirtualBox.
VirtualBox Version: Version 6.1.30 r148432 (Qt5.6.2)
Host OS: Win10 Pro 21H2
Guest OS: Debian GNU/Linux 11 (bullseye)
Host Extensions Installed: Yes
Guest Additions Installed: No
Hardware virtualization enabled: Yes
Posted Jun 15, 2022, 6:16 AM UTC
The problem with a script solution is that windows will likely terminate the script process and the VM process if that's still active for some reason, before the script can finish.
I am struggling to find a solution for ages. There is an app that's supposed to do exactly this, can't remember the name but should be easy to find via Google. Yet it doesn't work at all for me.
Edit: VBoxHeadlessTray was it I think.
But, maybe VBoxVmService is a much better solution. It will run your virtual machine as a service that can be started/stopped with windows start/shutdown, that way windows should automatically handle everything for you and wait for the VM to gracefully shutdown. The downside was that i needed admin rights to access VM control, which kind of killed it for me. Will have to take another look at this.
Thanks for the tip. VBoxVmService looks interesting.