没有不值得去解决的问题,也没有不值得去学习的技术!

执行:vagrant up 时报错:The name of your virtual machine couldn’t be set because VirtualBox is reporting another VM with that name already exists.

执行:vagrant up 时报错:The name of your virtual machine couldn't be set because VirtualBox is reporting another VM with that name already exists.

1、执行:vagrant up 时报错:The name of your virtual machine couldn’t be set because VirtualBox
is reporting another VM with that name already exists.。如图1

执行:vagrant up 时报错:The name of your virtual machine couldn't be set because VirtualBox is reporting another VM with that name already exists.
图1
Plaintext

Lenovo@DESKTOP-QLPK8QM MINGW64 ~/Homestead (v12.1.0)
$ vagrant up
Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: Importing base box 'lc/homestead'...
==> homestead: Matching MAC address for NAT networking...
==> homestead: Checking if box 'lc/homestead' version '11.0.0' is up to date...
==> homestead: Setting the name of the VM: homestead
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\Lenovo\VirtualBox VMs\lt-settler_default_1614481073061_45587_1661751471272_95685' to 'C:\Users\Lenovo\VirtualBox VMs\homestead' 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 3265 of file VBoxManageModifyVM.cpp


2、删除 vagrant 后,再打开 VirtualBox GUI,确认是否存在,如果存在,再手动删除掉虚拟机。如图2

删除 vagrant 后,再打开 VirtualBox GUI,确认是否存在,如果存在,再手动删除掉虚拟机
图2
Plaintext

Lenovo@DESKTOP-QLPK8QM MINGW64 ~/Homestead (v12.1.0)
$ vagrant destroy
    homestead: Are you sure you want to destroy the 'homestead' VM? [y/N] y
==> homestead: Destroying VM and associated drives...



3、基于提示,删除掉目录:C:\Users\Lenovo\VirtualBox VMs\homestead。如图3

基于提示,删除掉目录:C:\Users\Lenovo\VirtualBox VMs\homestead
图3

4、再次执行:vagrant up。不再报错。如图4

再次执行:vagrant up。不再报错
图4
Plaintext

Lenovo@DESKTOP-QLPK8QM MINGW64 ~/Homestead (v12.1.0)
$ vagrant up
Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: Checking if box 'lc/homestead' version '11.0.0' is up to date...
==> homestead: Running provisioner: file...
Guest-specific operations were attempted on a machine that is not
ready for guest communication. This should not happen and a bug
should be reported.


关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系