29

I manage to install Vagrant on my Ubuntu 14.04 LTS pc. How can I install vagrant box which I downloaded manually from a URL? I want to install Laravel Homestead but it will always fail because of my network connection. I want to download it from this link https://vagrantcloud.com/laravel/boxes/homestead/versions/11/providers/virtualbox.box but I don't know what to do after I downloaded the box.

Port 8080
  • 858
  • 3
  • 12
  • 24

3 Answers3

51

You can install downloaded box using this command

vagrant box add laravel/homestead path/to/your/box/file.box

Source: https://laracasts.com/forum/?p=1615-laravel-vagrant-homestead/0

Arsinux
  • 173
  • 1
  • 4
  • 13
  • Thanks. I'm going to try this after I finish downloading homestead box. I'll accept it later – Port 8080 Oct 30 '14 at 14:28
  • 1
    When I go to link https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.2.7/providers/virtualbox.box it downloads file `hc-download`. What wrong is being done – Volatil3 Aug 12 '15 at 04:16
  • 2
    @Volatil3 it is the same file just rename it and add .box extension. However it is a server response to download that file by that name. – revo Sep 15 '15 at 08:22
  • Its really save my time. I follow your suggestion. Additionally i had to prevent update config.vm.box_check_update = false Then it works fine. I hope it will help for someone – Tuhin Bepari Jan 19 '18 at 06:45
9

I am able to run this command on win7:

box add homestead file:///c:/homestead.box

Also this one is working:

box add homestead file:///c:\homestead.box
sawran
  • 101
  • 2
1

Boxes also can be added using metadata json file, in which some additional configs can be provided, along with box name and its local path.

For example create metadata.json file and provide version (7.0.0) of importing box in it:

{
  "name": "laravel/homestead",
  "versions": [
    {
      "version": "7.0.0",
      "providers": [
        {
          "name": "virtualbox",
          "url": "file:///Users/path/to/box/virtualbox.box"
        }
      ]
    }
  ]
}

Then add box running vagrant box add command with metadata.json file path parameter:

vagrant box add laravel/homestead /path/to/metadata.json



Additional info: When version is not provided, imported box will have version 0 by default. And if there is check for minimum box version, when running vagrant up it will start to download box from internet instead of using already imported one.

Jakhongir
  • 586
  • 8
  • 11