退出homestead,vagrant halt 關閉後無法啓動

昨天下班關vagrant的時候遇到了無法關閉問題,執行vagrant halt之後,控制檯命令一直沒有執行完,在virtualBox中打開查看到homestead狀態爲正在關閉,如下圖:

這個時候,執行vagrant up命令啓動時,發現報了以下錯誤:

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "bb235e59-7f9e-4335-9a82-4191d3c048f3", "--natpf1", "delete", "ssh", "--natpf1", "delete", "tcp27017", "--natpf1", "delete", "tcp33060", "--natpf1", "delete", "tcp4040", "--natpf1", "delete", "tcp44300", "--natpf1", "delete", "tcp54320", "--natpf1", "delete", "tcp8000", "--natpf1", "delete", "tcp8025", "--natpf1", "delete", "tcp8888"]

Stderr: VBoxManage.exe: error: The machine 'homestead-7' is already locked for a session (or being unlocked)
VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at line 527 of file VBoxManageModifyVM.cpp

老實說,這種問題我第一次遇到。首先想到查看vagrant相關進程,發現有幾個進程還在跑,把這幾個進程kill掉,然後在執行vagrant up 命令就可以啓動了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章