Home  >  Article  >  PHP Framework  >  How to add local box to vagrant to install laravel homestead

How to add local box to vagrant to install laravel homestead

藏色散人
藏色散人forward
2020-03-18 09:01:274018browse

How to add local box to vagrant to install laravel homestead

When installing the Laravel homestead virtual machine, due to mysterious reasons, it is too slow to directly add the box, and the chance of failure midway is too high. Therefore, in China, it is highly recommended that everyone install Laravel homestead directly using the local box:

Recommendation: laravel tutorial

1. Download homestead.box File

You can use Thunder or other methods to download the box below

https://atlas.hashicorp.com/laravel/boxes/homestead/versions/1.0.1/providers/virtualbox.box

Note that the version number here is 1.0.1. If you use other versions, please change it accordingly; also Yes, the link above uses virtualbox as the provider.

2. Add box locally

Execute the following command on the command line:

vagrant box add laravel/homestead ~/Downloads/virtualbox.box

Pay attention to the following path ~/Downloads/virtualbox. box, pay attention to modify the corresponding path! If you are a Windows user, the path format is almost like this: file:///c:/users/jellybool/downloads/virtualbox.box

After execution, it will look like this:

How to add local box to vagrant to install laravel homestead

After the addition is successful, be sure not to rush to execute vagrant up

3. Modify the version number

mac users need to go to /.vagrant .d/boxes/laravel-VAGRANTSLASH-homestead Directory:

cd ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead
ls

The directory corresponding to windows users is probably c:/users/jellybool/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead

You will probably see a directory like this:

☁  laravel-VAGRANTSLASH-homestead  ls
0.0

You need to do two steps here:

Add a file named metadata_url, and only write # in it ##

https://atlas.hashicorp.com/laravel/homestead

Be careful that there are no spaces or anything else

Change the 0 or 0.0 directory you see to your box version number, for example, the one here is 1.0.1## in the first step

#4. Execute vagrant up

Good luck!

The above is the detailed content of How to add local box to vagrant to install laravel homestead. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete