退出homestead,vagrant halt 关闭后无法启动

本文分享了一次Vagrant与VirtualBox同步失败的解决经验。作者在尝试关闭Vagrant时遇到问题,导致无法正常启动。通过查找并结束相关进程,最终成功解决了同步问题,恢复正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

昨天下班关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 命令就可以启动了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值