2015-10-20 48 views
0

自从升级到El Cap以来,我一直与Vagrant/Vaprobash有关。这发生在两个不同的mac上,并且两个都已经升级了最新的Vagrant和VirtualBox版本。埃尔卡皮坦的流浪/瓦巴拉什问题

虚拟机确实使用上手vagrant up(至少,如果你看一下它的运行,即使您无法连接到它的VirtualBox管理的框),但启动超时持续期间:

Bringing machine 'Vaprobash' up with 'virtualbox' provider... 
==> Vaprobash: Checking if box 'ubuntu/trusty64' is up to date... 
==> Vaprobash: Clearing any previously set forwarded ports... 
==> Vaprobash: Clearing any previously set network interfaces... 
==> Vaprobash: Preparing network interfaces based on configuration... 
    Vaprobash: Adapter 1: nat 
    Vaprobash: Adapter 2: hostonly 
==> Vaprobash: Forwarding ports... 
    Vaprobash: 22 => 2222 (adapter 1) 
==> Vaprobash: Running 'pre-boot' VM customizations... 
==> Vaprobash: Booting VM... 
==> Vaprobash: Waiting for machine to boot. This may take a few minutes... 
    Vaprobash: SSH address: 127.0.0.1:2222 
    Vaprobash: SSH username: vagrant 
    Vaprobash: SSH auth method: private key 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
    Vaprobash: Warning: Connection timeout. Retrying... 
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. 

当箱子终于“运行”时,我无法连接到它。如果我使用VirtualBox打开终端,则连接超时似乎是虚拟机正在等待输入登录屏幕的提示。但是,这个登录应该由Vagrant处理。

有关如何解决此问题的任何想法?

回答

1

经过多次撕裂头发和磨牙后,重新安装Vagrant,VirtualBox和删除/安装我的所有箱子图像几次,我终于能够通过完全清除所有流浪数据(rm -rf ~/.vagrant.d/),卸载流浪汉应用程序(rm -rf /usr/bin/vagrant),然后安装新鲜的流浪应用程序。

然后我执行了vagrant up,它重新生成了所有的密钥,这似乎终于实现了。我已经手动删除并重新生成了密钥,并且在.vagrant.d的文件中复制了我自己的id_rsa,但没有运气 - 重新安装vagrant而未先删除所有数据都无法解决问题。

希望这可以帮助别人。

0

是你的流浪者档案有vb.gui = true?如果不是,则添加像:

config.vm.provider :virtualbox do |vb| 
    vb.gui = true 
end 

如果这是好的,那么它可能是与您的SSH密钥的问题。 你可以尝试以下步骤:

here下载私人密钥,并尝试登录流浪箱。

ssh -i privatekey [email protected] 

here

下载私钥和存储的地方,并在流浪的文件中加入下面一行:

config.ssh.private_key_path="full_path_of_ssh_privatekey" 

然后尝试使用命令登录:

vagrant ssh vmname 

或 它可能是你的流浪者公共钥匙不存储在迷路中nt vm。这样你就可以创建shell脚本test.shtest.sh文件

mkdir /home/vagrant/.ssh 
wget --no-check-certificate -O authorized_keys 'https://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' 
mv authorized_keys /home/vagrant/.ssh 
chown -R vagrant /home/vagrant/.ssh 
chmod -R go-rwsx /home/vagrant/.ssh 

添加以下行和使用shell供应方在Vagrantfile这样的:

config.vm.provision :shell, :path => "test.sh" 

则规定,VM要么

vagrant reload vmname --provision 

,或者你可以使用命令重新创建vm

vagrant destroy vmname 
vagrant up vmname 
+0

@ pl_rock--谢谢,但重点是流浪者应该可以自己登录 - 我从来不需要过去的GUI来登录。 – user101289

+0

我也遇到过很多次相同的问题,但它显示当我的密钥不在正确的位置。 –

+0

有关修复ssh密钥问题的任何建议? – user101289

相关问题