Install multiple Laravel environments

I was wondering how I can run several versions of homestead without crashing VirtualBox.

I am currently running the default installation in laravel homestead, but I need to install another older version, the reason is that in the current version 0.4.0, the mysql server is 5.7, and this is normal, but I need a different environment with 5.6 because that I have an old project that requires 5.6, so the estate version 0.3.0 will be fine.

Just to be clear: I know how to run multiple sites. It's not a problem. I just want to launch a second, customizable version of the Laravel Homestead Vagrant box, but still have the ability to run my regular one.

Details: I managed to add both versions. Output:

vagrant box list laravel/homestead (virtualbox, 0.3.0) laravel/homestead (virtualbox, 0.4.0) 

so version 0.4.0 is working fine, now how can i run 0.3.0?

Thanks in advance!

+5
source share
2 answers

Ok, I did it. I will post a solution for those who have encountered this problem because I could not find a step-by-step guide with instructions related to the estate.

Without too much theory, the steps are:

  • Determine which version of the window you need from here ( https://atlas.hashicorp.com/laravel/boxes/homestead ), in my case it was 0.3.0 and run

    stray boxing add laravel / homestead --box version 0.3.0

  • Find in github the release version of the estate ( https://github.com/laravel/homestead/releases ) in my case it was (v2.1.8) and download and extract it to a directory, such as Homestead2 in your home folder.
  • Inside the Homestead2 directory, find the scripts / homestead.rb file and edit it. find strings

     config.vm.box = settings["box"] ||= "laravel/homestead" 

    config.vm.hostname = settings ["hostname"] || = "homestead"

add a line between them, in my case:

 config.vm.box_version = "0.3.0" 

you can also rename

 vb.name = settings["name"] ||= "homestead" 

if you wish

  1. vagrant up starts from inside this directory

after that you can use it as usual.

Hope this helps someone.

+3
source

There is an option to launch a version window in Vagrantfile.

In your case, you need to add box_version to your Vagrantfile, similar to this:

 Vagrant.configure('2') do |config| // This line config.vm.box_version = 0.3.0 end 

You can check this from the documentation .

+2
source

Source: https://habr.com/ru/post/1239120/


All Articles