2014-12-24 12 views
15

Khi tôi chạy vagrant up, tôi nhận được:mặc định: Cảnh báo: Ngắt kết nối từ xa. Đang thử lại

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

Cảnh báo này sẽ là mãi mãi ..

Những gì tôi đã nhận thấy là nếu tôi bắt đầu VM bằng tay (không lang thang) nó sẽ làm việc mà không có bất kỳ sự chậm trễ nào, nhưng chỉ Nếu tôi bật Bộ điều hợp 2 tại các cài đặt VM như sau: enter image description here Làm cách nào để kích hoạt Bộ điều hợp 2 của VM khi sử dụng vagrant up?

EDIT

Vagrantfile là:

# -*- 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

bạn có thể vui lòng xóa toàn bộ phần 'Vagrant :: Config.run do | config | # config.vm.network: hostonly, "192.168.50.4" kết thúc' và thử lại không? – BMW

+0

Tôi đã thử, nhưng tôi nhận được kết quả tương tự .. – simo

+0

Vì bạn đã kích hoạt GUI, Bạn có thấy bất cứ thứ gì giữ trên Virtualbox không? 'Vagrantfile' của bạn có vẻ ổn với tôi. Tôi khuyên bạn nên 1) thử với hình ảnh khác nhau (ví dụ, 'precision64'). 2) khởi động lại máy của bạn. 3) dọn dẹp môi trường hộp ảo của bạn và thử lại. – BMW

Trả lời

18

Đối với tôi nó bật ra rằng kiên nhẫn là câu trả lời.
Tôi đã nhận được tin nhắn (tôi đã nhận được 12 lần) nhưng tôi đã đợi một vài phút và sau đó nó đã thành công. Khi bạn nói "cảnh báo này sẽ mãi mãi .." Bạn đã chờ bao lâu?

$ 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

Điều này xảy ra một lần nữa và sau khoảng 5 phút, nó đã thành công. –

+0

Tương tự đối với tôi. Phải kiên nhẫn. Tôi hỏi virtualbox để cho tôi thấy một màn hình của vm này, và tôi thấy rằng khởi động chỉ là chậm, và dịch vụ ssh đã không sẵn sàng. – mathieu

+1

Dường như không phải là một giải pháp hoàn chỉnh. – lft93ryt

0

Không thực sự là một giải pháp cho mỗi tiếng nói, nhưng tôi đã thấy rằng khi tôi timed out sau khi nhận được thông điệp ~ 20 lần rằng tôi có thể vagrant halt máy (mà buộc nó như là không có kết nối ssh có thể được thực hiện), chạy vagrant up, nó chỉ làm việc cho tôi cảnh báo hai lần.

Vậy ... tắt và bật lại? Thật ngu ngốc nhưng dường như vẫn hoạt động cho đến khi có một giải pháp thực tế.

Các vấn đề liên quan