2014-12-24 21 views
15

Quando eseguo vagrant up, ottengo:predefinito: Avviso: connessione remota disconnessione. Nuovo tentativo

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... 

Questo avviso sarà per sempre ..

Quello che ho notato è che se ho iniziato la VM manualmente (senza vagabondo) che funzionerà senza alcun ritardo, ma solo se ho abilitato l'adattatore 2 alle impostazioni VM come questo: enter image description here Come posso abilitare l'adattatore 2 della VM quando si utilizza vagrant up?

EDIT

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 
+0

è possibile rimuovere tutta la parte di 'Vagrant :: Config.run do | config | # config.vm.network: hostonly" 192.168.50.4 " fine' e riprovare? – BMW

+0

Ho provato, ma ho ottenuto lo stesso risultato .. – simo

+0

Da quando hai attivato la GUI, vedi qualcosa su Virtualbox? Il tuo 'Vagrantfile' sembra a posto per me. Raccomando 1) provare con un'immagine diversa (ad esempio, 'preciso64'). 2) riavviare la macchina. 3) pulire l'ambiente della virtualbox e riprovare. – BMW

risposta

18

Per me si è scoperto che la pazienza è stata la risposta.
Stavo ricevendo il messaggio (l'ho preso 12 volte) ma ho aspettato un paio di minuti e poi ci sono riuscito. Quando dici "questo avviso sarà per sempre .." Quanto tempo hai aspettato?

$ vagrant up 
Bringing machine 'default' up with 'virtualbox' provider... 
==> default: Checking if box 'phusion/ubuntu-14.04-amd64' 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: Adapter 2: hostonly 
    default: Adapter 3: hostonly 
    default: Adapter 4: hostonly 
==> default: Forwarding ports... 
    default: 3000 => 3334 (adapter 1) 
    default: 1080 => 1082 (adapter 1) 
    default: 22 => 2222 (adapter 1) 
==> default: Running 'pre-boot' VM customizations... 
==> 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... 
    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: Machine booted and ready! 
==> default: Checking for guest additions in VM... 
==> default: Configuring and enabling network interfaces... 
==> default: Exporting NFS shared folders... 
==> default: Preparing to edit /etc/exports. Administrator privileges will be required... 
Password: 
==> default: Mounting NFS shared folders... 
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision` 
==> default: to force provisioning. Provisioners marked to run always will still run. 
==> default: Running provisioner: shell... 
    default: Running: inline script 
==> default: stdin: is not a tty 
==> default: stop: Unknown instance: 
==> default: mongod start/running, process 8424 
+0

Questo è successo di nuovo e dopo circa 5 minuti è riuscito. –

+0

Lo stesso per me. Doveva essere paziente. Ho chiesto a virtualbox di mostrarmi uno schermo di questo vm, e ho visto che il boot era solo lento e il servizio ssh non era pronto. – mathieu

+1

Non sembra una soluzione completa. – lft93ryt

0
Non

davvero una soluzione per-dire, ma ho scoperto che quando ho cronometrato fuori dopo aver ricevuto quel messaggio ~ 20 volte che ho potuto vagrant halt la macchina (che lo obbliga in quanto non v'è alcuna connessione ssh che può essere fatto), correva vagrant up, ha funzionato solo dandomi l'avvertimento due volte.

Quindi ... spegnerlo e riaccenderlo? Così stupido, ma sembra funzionare fino a quando non c'è una soluzione reale.

Problemi correlati