Vagrant 无法使用请求的机器,因为它已被锁定
Vagrant can't use the requested machine because it is locked
我曾尝试访问我在 homestead 上设置的项目站点,它们之前运行良好,我已经几周没有使用它们了,但是今天当我尝试访问它们时我无法打开网站。我尝试 运行 vagrant ssh 但我收到此错误:
VM must be running to open SSH connection. Run `vagrant up`
to start the virtual machine.
当我尝试执行 vagrant up 时,我得到:
Vagrant can't use the requested machine because it is locked! This
means that another Vagrant process is currently reading or modifying
the machine. Please wait for that Vagrant process to end and try
again. Details about the machine are shown below:
Name: default
Provider: virtualbox
当我这样做时:
vagrant status 'idOfTheMachine'
我得到:
vagrant status 'idOfTheMachine'
/Users/myName/Homestead/Vagrantfile:4: warning: already initialized constant VAGRANTFILE_API_VERSION
/Users/myName/Homestead/Vagrantfile:4: warning: previous definition of VAGRANTFILE_API_VERSION was here
Current machine states:
default poweroff (virtualbox)
The VM is powered off. To restart the VM, simply run `vagrant up`
当我打开 virtualbox 并尝试查看共享文件夹时,我可以在终端中看到共享文件夹,但看不到其中的项目。我已经用谷歌搜索了这个问题,但找不到任何解决方案。我是否应该销毁虚拟机上的宅基地机器并制作一台新机器,如果是,如何正确制作,以便我在新机器上拥有相同的项目?
我也有这个问题,虽然我不明白 how/why 它确实发生了,但我确实发现 运行
vagrant reload {boxid}
通常会打开盒子并允许我连接到它。
当您完成编码以释放资源并期望能够使用 'vagrant up' 毫不费力地重新打开它时,您可能像我和 'vagrant halt' 您的盒子一样,但是它似乎并非如此。希望这能让你重新站起来,其他知道发生了什么的人可以解释为什么会这样。
刚刚在这个问题上浪费了一个小时。我的最终解决方案:
- 从 Virtualbox 中删除机器
- 删除包含您的 Vagrantfile 的目录中的
.vagrant
文件夹(如果存在)
- 如果您仍然遇到错误(和我一样),运行
vagrant global-status
检查任何仍可识别的机器
- 如果机器仍然在列表中,运行
vagrant global-status --prune
将其删除
vagrant up
应该又可以工作了
在 MacOSX 上,我转到 Activity 监视器并终止了 运行 的流浪进程。这为我解决了。
在 Windows,我终止了我的 Ruby 进程,然后能够成功 运行 'vagrant halt' 然后 'vagrant up'。
我曾尝试访问我在 homestead 上设置的项目站点,它们之前运行良好,我已经几周没有使用它们了,但是今天当我尝试访问它们时我无法打开网站。我尝试 运行 vagrant ssh 但我收到此错误:
VM must be running to open SSH connection. Run `vagrant up`
to start the virtual machine.
当我尝试执行 vagrant up 时,我得到:
Vagrant can't use the requested machine because it is locked! This
means that another Vagrant process is currently reading or modifying
the machine. Please wait for that Vagrant process to end and try
again. Details about the machine are shown below:
Name: default
Provider: virtualbox
当我这样做时:
vagrant status 'idOfTheMachine'
我得到:
vagrant status 'idOfTheMachine'
/Users/myName/Homestead/Vagrantfile:4: warning: already initialized constant VAGRANTFILE_API_VERSION
/Users/myName/Homestead/Vagrantfile:4: warning: previous definition of VAGRANTFILE_API_VERSION was here
Current machine states:
default poweroff (virtualbox)
The VM is powered off. To restart the VM, simply run `vagrant up`
当我打开 virtualbox 并尝试查看共享文件夹时,我可以在终端中看到共享文件夹,但看不到其中的项目。我已经用谷歌搜索了这个问题,但找不到任何解决方案。我是否应该销毁虚拟机上的宅基地机器并制作一台新机器,如果是,如何正确制作,以便我在新机器上拥有相同的项目?
我也有这个问题,虽然我不明白 how/why 它确实发生了,但我确实发现 运行
vagrant reload {boxid}
通常会打开盒子并允许我连接到它。
当您完成编码以释放资源并期望能够使用 'vagrant up' 毫不费力地重新打开它时,您可能像我和 'vagrant halt' 您的盒子一样,但是它似乎并非如此。希望这能让你重新站起来,其他知道发生了什么的人可以解释为什么会这样。
刚刚在这个问题上浪费了一个小时。我的最终解决方案:
- 从 Virtualbox 中删除机器
- 删除包含您的 Vagrantfile 的目录中的
.vagrant
文件夹(如果存在) - 如果您仍然遇到错误(和我一样),运行
vagrant global-status
检查任何仍可识别的机器 - 如果机器仍然在列表中,运行
vagrant global-status --prune
将其删除 vagrant up
应该又可以工作了
在 MacOSX 上,我转到 Activity 监视器并终止了 运行 的流浪进程。这为我解决了。
在 Windows,我终止了我的 Ruby 进程,然后能够成功 运行 'vagrant halt' 然后 'vagrant up'。