5

With virtualbox, I use VBoxManage controlvm "$VMNAME" acpipowerbutton to shut down a virtual server when the host is shutting down.

This works well when I test, but not in real world cases (i.e. when the host reboots for updates, or even sometimes when it is manually restarted for maintenance). In some of these cases, the VM does not shut down, and after a timeout the virtualbox process is killed, which is less than ideal.

youen
  • 209

1 Answers1

5

The problem was hard to troubleshoot because it worked most of the time when explicitely testing the shutdown procedure. It turns out this was because I was logged on the windows server (RDP) to see if it was shutting down correctly. And this is exactly the difference between a success and a failure: if no one is logged on the server, the ACPI button does nothing!

Luckily, this can be configured easily: use regedit to set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\shutdownwithoutlogon to 1

youen
  • 209