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

==> 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在网络上还没有被广泛报道,我也找不到发生这种情况的原因。


当前回答

我对这个问题的解决方案是,我的旧笔记本电脑启动时间太长了。我打开虚拟盒子,连接到盒子,等待屏幕加载。花了大约8分钟。

然后它连接并安装了我的文件夹,继续运行。

有时候要有耐心!

其他回答

我的运行正常,然后这个“警告:远程连接断开。一遍又一遍——大概20遍——直到连接上。基于以上的答案,我只是

vagrant destroy
vagrant up

一切都很好。我的很简单,但我把Vagrantfile压缩到config.vm.box = "ubuntu/trusty64",它还在运行。这就是为什么毁灭然后重新开始似乎是最好的选择。鉴于这些流浪汉图像的无国籍性质,我不明白为什么在每个情况下都不会奏效。我刚刚开始研究这个问题,我可能会发现这不是真的。

在我从Vagrantfile中删除这一行后,我也遇到了同样的问题:

config.vm.network "private_network", type: "dhcp"

我把这行放回去后,VM加载正常。

我通过在/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完全无关的东西。

对我来说,这是流浪者和虚拟盒子之间的兼容性。

我在windows 10上,我所做的就是卸载流浪者和虚拟盒子

然后安装一个旧版本的虚拟盒子,特别是4.3.38版本(也为这个版本安装扩展包)

然后安装最新版本的vagrant(目前1.8.5)

从那以后,它起作用了。

我在VirtualBox中运行vagrant/VirtualBox时得到了这个。我通过在主机上运行流浪机器来解决这个问题。