Page 1 of 1

VboxManage reliability?

Posted: 4. Dec 2021, 10:55
by DJ32678
How reliable have people found this CLI to be?

We have Windows 10 as the guest OS and Windows Server 2016 as the host OS. We want to programmatically shut down and restart the headless VM under certain conditions. Sending controlvm "VM name" acpipowerbutton or poweroff command in a process / command window sometimes appears to be ignored. Sending it by hand from a command window (as the user who started the VM of course) is not always acted on so it's not the program code per se.

Currently on build .28

Re: VboxManage reliability?

Posted: 4. Dec 2021, 15:45
by scottgus1
Unless a bug has crept in, vboxmanage has been extremely reliable.

I also have faced the "not respond to 'acpipowerbutton' issue" in script-controlled VMs. It has always been, in my experience, a failure of the VM OS to respond to the acpi power button signal. I had to program around it by sending key strokes tuned to the OS to initiate an alternate 'shut down' system within the OS.

For example I had a SBS 2003 VM that occasionally ignored or did not notice the acpi power button signal. I found that by sending Ctrl-Alt-Del on the keyboard that the OS could then have its attention brought to bear on the vboxmanage command. So I added some 'controlVM keyboardputscancode' commands as below:
rem com-line parameters: %1 vm name %2 vm uuid %3 vm kill time
eventcreate /t information /id 1 /l application /so vmbackup.cmd /d "%1 shutdown initiated" > nul
echo sending shutdown keys
rem Ctrl-Alt-Del
"C:\Program Files\Oracle\VirtualBox\vboxmanage" controlvm %1 keyboardputscancode 1d 38 53 b8 9d
sleep -m 500
rem Ctrl-Alt-Del
"C:\Program Files\Oracle\VirtualBox\vboxmanage" controlvm %1 keyboardputscancode 1d 38 53 b8 9d
sleep -m 500
rem Ctrl-Alt-Del
"C:\Program Files\Oracle\VirtualBox\vboxmanage" controlvm %1 keyboardputscancode 1d 38 53 b8 9d
sleep -m 500
"C:\Program Files\Oracle\VirtualBox\vboxmanage" controlvm %1 acpipowerbutton
sleep -m 500
rem Enter, in case of "someone else logged in" popup
"C:\Program Files\Oracle\VirtualBox\vboxmanage" controlvm %1 keyboardputscancode 1c 9c
Basically 3 Ctrl-Alt-Del's then the acpi power button then an Enter in case the OS complained. You'd have to figure out a procedure that would work for your OS that is ignoring or not noticing the acpi power button.

Re: VboxManage reliability?

Posted: 4. Dec 2021, 20:02
by DJ32678
"It has always been, in my experience, a failure of the VM OS to respond to the acpi power button signal."

Hi. I hadn't really thought of it from that angle but it's certainly worth a try to 'encourage' the VM to listen. Thanks.

Re: VboxManage reliability?

Posted: 7. Dec 2021, 18:11
by DJ32678
Well, this solution worked for me! Thanks. Much relief here.

Re: VboxManage reliability?

Posted: 7. Dec 2021, 18:44
by scottgus1
Great! Glad you're up and running.