最近我开始使用Virtualbox、Vagrant和VVV作为我的本地WordPress开发环境。这非常流畅。
但是我遇到的一个问题是,在使用“vagrant halt”关闭后,下一次使用“vagrant up”时会出现以下错误:
==> default: Setting the name of the VM: vagrant-local
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:\VirtualBox VMs\ubuntu-cloudimg-trusty-va
230_94704' to 'C:\VirtualBox VMs\vagrant-local' to save the settings file (VERR_ALREADY_EXISTS)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component SessionMachine, interface IMac
VBoxManage.exe: error: Context: "SaveSettings()" at line 3015 of file VBoxManageModifyVM.cpp
我访问了位于C:\VirtualBox VMs\的位置,确实发现那个目录 'vagrant-local' 已经存在。如果我删除(或重命名)这个目录并再次运行 'vagrant up',虚拟机就会启动。但是,它还会执行完整的配置过程。当然,这需要很长时间。
我正在使用VVV和Vagrant的所有默认配置。我该怎么做才能帮助VirtualBox“正确清理”并认识到它不需要在每次停止和重新启动时重新创建虚拟机。
或者,我只是忽略了什么?如果可以,请提供“初学者级别”的响应。我在这个领域是初学者,非常感谢您的帮助!谢谢。
当前状态:我已从C:\VirtualBox VMs\中删除了有关虚拟机的信息;以管理员身份运行Git Bash,我已能够使用 vagrant up
(进行完整的配置过程),vagrant halt
和vagrant up
,都得到了预期的结果(第二个up
没有进行配置)。目前为止,一切似乎都正常。看起来... :)
vagrant up
,vagrant halt
和再次使用vagrant up
,所有结果都符合预期。目前看来,一切都正常。看起来... :) 我会接受您的答案并考虑它已经关闭,但我缺少声望。 - ensminger