我的流浪汉昨晚工作得很好。我刚打开电脑,点击《流浪者》,这就是我得到的:

==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...

有人吃过这个吗?vagrant在网络上还没有被广泛报道,我也找不到发生这种情况的原因。


当前回答

当我杀死腻子过程时,我解决了这个问题。因为我同时运行了git-ssh和putty。他们似乎在争夺ssh访问权。一个就够了。

其他回答

这是流浪者的新“特征”。看看这里: https://github.com/mitchellh/vagrant/issues/3329

他们将把“错误”改为“警告”。它只是告诉你机器还没有启动,它正在尝试连接…

在Homestead.yaml上寻找这条线:

config.vm.network "forwarded_port", guest: 80, host: 8080

并更改为:

config.vm.network "forwarded_port", guest: 80, host: 8000

然后在Homestead目录下运行:

vagrant destroy
vagrant up

看看它是否有效。

如果你在Windows 8或Windows 10上工作,这对我来说很管用:

更改BIOS设置以允许64位虚拟化。 以下是如何做到的: 使用高级启动重启PC(进入高级启动-'立即重启'-'故障排除'-'高级选项'-' UEFI固件设置'-'重新启动') 在BIOS窗口内-转到“高级”菜单/选项卡-启用“英特尔虚拟技术” 保存并退出。

我通过在/etc/fstab中添加一个新条目来测试我的vagrant VM中挂载的文件夹。后来我注销了,跑了个流浪汉,但当我跑了个流浪汉,我得到:

SSH auth method: private key
Warning: Remote connection disconnect. Retrying...

I read all these posts and tried all the ones that seemed relevant for my case (except for vagrant destroy, which would have certainly fixed my problem, but was a last resort in my case). The post by @Kiee gave me the idea to try to boot my VM directly from the VirtualBox GUI. During the boot process the VM halted itself and was asking me if I wanted to skip mounting the test folder that I had added earlier to /etc/fstab. (That's why vagrant couldn't boot the VM.) After answering 'NO' the VM booted no problem. I logged in, removed the naughty line from my fstab, and shutdown the VM.

在那之后,流浪汉就能很好地踢足球了。

外卖吗?如果突然间vagrant无法引导回您的VM,请尝试直接从提供商引导(在我的情况下是VirtualBox)。您的引导可能挂起了与SSH完全无关的东西。

我在使用x64盒子(chef/ubuntu-14.04)时也遇到了同样的问题。

我更改为x32,它工作(hashicorp/precise32)。