2015-03-25 92 views
1

在爲新項目安裝vagrant時出現錯誤。它發生在大約60%的virtualbox.box被下載時。Vagrant up - 讀取錯誤

我該如何糾正它?

我使用Ubuntu 14.04,流浪1.7.2,VirtualBox虛擬4.3.26

任何幫助是極大的讚賞。

enter image description here

回答

1

我似乎無法重現你的錯誤:

$ vagrant init migosm/debian-7.6-kernel-3.16 
A `Vagrantfile` has been placed in this directory. You are now 
ready to `vagrant up` your first virtual environment! Please read 
the comments in the Vagrantfile as well as documentation on 
`vagrantup.com` for more information on using Vagrant. 
$ vagrant up 
Bringing machine 'default' up with 'virtualbox' provider... 
==> default: Box 'migosm/debian-7.6-kernel-3.16' could not be found. Attempting 
to find and install... 
    default: Box Provider: virtualbox 
    default: Box Version: >= 0 
==> default: Loading metadata for box 'migosm/debian-7.6-kernel-3.16' 
    default: URL: https://atlas.hashicorp.com/migosm/debian-7.6-kernel-3.16 
==> default: Adding box 'migosm/debian-7.6-kernel-3.16' (v1.0.5) for provider: v 
irtualbox 
    default: Downloading: https://atlas.hashicorp.com/migosm/boxes/debian-7.6-ke 
rnel-3.16/versions/1.0.5/providers/virtualbox.box 
    default: Progress: 100% (Rate: 7909k/s, Estimated time remaining: --:--:--) 
==> default: Successfully added box 'migosm/debian-7.6-kernel-3.16' (v1.0.5) for 
'virtualbox'! 
==> default: Importing base box 'migosm/debian-7.6-kernel-3.16'... 
==> default: Matching MAC address for NAT networking... 
==> default: Checking if box 'migosm/debian-7.6-kernel-3.16' is up to date... 
==> default: Setting the name of the VM: SO_test_default_1427480182231_55057 
==> default: Fixed port collision for 22 => 2222. Now on port 2203. 
==> default: Clearing any previously set network interfaces... 
==> default: Preparing network interfaces based on configuration... 
    default: Adapter 1: nat 
==> default: Forwarding ports... 
    default: 22 => 2203 (adapter 1) 
==> default: Booting VM... 
==> default: Waiting for machine to boot. This may take a few minutes... 
    default: SSH address: 127.0.0.1:2203 
    default: SSH username: vagrant 
    default: SSH auth method: private key 
    default: Warning: Connection timeout. Retrying... 
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace 
    default: this with a newly generated keypair for better security. 
    default: 
    default: Inserting generated public key within guest... 
    default: Removing insecure key from the guest if its present... 
    default: Key inserted! Disconnecting and reconnecting using new SSH key... 
==> default: Machine booted and ready! 
==> default: Checking for guest additions in VM... 
==> default: Mounting shared folders... 
    default: /vagrant => C:/HashiCorp/Vagrant/SO_test 
$ vagrant ssh 
Linux packer-debian-7 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt2-1 (2014-12-08) x8 
6_64 

The programs included with the Debian GNU/Linux system are free software; 
the exact distribution terms for each program are described in the 
individual files in /usr/share/doc/*/copyright. 

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
permitted by applicable law. 
Last login: Sun Jan 4 16:49:00 2015 from 10.0.2.2 
[email protected]:~$ 

This answer到差不多的SSL錯誤的問題表明,該錯誤信息是告訴你主機被強制關閉連接出於某種原因。這可能是因爲Atlas服務器在您嘗試使用它的時候正在加載並且開始丟棄連接。或者,您的連接可能運行時間過長,並被Web服務器強行關閉。

在這種情況下,您最好使用下載管理器並直接下載盒子文件,然後使用vagrant box add [box file path]來使用該盒子。這確實意味着您無法及時更新Atlas服務器上的任何更改,但應該沒問題。

+0

謝謝。這就是我所做的 - 單獨下載這個盒子,並使用'vagrant box add'來使用它。如果服務器發生改變,我不確定我會做什麼。也許再次下載這個盒子? – maan81 2015-03-31 15:38:41

+0

我想是的。如果你仍然有問題(還有其他的盒子),那麼我猜想這是你的錯誤連接,在這種情況下,你必須依賴Vagrant爲分塊下載或Atlas服務器添加一些支持,以避免時間你能夠允許Vagrant從遠程的Atlas服務器正確管理這個盒子。 – ydaetskcoR 2015-03-31 16:18:45