4

Trying to configure laravel 5.1.

Cloned the laravel/homestead

After cloning it to Home directory. Throwing error when tried to run the vagrant up command as below:

user@user:~/laravel/homestead$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The box 'laravel/homestead' could not be found.

I first tried with vagrant box add laravel/homestead

This command was not invoked properly. The help for this command is
available below.

Usage: vagrant box add <name> <url> [--provider provider] [-h]

        --checksum VALUE             Checksum
        --checksum-type VALUE        Checksum type
    -c, --clean                      Remove old temporary download if it exists.
    -f, --force                      Overwrite an existing box if it exists.
        --insecure                   If set, SSL certs will not be validated.
        --cacert certfile            CA certificate
        --cert certfile              The client SSL cert
        --provider provider          The provider that backs 

Also tried passing url as the error shown, still failed. Atlast cloned from the git repo

1. vagrant -v : Vagrant 1.4.3

2. vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead

Error:

Downloading box from URL: https://atlas.hashicorp.com/laravel/boxes/homestead
Extracting box...e: 0/s, Estimated time remaining: --:--:--)
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):

bsdtar: Error opening archive: Unrecognized archive format

3. homestead :

Laravel Homestead version 2.0.17

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  destroy    Destroy the Homestead machine
  edit       Edit the Homestead.yaml file
  halt       Halt the Homestead machine
  help       Displays help for a command
  init       Create a stub Homestead.yaml file
  list       Lists commands
  provision  Re-provisions the Homestead machine
  resume     Resume the suspended Homestead machine
  run        Run commands through the Homestead machine via SSH
  ssh        Login to the Homestead machine via SSH
  status     Get the status of the Homestead machine
  suspend    Suspend the Homestead machine
  up         Start the Homestead machine
  update     Update the Homestead machine image

What am i doing wrong?

Mithun Shreevatsa
  • 3,588
  • 9
  • 50
  • 95
  • what happens if you try to add the box directly? `vagrant box add laravel/homestead` – Konstantin Jun 10 '15 at 08:11
  • @Alik - Updated my question, plz have a chk – Mithun Shreevatsa Jun 10 '15 at 08:18
  • Also add information about vagrant version `vagrant -v`. What exactly does `vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead` output? – Konstantin Jun 10 '15 at 08:21
  • Do you have PHP and composer installed locally? Homestead doesn't usually get installed in the way you're describing. – edcs Jun 10 '15 at 08:41
  • @ecs - yes, both php and composer is installed. Its too basic thing before staring laravel which i have done that carefully – Mithun Shreevatsa Jun 10 '15 at 08:45
  • @Mithun ecs is right, you have to use `homestead` command to run the environment, but it won't work anyway, because it depends on vagrant. – Konstantin Jun 10 '15 at 08:47
  • @Mithun ok, so you have old Vagrant. Try to do this then `https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.2.6/providers/virtualbox.box` – Konstantin Jun 10 '15 at 08:56
  • It looks like you've missed out a couple of steps here - are you following the docs? http://laravel.com/docs/5.1/homestead The installation process looks like it's changed since version 5.0. – edcs Jun 10 '15 at 08:56
  • @ecs, well even if he follows the docs installation will fail. Check his edits and compare them to [this section](http://laravel.com/docs/5.1/homestead#first-steps) of the docs. – Konstantin Jun 10 '15 at 08:59
  • @Alik - when i open the link you provided throws error : could you plz tell me which command to use. I have also updated my question yet again with `homestead` output. Plz save me. I really did not think, that laravel start is going to trouble like this even though i am good with PHP :( – Mithun Shreevatsa Jun 10 '15 at 09:04
  • @Mithun use that url with `vagrant box add laravel/homestead ` command – Konstantin Jun 10 '15 at 09:17
  • I have gone dumbo : i tried with `vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.2.6/providers/virtualbox.box` : Again error : `Download failed. Will try another box URL if there is one.-) An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again. ` – Mithun Shreevatsa Jun 10 '15 at 09:18
  • @Mithun url does exist. I've just tested it by issuing `wget http://atlas...`, it redirects to `http://cabinet.laravel.com/homestead-0-2-6-vb.box` You can try this url, but you should really update your vagrant instead of trying to pull this with `1.4.x` – Konstantin Jun 10 '15 at 09:31
  • @Alik - So should i try with `vagrant box add laravel/homestead http://cabinet.lara...` instead of `http://atlas` and moreover how to update vagrant. Which is the latest version of vagrant? – Mithun Shreevatsa Jun 10 '15 at 09:36

2 Answers2

4

Update your Vagrant. Vagrant Cloud was introduced in 1.5 IRC, hence your vagrant doesn't understand how to deal with command like vagrant box add laravel/homestead

Konstantin
  • 24,271
  • 5
  • 48
  • 65
2

the correct command to download its to add full URL
you can use this vm box its latest version until now
https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.4.1/providers/virtualbox.box
and if you want to change to another version or there newer one just change the number of it
so the command should be like this

vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.4.1/providers/virtualbox.box

the command was for virtual box and if you have low internet speed you can download it from URL and after finished you can use path on your local pc instead of URL.
and if you still face problem try to uninstall vagrant by use this command

rm -rf /opt/vagrant
rm -f /usr/bin/vagrant

the command for Linux users
and if the problem still try to delete folder at ~/.vagrant.d and for other OS check this after uninstall you can download and install it.
at last make sure you use all commands at home directory regards

Zaman
  • 811
  • 7
  • 15