當我運行vagrant up
,我得到:默認值:警告:遠程連接斷開。重試
D:\GitHub\website\rails-dev-box>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty32' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 3000 => 1234 (adapter 1)
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: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
該警告將永遠..
我已經注意到的是,如果我手動啓動虛擬機(無流浪者),將工作沒有任何延遲,但只有如果我啓用適配器2在虛擬機設置是這樣的: 如何使用vagrant up
時啓用VM的適配器2?
編輯
Vagrantfile
是:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# config.vm.network :hostonly, "192.168.50.4"
end
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/trusty32'
config.vm.hostname = 'rails-dev-box'
# config.vm.synced_folder ".", "/vagrant/web" #, type: "nfs"
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
config.vm.boot_timeout = 120
# config.winnfsd.uid = 1
# config.winnfsd.gid = 1
config.vm.network :forwarded_port, guest: 3000, host: 1234
config.vm.provision :shell, path: 'bootstrap.sh', keep_color: true
end
能否請您刪除'Vagrant :: Config.run do | config |#config.vm.network:hostonly的整個部分,「192.168.50.4」 end'並重試? – BMW
我試過了,但是得到了同樣的結果。 – simo
既然你激活了GUI,你是否看到Virtualbox上有什麼東西存在?你的'Vagrantfile'對我來說看起來很好。我建議1)嘗試不同的圖像(例如'precise64')。 2)重新啓動你的機器。 3)清理你的虛擬環境並重試。 – BMW