我无法关闭由 Vagrant 启动的 Linux 主机上的 VirtualBox VM:
$ vagrant halt -f my-vm
$ vagrant status
Current machine states:
my-vm stopping (virtualbox)
The VM is stopping.
这似乎卡住了。我尝试使用 VBox 命令关机,但也失败了:
$ VBoxManage list vms
"my-vm-id_my-vm_1516891695543_61345" {cb29c90c-30c7-4798-9bd7-9d8ee32e1530}
$ VBoxManage controlvm cb29c90c-30c7-4798-9bd7-9d8ee32e1530 poweroff
VBoxManage: error: The virtual machine is being powered down
VBoxManage: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component ConsoleWrap, interface IConsole, callee nsISupports
VBoxManage: error: Context: "PowerDown(progress.asOutParam())" at line 231 of file VBoxManageControlVM.cpp
现在最好的停止方法是什么?
答案1
我唯一能做到的就是终止该进程:
ps aux | grep VBox
然后,选择适当的虚拟机进程 pid 并:
kill $pid