Can't install Vagrant box Laravel Homestead

22,282

Solution 1

A. Go to .vagrant.d\tmp\ and delete the partial download file, then try again.

B. If that fails, you could attempt downloading the file manually using a browser or other tool. Once downloaded, you can import it using vagrant box add laravel/homestead path/to/virtualbox.box.

(Edited: Adds second answer from comments below.)

Solution 2

Try this:
rm ~/.vagrant.d/tmp/*or rm -R ~/.vagrant.d/tmp/*

Then vagrant up again.

Solution 3

Go to C:\Users\YourUSERNAME\.vagrant.d\tmp and delete all the files. Then type following command:

vagrant box add laravel/homestead

Solution 4

Try:

vagrant box add laravel/homestead -c

Solution 5

If you're using Vagrant V2 then you can use the --clean flag when adding a box.

vagrant box add laravel/homestead --clean

--clean - If given, Vagrant will remove any old temporary files from prior downloads of the same URL. This is useful if you don't want Vagrant to resume a download from a previous point, perhaps because the contents changed.

Vagrant Documentation

Share:
22,282
Alonso Arellano
Author by

Alonso Arellano

Updated on February 05, 2020

Comments

  • Alonso Arellano
    Alonso Arellano about 4 years

    I'm trying to install Laravel Homestead on Mac OS X following the official documentation instructions on here.

    I installed VirtualBox and Vagrant. Now I'm trying to add the Homestead box with the command vagrant box add laravel/homestead. After a while the download stops and I get an error. It doesn't let me restore the download so I have to delete the partial download file and start from zero. I've tried it many times.

    I think my Internet connection has something to do since it's kinda slow and it's a large file.

    Here's the complete code:

    $ vagrant box add laravel/homestead
    ==> box: Loading metadata for box 'laravel/homestead'
        box: URL: https://atlas.hashicorp.com/laravel/homestead
    This box can work with multiple providers! The providers that it
    can work with are listed below. Please review the list and choose
    the provider you will be working with.
    
    1) virtualbox
    2) vmware_desktop
    
    Enter your choice: 1
    ==> box: Adding box 'laravel/homestead' (v0.2.7) for provider: virtualbox
        box: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.2.7/providers/virtualbox.box
    An error occurred while downloading the remote file. The error
    message, if any, is reproduced below. Please fix this error and try
    again.
    
    transfer closed with 935392411 bytes remaining to read
    

    After retrying:

    An error occurred while downloading the remote file. The error
    message, if any, is reproduced below. Please fix this error and try
    again.
    
    HTTP server doesn't seem to support byte ranges. Cannot resume.
    

    Any help is appreciated.

  • Alonso Arellano
    Alonso Arellano almost 9 years
    I've done that many times already. Do you know if there's another option?
  • Chris Vogt
    Chris Vogt almost 9 years
    Hmm, you could attempt downloading the file manually using a browser or other tool. Once downloaded, you can import it using vagrant box add laravel/homestead path/to/virtualbox.box.
  • user2094178
    user2094178 almost 9 years
    For me it only works the way Vogt suggests in the comments.
  • goodforenergy
    goodforenergy over 8 years
    I struggled with this for ages, even downloading manually wouldn't work in Chrome, Safari or via a curl - but for some reason Firefox succeeded where the others failed.
  • Volatil3
    Volatil3 over 8 years
    @ChrisVogt but instead of a .box file it downloads the file hc-download
  • ydobonebi
    ydobonebi over 8 years
    Did you fail to read the question? In the question what you suggest is exactly what is failing to work and thus the question.
  • Chris Kolodin
    Chris Kolodin over 8 years
    @ydobonebi the documentation for the flag '-c' states: "Clean any temporary download files". using this flag removes the files associated with the partial download in .vagrant.d/tmp/ before attempting to add the box. it is behaviorally equivalent to removing the contents of the .vagrant.d/tmp directory and then retrying to add the box.
  • Sinan Eldem
    Sinan Eldem over 8 years
    Worked for me. Thanks.
  • Reisclef
    Reisclef over 8 years
    Thanks for providing a Windows location for the temp files!
  • Kevin
    Kevin over 8 years
    You can see how to download it manually using this link laravel.io/forum/…
  • Capuchin
    Capuchin over 8 years
    Worked for me - had some tmp files.
  • 502_Geek
    502_Geek almost 8 years
    It's worked. If I tried to download with --insecure, it's didn't work properly dude. Thanks