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

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


当前回答

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

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

其他回答

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

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

对我有帮助的是在BIOS中启用虚拟化,因为机器无法启动。

SSH连接在初始启动时超时可能与多种原因有关,例如:

check whether virtualization is enabled in BIOS (as per comment), system awaits for user interaction (e.g. share partition is not ready), mismatch of your private key (check the config via vagrant ssh-config), the booting process takes much longer time (try increasing config.vm.boot_timeout), it's booting from the wrong drive (e.g. from the installer ISO), VM firewall misconfiguration (e.g. iptables configuration), local firewall rules, port conflict or conflict with a VPN software, sshd misconfiguration.

要调试问题,请运行——debug选项或如下:

VAGRANT_LOG=debug vagrant up

如果没有什么明显的,那么尝试从另一个终端连接到它,通过vagrant ssh或通过:

vagrant ssh-config > vagrant-ssh; ssh -F vagrant-ssh default

如果SSH仍然失败,尝试使用GUI(例如config. exe)运行它。GUI = true)。

如果不是,检查正在运行的进程(例如:vagrant ssh -c ' pstrree -a')或验证您的sshd_config。


如果它是一次性的虚拟机,你总是可以尝试破坏它,并重新启动它。

你也应该考虑升级你的Vagrant和Virtualbox。


有关详细信息,请检查调试和故障排除页面。

也许这是一个太简单的答案,以帮助许多人,但值得一试,如果你没有:做一个“流浪者暂停”,而不是“流浪者暂停”,然后重新启动VM与“流浪者up”。

我认为我的问题是由于一些“kworker”进程出现bug,并且在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完全无关的东西。