Homestead 发现报错 Vagrant box update

2020 年 3 月 1 日上午 8:54 分,经过半个月的奋战终于完成了,我自己的 laravel 项目,睡一觉起来重新启动 homestead 发现报错:

$ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' version '8.0.0' is up to date...
==> homestead-7: A newer version of the box 'laravel/homestead' for provider 'virtualbox' is
==> homestead-7: available! You currently have version '8.0.0'. The latest is version
==> homestead-7: '9.2.0'. Run `vagrant box update` to update.
Your VM has become "inaccessible." Unfortunately, this is a critical error
with VirtualBox that Vagrant can not cleanly recover from. Please open VirtualBox
and clear out your inaccessible virtual machines or find a way to fix
them.

瞬间懵逼这是怎么回事,自己一看是我的 homestead 当前版本是 8.0,提示信息是目前最新版本为 9.2,需要更新一下。于是按照提示我执行了更新命令:vagrant box update
等待一小时后重新启动 homestead 后仍然报错

$ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' version '8.0.0' is up to date...
Your VM has become "inaccessible." Unfortunately, this is a critical error
with VirtualBox that Vagrant can not cleanly recover from. Please open VirtualBox
and clear out your inaccessible virtual machines or find a way to fix
them.

按照提示我将 Oracle VM VirtualBox 中的虚拟机删除了重新启动仍按报错,提示如下:

$ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Importing base box 'laravel/homestead'...
==> homestead-7: Matching MAC address for NAT networking...
==> homestead-7: Checking if box 'laravel/homestead' version '8.0.0' is up to date...
==> homestead-7: Setting the name of the VM: homestead-7
The name of your virtual machine couldn't be set because VirtualBox
is reporting another VM with that name already exists. Most of the
time, this is because of an error with VirtualBox not cleaning up
properly. To fix this, verify that no VMs with that name do exist
(by opening the VirtualBox GUI). If they don't, then look at the
folder in the error message from VirtualBox below and remove it
if there isn't any information you need in there.
VirtualBox error:
VBoxManage.exe: error: Could not rename the directory 'C:\Users\18222\VirtualBox VMs\ubuntu-18.04-amd64_1583029545525_98719' to 'C:\Users\18222\VirtualBox VMs\homestead-7' to save the settings file (VERR_ALREADY_EXISTS)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component SessionMachine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "SaveSettings()" at line 3194 of file VBoxManageModifyVM.cpp

继续查看提示说明我们的虚拟文件没有删除干净还有残余,并按照提示的信息,在电脑用户中找到了我的 homestead 安装根目录,在根目录中找到了虚拟机存储文件文件夹 VirtualBox VMs 在里面将所有的虚拟机文件就 OK 了,因为是删除了所有文件所以数据库也被删除了。

本作品采用《CC 协议》,转载必须注明作者和本文链接
十里长亭
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。