J'ai souvent constaté des problèmes de dl des images vagrant lors de "vagrant up". Une solution est de télécharger externement l'image :
vagrant up
Bringing machine 'ub1404' up with 'virtualbox' provider... ==> ub1404: Box 'rapid7/metasploitable3-ub1404' could not be found. Attempting to find and install... ub1404: Box Provider: virtualbox ub1404: Box Version: >= 0 ==> ub1404: Loading metadata for box 'rapid7/metasploitable3-ub1404' ub1404: URL: https://vagrantcloud.com/rapid7/metasploitable3-ub1404 ==> ub1404: Adding box 'rapid7/metasploitable3-ub1404' (v0.1.12-weekly) for provider: virtualbox ub1404: Downloading: https://vagrantcloud.com/rapid7/boxes/metasploitable3-ub1404/versions/0.1.12-weekly/providers/virtualbox.box
while (true); do wget -c https://vagrantcloud.com/rapid7/boxes/metasploitable3-ub1404/versions/0.1.12-weekly/providers/virtualbox.box && break ; done
on télécharge ainsi notre box en try infinite jusqu'a un code de retour disant que tout est ok. on peut ensuite ajouter la box a notre environnement vagrant :
vagrant box add rapid7/metasploitable3-ub1404 virtualbox.box
==> box: Box file was not detected as metadata. Adding it directly... ==> box: Adding box 'rapid7/metasploitable3-ub1404' (v0) for provider: box: Unpacking necessary files from: file:///root/Vagrant/Metasploitable/virtualbox.box ==> box: Successfully added box 'rapid7/metasploitable3-ub1404' (v0) for 'virtualbox'!
puis on ré-exécute notre "vagrant up". L'image est présente, il peut maintenant l'utiliser.
vagrant up
Bringing machine 'ub1404' up with 'virtualbox' provider... ==> ub1404: Importing base box 'rapid7/metasploitable3-ub1404'... ==> ub1404: Matching MAC address for NAT networking... ==> ub1404: Setting the name of the VM: Metasploitable3-ub1404 ==> ub1404: Fixed port collision for 22 => 2222. Now on port 2200. ==> ub1404: Clearing any previously set network interfaces... ==> ub1404: Preparing network interfaces based on configuration... ub1404: Adapter 1: nat ub1404: Adapter 2: hostonly ==> ub1404: Forwarding ports... ub1404: 22 (guest) => 2200 (host) (adapter 1) ==> ub1404: Running 'pre-boot' VM customizations... ==> ub1404: Booting VM... ==> ub1404: Waiting for machine to boot. This may take a few minutes... ub1404: SSH address: 127.0.0.1:2200 ub1404: SSH username: vagrant ub1404: SSH auth method: password ub1404: Warning: Connection reset. Retrying... ub1404: ub1404: Inserting generated public key within guest... ub1404: Removing insecure key from the guest if it's present... ub1404: Key inserted! Disconnecting and reconnecting using new SSH key... ==> ub1404: Machine booted and ready! ==> ub1404: Checking for guest additions in VM... ub1404: No guest additions were detected on the base box for this VM! Guest ub1404: additions are required for forwarded ports, shared folders, host only ub1404: networking, and more. If SSH fails on this machine, please install ub1404: the guest additions and repackage the box to continue. ub1404: ub1404: This is not an error message; everything may continue to work properly, ub1404: in which case you may ignore this message. ==> ub1404: Setting hostname...
vagrant global-status
id name provider state directory ---------------------------------------------------------------------- 44f2366 ub1404 virtualbox running /root/Vagrant/Metasploitable
Et voila, on a pu downloader en mode retry-and-complete, ce que vagrant échoue toujours à faire pour moi ...