Today I shutdown a VM using vagrant command vagrant halt
, it's stuck in "stopping" status, and when I use VBoxManage controlvm <vm-name> poweroff
to shutdown it, it raise an error:
VBoxManage: error: The virtual machine is being powered down
VBoxManage: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component Console, interface IConsole, callee nsISupports
VBoxManage: error: Context: "PowerDown(progress.asOutParam())" at line 224 of file VBoxManageControlVM.cpp
So the only solution is kill the VM process:
$ ps -ef|grep VBox
And a process named "/opt/VirtualBox/VBoxHeadless --comment ... --startvm ..." is the target (identified by the comment). Kill it then.