I manually downloaded laravel homestead box from atlas and the version i downloaded is 0.2.6 of laravel/homestead.
Then i git clone https://github.com/laravel/homestead.git Homestead.
After doing the other necessary configurations when i am trying to run vagrant up from Homestead directory, it is starting to download the laravel/homestead box again with version 0.4.0.
My internet is slow and i cannot afford to download the box again. Is there any way i can tell Homestead to use the existing homestead box already exist in my ~/.vagrant.d directory.
Thanks
Try this:
Locate this homestead.rb at your drive, mine is at C:\Users\SuperComputer\Homestead\scripts\homestead.rb
Edit it using text editor.
try find this word syntax:
config.vm.box_version = settings["version"] ||= ">= 0"
change it to
config.vm.box_version = settings["version"] ||= "= 0.2.6"
Another solution for this as shown https://abbasharoon.me/laravel-homestead-windows-extremely-easy/ and here http://laravel.io/forum/05-06-2015-how-to-download-vagrant-box-manually is to add the metadata_url file. Without that file, Vagrant will try to download the homestead even after installing the manually downloaded homestead box. To add the metadata_url, follow the following steps:
Download the metadata file from here
Move the metadata_url file to C://Users/YourUserName/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead.
In case you have configured a different directory for Vagrant’s
storage then you will need to find the boxes directory there
Inside the laravel-VAGRANTSLASH-homestead directory, rename the directory “0” to the current version which is currently 0.5.0
Related
I am installing laravel homestead. As I am new on this so maybe i took some steps wrong while installing and setting up laravel homestead on windows.
I followed a tutorial and download laravel homestead box directly and then install it manually by giving it a local disk url. It installed perfectly fine till then. But now when i am trying to "vagrant up" command it says that box doesnt found.
So after that I read somewhere that it we have to add manyual metadata somewhere but I dont know where. And after some changes I am facing this error.
Once you have downloaded the box manually, you need to add it to vagrant config, so vagrant knows about the box for later user. run the following command :
$ vagrant box add --box-version <VERSION_DOWNLOADED> laravel/homestead <path to downloaded file>
After this, make sure to go to the folder where homestead has been cloned (do not do that from the .vagrant directory, just go somewhere else, and avoid path with space, windows generally does not like it; C:\homestead will be just fine for a test) and you can run vagrant up from there
I've downloaded the homestead box manually because of much slow downloading via terminal. But after adding the box, vagrant is not finding it and attempting to download again.
#FrédéricHenri Thanks. I found that the box was added directly instead of from a box catalog so vagrant try to check the updates and failed. So i simply just disable the check update.
config.vm.box_check_update = false
OR
For updates. I added metadata_url file in laravel-VAGRANTSLASH-homestead containing the url pointing to the box
https://vagrantcloud.com/laravel/homestead
This happens when we add box from file, Vagrant marks as it is version 0 by default.
Solution I found When I got same error I renamed the folder 0 to the corresponding version in my case it was 0.4.2 inside this path~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead. Then if you vagrant up from homestead project you may get error. So you can add catalog file metadata_url file. with url https://atlas.hashicorp.com/laravel/boxes/homestead in laravel-VAGRANTSLASH-homestead directory.
I have a problem with installing homestead in windows 8, using vagrant.
I typed in like
vagrant box add laravel/homestead as well as
composer require laravel/homestead --dev to make sure that homestead files are installed properly.
also I added environmental variable where homestead.yaml is located.
as a result, I sucessfully access to homestead in cmd.
but when I typed in homestead edit it said,
Windows can not find 'C:\USERS\PETER.homestead\Homestead.yaml' Make
sure you typed the name correctly, and then try again.
so, I checked the file location c:\users\peter.homestead\homestead.yaml, but the directory, .homestead, does not exist in PETER directory.
How can I solve this problem?
Any help or feedback will be appreciated.
Thank you and have a great day.
Do a homestead init for the folder to be generated. Navigate to the path and you should see it.
I want to download a vagrant box file from Atlas for using it later locally with my vagrant file. How can I do this, and how can I configure it?
To download a file you have to add version and provider in the URL. For example for downloading trusty64 First you need its URL which is
https://app.vagrantup.com/ubuntu/boxes/trusty64/
then you have to add version and provider afterwards, for our example the download URL would be.
https://app.vagrantup.com/ubuntu/boxes/trusty64/versions/20180206.0.0/providers/virtualbox.box
Then you have to add it locally from your vagrant file.
To add it locally to vagrant file use the following command
vagrant box add foo-box /path/to/vagrant-box.box
vagrant init foo-box
vagrant up
This will create the vagrantfile and you can configure the vagrant file.
However, this will add the box as version 0.
○ → vagrant box add ubuntu/trusty64 ~/Downloads/trusty-server-cloudimg-amd64-vagrant-disk1.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'ubuntu/trusty64' (v0) for provider:
box: Unpacking necessary files from: file:///Users/ram/Downloads/trusty-server-cloudimg-amd64-vagrant-disk1.box
==> box: Successfully added box 'ubuntu/trusty64' (v0) for 'virtualbox'!
vagrant does not allow to specify a version number of the manually added box
○ → vagrant box add ubuntu/trusty64 ~/Downloads/trusty-server-cloudimg-amd64-vagrant-disk1.box --box-version 20151021.0.0
==> box: Box file was not detected as metadata. Adding it directly...
You specified a box version constraint with a direct box file
path. Box version constraints only work with boxes from Vagrant
Cloud or a custom box host. Please remove the version constraint
and try again.
To update the version number of the box, change the folder name '0' in ~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64/0 to the version number you downloaded. For example '20160120.0.0'
|2.2.3| MacBook-Pro in ~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64
○ → mv 0 20160120.0.0
now you are all set to update the version next time with vagrant command too
○ → vagrant box list
ubuntu/trusty64 (virtualbox, 20160120.0.0)
I faced the same issue not being able to download from script. So manually downloaded the box and added to vagrant as below,
you can get versions you want from here - https://atlas.hashicorp.com/ubuntu/boxes/precise64
wget https://atlas.hashicorp.com/ubuntu/boxes/precise64/versions/20160818.0.0/providers/virtualbox.box
cd my_vagrant_project
vagrant box add precise64 ~/Downloads/precise-server-cloudimg-amd64-vagrant-disk1.box
vagrant init precise64
vagrant up
Download virtualbox.box:
https://app.vagrantup.com/laravel/boxes/homestead/versions/6.4.0/providers/virtualbox.box
You can change the version(6.4.0) of homestead box with the Current Version.
Current version: 6.4.0.
Check for the latest version here: https://app.vagrantup.com/laravel/boxes/homestead
After downloading the box, rename it to virtualbox.box
Don't forget to include the .box extension.
Add the downloaded homestead box to vagrant:
vagrant box add laravel/homestead file:///f:/virtualbox.box
Change the Drive( c: or d: or e:) or Path(c:/folder1/folder2/virtualbox.box) to the location where you have stored your downloaded homestead box.
You will get success massage like image below:
Update homestead box
Navigate to vagrant directory:
c:/users/YourUserName/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead
After that, Create a file called metadata_url
NOTE: There is no extension for metadata_url
Then add the link below and save the file
https://app.vagrantup.com/laravel/homestead
Do not add a newline after link in above file.
Rename folder 0 to 6.4.0
6.4.0 is your homestead box version.
And it's Done. Hope it help.
First: check latest version from this link Here
Update:you can try by go to the mentioned link above ,to get the number of latest version,then try to change the version in bellow URL
for now the latest version is:7.2.1
for virtualbox:
https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/virtualbox.box
for hyperv:
https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/hyperv.box
for vmware:
https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/vmware_desktop.box
for parallels:
https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/parallels.box
Maybe in the future the link changed so try to get download vagrant box by using command on your terminal/CMD by command
vagrant box add laravel/homestead
choose your virtualization method
then you will see the download link *ended with .box, after that you can cancel it CTRL+C and copy the download link and download it locally by using IDM/aria2c -x16 etc.
Second: Use this command
vagrant box add laravel/homestead {Path of file from your local computer}
Third:add metadata by go to
1- you create a file called metadata_url
NOTE: There is no extension for metadata_url
2- Then add this link and save the file
https://atlas.hashicorp.com/laravel/homestead
3- Copy metadata_url file to:
for windows go to
%userprofile%.vagrant.d\boxes\laravel-VAGRANTSLASH-homestead
4- Then rename the folder named 0 to the version of the current homestead version = 7.2.1
I hope this help
for more information
Laravel
metadata
If you have the ubuntu-VAGRANTSLASH-trusty64 folder from someone else machine you can simply copy paste the folder to
~/.vagrant.d/boxes
and use the vagrant up to start the servers. This way you do not need to add the trusty64 box manually.
Instructions for OSX/Fusion:
wget https://vagrantcloud.com/hashicorp/boxes/precise64/versions/1.1.0/providers/vmware_fusion.box
# For some reason, the downloaded filename was set to an uuid
# mv <uuid> vmware_fusion.box
vagrant box add hashicorp/precise64 vmware_fusion.box
cd vagrant.d/boxes/hashicorp-VAGRANTSLASH-precise64
mv 0 1.1.0
echo -n "https://app.vagrantup.com/hashicorp/boxes/precise64" > metadata_url
vagrant box list
I try to use vagrant up and I got URL to download box file:
https://vagrantcloud.com/centos/boxes/7/versions/1801.02/providers/virtualbox.box
There has been a recent change lately when attempting to clone the laravel/homestead package from GitHub. I haven't had trouble in the past trying to add additional virtual machines to my system but now I'm running into a problem.
If you go into GitHub to look at the latest repository for Laravel Homestead you will see that the 'homestead.yaml' file is not in the root directory any longer and has now been replaced by the file 'homestead'.
In the past, I have used the steps below for creating additional virtual machines in my command prompt:
1) Create a new directory (Code2) from within the root directory where VirtualBox and VagrantBox are installed
2) Go into 'cmd' and change to 'Code2' directory
3) Type in 'vagrant box add laravel/homestead --force'
4) Type in 'git clone https://github.com/laravel/homestead.git Homestead_temp'
5) Go into the newly created 'Homestead_temp' directory, copy and paste the files from inside that directory into your 'Code2' root directory.
6) Edit 'src/stubs/homestead.yaml' so that it contains the correct paths for your 'Code2' directory.
7) Go back into 'cmd' and type in 'vagrant up'. When I try to do this, I keep getting a 'read: No such file or directory C:/Users/Jeff/.homestead/Homestead.yaml'
I haven't had trouble in the past adding additional virtual machines but now I am prevented from doing so. Any help is greatly appreciated.
I'm not really sure if this answers my question or not, I'll have to do some research on it but for anybody that is curious about the recent Laravel Homestead changes, check out this article for Laravel 2.0
Hope this information helps!