Using Homestead with downloaded box file - vagrant

I am trying to install laravel/homestead and following the steps described in https://laravel.com/docs/5.4/homestead .
In doing that I initially ran into problems while adding a box in "First Step", so I had to download the virtualbox file externally and added the box using that file:
$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some.
$ vagrant box add laravel/homestead virtualbox/homestead.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'laravel/homestead' (v0) for provider:
box: Unpacking necessary files from: file://D:/Code/virtualbox/homestead.box
box:
==> box: Successfully added box 'laravel/homestead' (v0) for 'virtualbox'!
$ git clone https://github.com/laravel/homestead.git Homestead
Cloning into 'Homestead'...
...
$ cd Homestead ; git checkout v5.4.0
Note: checking out 'v5.4.0'.
$ bash init.sh
Homestead initialized!
My trouble is in doing vagrant up, it is still trying to download and failing. How can I tell vagrant not to download the box file anymore and use the existing box ?
$ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Box 'laravel/homestead' could not be found. Attempting to
find and install...
homestead-7: Box Provider: virtualbox
homestead-7: Box Version: >= 2.0.0
==> homestead-7: Loading metadata for box 'laravel/homestead'
homestead-7: URL: https://atlas.hashicorp.com/laravel/homestead
==> homestead-7: Adding box 'laravel/homestead' (v2.1.0) for provider:
virtualbox
homestead-7: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versions/2.1.0/providers/virtualbox.box
I have tried naming my box in first step to homestead-7 , no luck yet. on subsequent executions of vagrant up, vagrant claims to resume from prior download , but the progress does not suggest so.

Here
Successfully added box 'laravel/homestead' (v0) for 'virtualbox'!
You have installed version 0 of the box laravel/homestead. In your version of homestead, it requires to have version greater than 2.0.0.
If you want to use your version of the box, you can add a version parameter in your json file.
{
"version": "0",
"ip": "192.168.10.10",
"memory": 2048,
"cpus": 1,
"provider": "virtualbox",
...
}

Related

"unable to get local issuer certificate" during vagrant up, even after vagrant box add --insecure

The version of Vagrant I installed was 2.2.3 and I am running version 6.3 of Windows 8.
Let me copy below what I wrote into git bash and what the result was.
yishai and shira (master) vagrant $ vagrant box add --insecure bento/ubuntu-16.04 --insecure --force
==> box: Loading metadata for box 'bento/ubuntu-16.04'
...
==> box: Successfully added box 'bento/ubuntu-16.04' (v201812.27.0) for 'virtualbox'!
yishai and shira (master) vagrant $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'bento/ubuntu-16.04' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: = 2.3.5
The box 'bento/ubuntu-16.04' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Vagrant Cloud, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: ["https://vagrantcloud.com/bento/ubuntu-16.04"]
Error: SSL certificate problem: unable to get local issuer certificate
You have 2 solutions to fix this issue:
You can download the box using insecure flag
vagrant box add --insecure bento/ubuntu-16.04 --insecure
You can add the box_download_insecure flag directly in your Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.box_download_insecure = true
end

The "metadata.json" file for the box 'laravel/homestead' was not found

OC: Windows 10.
Vagrant: 2.2.1.
I run:
vagrant box add laravel/homestead --provider virtualbox
and got an error:
==> box: Loading metadata for box 'laravel/homestead'
box: URL: https://vagrantcloud.com/laravel/homestead
==> box: Adding box 'laravel/homestead' (v6.4.0) for provider: virtualbox
The "metadata.json" file for the box 'laravel/homestead' was not found.
Boxes require this file in order for Vagrant to determine the
provider it was made for. If you made the box, please add a
"metadata.json" file to it. If someone else made the box, please
notify the box creator that the box is corrupt. Documentation for
box file format can be found at the URL below:
https://www.vagrantup.com/docs/boxes/format.html
Before that, I had already executed this command, I added the box and everything worked for me, but then I decided to remove the box through vagrant box remove laravel/homestead and add it again.
The problem was solved by deleting the laravel-VAGRANTSLASH-homestead folder inside the ~\.vagrant.d\boxes directory (C:\Users\User\.vagrant.d\boxes im my case).
After this i successfully run:
$ vagrant box add laravel/homestead --provider virtualbox
==> box: Loading metadata for box 'laravel/homestead'
box: URL: https://vagrantcloud.com/laravel/homestead
==> box: Adding box 'laravel/homestead' (v6.4.0) for provider: virtualbox
box: Downloading: https://vagrantcloud.com/laravel/boxes/homestead/versions/6.4.0/providers/virtualbox.box
box: Download redirected to host: vagrantcloud-files-production.s3.amazonaws.com
box:
==> box: Successfully added box 'laravel/homestead' (v6.4.0) for 'virtualbox'!
I hope this helps someone.

Is it possible to configure vagrant to use a box mirror?

I'm trying to try out Vagrant, but ...
$ vagrant init hashicorp/precise32
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 'hashicorp/precise32' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'hashicorp/precise32'
default: URL: https://atlas.hashicorp.com/hashicorp/precise32
==> default: Adding box 'hashicorp/precise32' (v1.0.0) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/hashicorp/boxes/precise32/versions/1.0.0/providers/virtualbox.box
default: Progress: 3% (Rate: 62598/s, Estimated time remaining: 0:52:14)
62K/s is pretty much the fastest its been for multiple boxes I've tried including hashicorp/precise32, hashicorp/precise64, bento/debian-8.2 and some others.
Is there a Vagrant box mirror that I can configure vagrant to use or some other mechanism to allow for faster box downloads?
You can try wget on the URL as
wget https://atlas.hashicorp.com/hashicorp/boxes/precise32/versions/1.0.0/providers/virtualbox.box
There has been issue opened related to this without clear fix. vagrant uses curl internally but it might work better using wget instead.
once you have the box file you still need to add to vagrant (vagrant box add ...)

Why "vagrant up" gives me an error?

I am installing the datasciencetoolbox and after entering the valgrant up I am receiving the following error:
dyn-72-33-239-166:psql mona$ mkdir MyDataScienceToolbox
dyn-72-33-239-166:psql mona$ cd MyDataScienceToolbox/
dyn-72-33-239-166:MyDataScienceToolbox mona$ vagrant init data-science-toolbox/dst
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.
dyn-72-33-239-166:MyDataScienceToolbox mona$ 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 'data-science-toolbox/dst' could not be found.
dyn-72-33-239-166:MyDataScienceToolbox mona$ ls -la Vagrantfile
-rw-r--r-- 1 mona staff 4646 Aug 25 20:55 Vagrantfile
I am following this tutorial: DataScienceToolBox
Are you using an old version of Vagrant, perhaps? Here's what those commands do for me:
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'data-science-toolbox/dst' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'data-science-toolbox/dst'
default: URL: https://vagrantcloud.com/data-science-toolbox/dst
==> default: Adding box 'data-science-toolbox/dst' (v0.1.5) for provider: virtualbox
default: Downloading: https://vagrantcloud.com/data-science-toolbox/dst/version/1/provider/virtualbox.box
==> default: Waiting for cleanup before exiting...
The fact that yours doesn't even attempt to retrieve the box from vagrantcloud suggests an old version, maybe.
You can get your version with $ vagrant version.
This box needs version 1.5+ so I updated to version 1.6 downloading from this website and now it is working
http://www.vagrantup.com/downloads.html

vagrant can't find existing box

i was add box with local file from https://dl.dropboxusercontent.com/s/x1085661891dhkz/lxc-centos6.5-2013-12-02.box
vagrant box add centos centos.box
vagrant init centos
my shell:
cheneytekimbp:vagrant-centos zicjin$ vagrant box list
centos (lxc, 0)
lucid32 (virtualbox, 0)
cheneytekimbp:vagrant-centos zicjin$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'centos' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Adding box 'centos' (v0) for provider: virtualbox
default: Downloading: centos
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Couldn't open file /Users/zicjin/Work/vagrant-centos/centos
Add the local box file using the full path with the file protocol URI. For instance:
vagrant box add centos file:///Users/zicjin/Work/vagrant-centos/centos.box
(the exact location of course depends on where you've put the file)
$ vagrant box add CentOSMinimal https://dl.dropbox.com/u/7225008/Vagrant/CentOS-6.3-x86_64-minimal.box
$ vagrant init CentOSMinimal
$ vagrant up
If you're on windows, you can define the path as:
vagrant box add box_name "C:\Users\JohnDoe\blahblah\box_name.box"
Notice the .box at the end of the path.
Then you can cd into the directory if you're not already there and do vagrant up.
I've solved a similar issue upgrading Vagrant to the latest version and magically it works... :/

Resources