【发布时间】:2015-11-25 15:58:39
【问题描述】:
我最近开始在本地 Wordpress 开发环境中使用 Virtualbox、Vagrant 和 VVV。它非常光滑。
我遇到的一个问题是,在使用 '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 “正确清理”并认识到它不需要在每次停止和重新启动时重新创建 VM。
或者,我只是错过了什么吗?
如果不是首选,欢迎回复“初学者级别”。我是这方面的初学者,感谢您的帮助!谢谢。
当前状态:我已从 C:\VirtualBox VMs\ 中删除了有问题的 VM;以管理员身份运行 Git Bash,我已经能够再次使用 vagrant up(完全配置)、vagrant halt 和 vagrant up,所有这些都获得了预期的结果(第二个 up 没有配置)。截至目前,似乎一切正常。出现... :)
【问题讨论】:
-
任何 vm 都发生同样的情况吗?您是否尝试从 vagrant 创建一个新的虚拟机并出现相同的错误?我不是 Windows 专家,但错误可能是权限问题,您可以尝试使用管理员权限运行 vagrant
-
是的。机器上的所有虚拟机都存在此问题。我一直以管理员身份运行命令行,结果相同。 “以管理员身份运行”是 vagrant 中的某个设置,还是足够了?
-
有点奇怪,以管理员身份运行 cli 应该没问题。在你运行
vagrant up之后是vagrant status给你VM 的状态吗?你能再发一次vagrant suspend和vagrant up还是同样的消息? -
我可以查看状态。我发现了一些见解on this thread,因为我在同一工作站上也遇到了 OP 所描述的问题。如果这是一个权限问题,我应该检查任何特定的权限设置吗? IE。我的权限应该是什么?涉及哪些目录?
-
windows上运行,管理员运行应该没问题
标签: wordpress vagrant virtual-machine web-development-server