【问题标题】:Vagrant Windows 10 'hangs" on vagrant upVagrant Windows 10 在 vagrant up 上“挂起”
【发布时间】:2020-10-22 18:40:38
【问题描述】:

我在 Windows 10 上遇到了 Vagrant(1.8.1,使用 VirtualBox 5.0.20)的问题。

当我在输入vagrant up 后按照入门教程https://www.vagrantup.com/docs/getting-started/ 操作时,我的控制台卡在了:

==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key

它没有继续,我可以在 VirtualBox 中看到 VM 启动,并且我可以使用 VirtualBox GUI 使用默认凭据登录,因此 VM 本身正在运行。

根据https://www.vagrantup.com/docs/virtualbox/common-issues.html 我应该以管理员身份运行 VirtualBox,并从具有管理员权限的 cmd.exe 执行 vagrant up,但是当我这样做时,我会收到消息:

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["modifyvm", "1b9d4f9b-04d8-48bf-8d16-d3aed99d341b", "--natpf1", "delete", "ssh"]
Stderr: VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available)
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at line 493 of file VBoxManageModifyVM.cpp

这似乎与网络上的 100 条帖子不同,如下所示: https://github.com/Varying-Vagrant-Vagrants/VVV/issues/375 因为在上面列出的输出之后我没有得到任何东西,它只是坐在那里,大约 10 分钟后它会出现以下消息:

Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

我也读过Vagrant stuck in "Waiting for VM to Boot",但对我没有帮助。

我还有什么遗漏的吗?

【问题讨论】:

    标签: windows vagrant


    【解决方案1】:

    就我而言,vagrant up 挂在 'Syncing VM folder' 上,在 Windows 7 上使用 Vagrant 1.9.3 和 VBox 5.1.18 。原来它需要 Powershell >= 3.0。 我从https://www.google.ca/search?q=powershell+3.0+download&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=x0fdWLfsBubQXu2OorAD 下载了它,之后运行良好。

    【讨论】:

      【解决方案2】:

      尝试从 VirtualBox 或命令行关闭虚拟机

      C:\Progra~1\Oracle\VirtualBox\VBoxManage.exe controlvm default poweroff
      

      然后从 vagrant 重新启动 VM。 如果关闭虚拟机时出现错误,请强制关闭

      C:\Progra~1\Oracle\VirtualBox\VBoxManage.exe startvm default --type emergencystop
      

      那么vagrant up 应该可以正常工作

      【讨论】:

      • 我已经解决了我的问题(见答案)。在这种情况下,您的建议不会有帮助。
      【解决方案3】:

      我实际上已经发现了我的问题。这是一个来自某些插件扫描程序的 .dll,它阻止了 virtualbox VM 的启动。不幸的是,我丢失了帮助我解决此问题的论坛主题的链接。

      我所做的是在 VirtualBox 中打开来自 VM 的日志并进行读取。在某些时候,出现了一条指示错误的行,其中的 .dll 名称是罪魁祸首。我从我的电脑中删除了有问题的 .dll 文件并修复了它。

      如果我再次找到该主题的链接,准确解释它是什么 dll,我将在此处发布。我现在不在我解决问题的机器上,所以我无法访问我的搜索历史。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-11-17
        • 2023-03-15
        • 1970-01-01
        • 1970-01-01
        • 2019-02-08
        • 2016-11-12
        • 1970-01-01
        • 2016-01-01
        相关资源
        最近更新 更多