2013-11-25 36 views
3

我不明白爲什麼在運行一些配置腳本(我使用ansible)之後,我不能「再次離開」了。vagrant up:config.ssh.timeout

[default] Waiting for machine to boot. This may take a few minutes... 
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.ssh.timeout" value) time period. This can 
mean a number of things. 

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. 

If the box appears to be booting properly, you may want to increase 
the timeout ("config.ssh.timeout") value. 

什麼可以打破?當流浪漢跑起來時,無業遊民想要做什麼? 與默認用戶連接,即「流浪」?

顯然它與SSH有關。 是的,我推了一些SSH密鑰,但我不認爲我改變了流氓用戶,所以「流浪漢」應該仍然正常工作?我也改變了一點點/ etc/sudoers文件,但我試圖不修改它,它似乎並沒有工作,無論如何...

嗯,我用盡想法.. 謝謝。

+0

你能顯示Vagrantfile配置嗎? – Robert

回答

4

我的2美分

  1. 套裝vbox.gui到真正在你Vagrantfile,這將幫助你看看盒子被正確引導。雲在啓動過程中卡住了,然而,流浪者期待從它退出代碼,它超時,你得到你所看到的。

  2. 看到錯誤信息後,運行vagrant ssh,看看你得到了什麼。 注意:您可能需要啓用調試看到更多的信息:VAGRANT_LOG=debug vagrant up

BTW:請確保您的無業遊民(1.3.5)+ VirtualBox的(4.3.2)保持最新狀態。

+0

我也面臨同樣的問題,但它在aws ec2 ubuntu實例,我運行它,所以設置vbox.gui它會爲我工作? –

3

實際上,這可能不是SSH問題。這聽起來像是你的虛擬機掛了,當你vagrant up,這可能是網絡問題的結果,可以通過重啓虛擬機上的網絡來清除。嘗試下面的步驟來解決。

首先,編輯您的Vagrantfile並添加vb.gui = true以在GUI模式下啓動虛擬機。例如,我的測試Vagrantfile樣子:

VAGRANTFILE_API_VERSION = "2" 
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 
    config.vm.box = "testbox" 
    config.vm.network :private_network, ip: "192.168.50.102" 
    config.vm.provider :virtualbox do |vb| 
    vb.gui = true 
    end 
end 

其次,發出vagrant up和你的虛擬機GUI將出現。您的流浪者仍然會掛起,但您應該能夠通過GUI登錄到VM框。

第三,打開一個終端窗口,併發出以下命令:

sudo /etc/init.d/network restart 

這應該解決您的問題。您可以發出vagrant reload來刷新VM。

下面是無業遊民一個參考懸掛問題:https://github.com/mitchellh/vagrant/wiki/%60vagrant-up%60-hangs-at-%22Waiting-for-VM-to-boot.-This-can-take-a-few-minutes%22

(注,我的虛擬機是一個CentOS/VirtualBox的實例)

1

開始在主機不支持虛擬化的64位流浪漢盒以便這個錯誤,如果你在GUI模式下啓動虛擬機,你會看到它。

+0

我也面臨同樣的問題,但它在aws ec2 ubuntu實例上,我正在運行它,所以設置vbox.gui會對我有用嗎? –

0

我正在使用bento/ubuntu-16.04以下步驟解決了我的問題。

  1. 您需要更改以下內容 i。轉到此目錄:cd ~/.vagrant.d/boxes/bento-VAGRANTSLASH-ubuntu-16.04/2.3.1/virtualbox

    ii。打開box.ovf文件使用nano box.ovf

    iii)。 更改<Adapter slot="0" enabled="true" MACAddress="080027C30A85" type="82540EM">

<Adapter slot="0" enabled="true" MACAddress="080027C30A85" cable="true" type="82540EM">

您可能需要重新啓動計算機。重新啓動請按照下列步驟

我。 vagrant halt

ii。 vagrant up

iii。 vagrant ssh