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

How to add local box to vagrant to install laravel homestead

藏色散人
Release: 2020-03-18 09:01:27
forward
4116 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

You need to do two steps here:

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

https://atlas.hashicorp.com/laravel/homestead
Copy after login
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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template