How to shutdown a windows guest VM in VirtualBox

If you have a guest Windows VM running, you can shut it from the host command line like this:

# VBoxManage controlvm "windows server 2012" acpipowerbutton 

# vboxmanage guestcontrol "windows server 2012" run  --exe  "%SystemRoot%\system32\shutdown.exe" \ 
  --username Administrator  --password Abcd1234   -- shutdown.exe -s -f -t 0

acpibutton does not always work, but the second one appears to work every time.

 

Leave a Reply