简体   繁体   English

Vagrant Windows vagrant 上的 10 个“挂起”

[英]Vagrant Windows 10 'hangs" on vagrant up

I've been having a problem with Vagrant (1.8.1, using VirtualBox 5.0.20) on Windows 10.我在 Windows 10 上遇到 Vagrant(1.8.1,使用 VirtualBox 5.0.20)的问题。

When I follow the getting started tutorial https://www.vagrantup.com/docs/getting-started/ after I have typed vagrant up , my console is stuck on:当我按照入门教程https://www.vagrantup.com/docs/getting-started/输入vagrant up ,我的控制台卡在了:

==> 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

It does not continue, i can see the VM boot inside of VirtualBox, and i can use the VirtualBox GUI to log in with the default credentials, so the VM itself is working.它不会继续,我可以看到虚拟机在 VirtualBox 内部启动,并且我可以使用 VirtualBox GUI 使用默认凭据登录,因此虚拟机本身正在运行。

According to https://www.vagrantup.com/docs/virtualbox/common-issues.html I should run VirtualBox as admin and do vagrant up from a cmd.exe with admin rights, but when i do that i get the message:根据https://www.vagrantup.com/docs/virtualbox/common-issues.html ,我应该以管理员身份运行 VirtualBox,并从具有管理员权限的 cmd.exe 执行 vagrant,但是当我这样做时,我收到消息:

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

This seems different from the 100's of posts all around the.net like these: https://github.com/Varying-Vagrant-Vagrants/VVV/issues/375 since I am not getting antying after the output listed above, it just sits there and after alike 10 minutes it comes up with the message:这似乎与 .net 上的 100 篇帖子不同,例如: https://github.com/Varying-Vagrant-Vagrants/VVV/issues/375因为在上面列出的 output 之后我没有反感,它只是坐着在那里,大约 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.

I've also read Vagrant stuck in "Waiting for VM to Boot" but it did not help me.我还读过Vagrant 卡在“等待 VM 启动”中,但它对我没有帮助。

Is there anything else I am missing here?我还有什么想念的吗?

In my case, vagrant up was hanging on 'Syncing VM folder' , on Windows 7 with Vagrant 1.9.3 and VBox 5.1.18 .就我而言,vagrant up 挂在 'Syncing VM folder' 上,在 Windows 7 上使用 Vagrant 1.9.3 和 VBox 5.1.18 。 It turned out that it requires Powershell >= 3.0.原来它需要Powershell >= 3.0。 I downloaded it from https://www.google.ca/search?q=powershell+3.0+download&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=x0fdWLfsBubQXu2OorAD , and worked fine afterwards.我从https://www.google.ca/search?q=powershell+3.0+download&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=x0fdWLfsBubQXu2OorAD下载了它,之后工作正常。

try to turn off the VM from VirtualBox or from command line尝试从 VirtualBox 或命令行关闭 VM

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

then restart the VM from vagrant.然后从 vagrant 重新启动 VM。 In case you get an error when powering off the VM, force the shutdown如果在关闭 VM 时出现错误,请强制关闭

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

Then vagrant up will should work nicely然后vagrant up will 应该可以很好地工作

I actually already found my problem.我实际上已经发现了我的问题。 It was a .dll from some addware scanner that was preventing the virtualbox VM from starting.它是来自某个附加软件扫描程序的 .dll,它阻止了 virtualbox 虚拟机启动。 I lost the link to the forum topic which helped me solve this unfortunately.不幸的是,我丢失了论坛主题的链接,这帮助我解决了这个问题。

What i did was open the logs from the VM in VirtualBox and had a read trough.我所做的是从 VirtualBox 中的 VM 打开日志并进行读取。 At some point, a line indicating an error appeared with a .dll name which was the culprit.在某些时候,出现了一条指示错误的行,其中包含 .dll 名称,这是罪魁祸首。 I deleted the offending .dll files from my pc and it was fixed.我从我的电脑中删除了有问题的 .dll 文件并修复了它。

If i find the link again to the topic explaining exactly what dll it was i will post it here.如果我再次找到该主题的链接,该链接确切地解释了它是什么 dll,我会将其发布在这里。 Im not at the machine that i fixed the problem on now so i can't access my search history.我不在我现在解决问题的机器上,所以我无法访问我的搜索历史。

Hope it will work for you as it worked for me I'm still investigating why, but as a solution it works.希望它对你有用,因为它对我有用,我仍在调查原因,但作为一个解决方案,它是有效的。

our case - when typed in cmd (inside vagrand image directory) "vagrant up" it open virtual box vm and stuck on "default: SSH auth method: private key" as mentioned in question我们的案例 - 当输入 cmd(在 vagrand 图像目录内)“vagrant up”时,它会打开虚拟框 vm 并停留在“默认值:SSH 身份验证方法:私钥”,如问题所述

so fix by this steps:所以通过以下步骤修复:

  1. open manually virtual box (besides what already opened by vagrant up)手动打开虚拟框(除了vagrant已经打开的)
  2. run the vm that had added to the list (by vagrant up)运行已添加到列表中的虚拟机(按 vagrant 向上)
  3. open CMD打开 CMD
  4. type "Vagrant ssh"输入“Vagrant ssh”

and it will work它会起作用

hope it helped, best regards希望它有所帮助,最好的问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM