我的流浪汉昨晚工作得很好。我刚打开电脑,点击《流浪者》,这就是我得到的:
==> 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在网络上还没有被广泛报道,我也找不到发生这种情况的原因。
我通过在/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完全无关的东西。
我也有同样的问题,但其他答案都不能完全解决我的问题。@Kiee的回答很有帮助,尽管我在GUI中看到的是一个黑屏(在左上角有下划线,虚拟盒子中的这个问题也在堆栈溢出中单独提出,同样没有帮助)。
最终,一个解决方案被证明非常简单:检查虚拟机的版本。
更准确地说,我从别人那里得到了一个64位Debian的盒子,但Virtual box坚持把它当作32位的,这一点我没有注意到。要更改它,请打开虚拟框,然后打开终端并运行
vagrant up
排队等候
default: SSH auth method: private key
现在您可以按ctrl+C(或等待超时)并运行
vagrant halt
你的虚拟机不会被摧毁,所以你可以在虚拟盒子的菜单中看到它,但它会被关闭,所以你可以更改设置。在菜单中选择您的机器,单击“设置”->“通用”,并选择适当的“版本”,对我来说是“Debian(64位)”。这种类型之后又流浪起来。
如果这是你的情况(或“设置”中的不同更改解决了你的问题),你可以从修复的输入中创建新框
vagrant package --output mynew.box
更多细节:主机32位Ubuntu 12.04,客户64位Debian 8.1, Virtual Box 5.0.14, Vagrant 1.8.1