I was wondering how I would be able to run multiple versions of homestead without having VirtualBox crash.
I am currently running a default installation of the laravel homestead, but I need to install another older version, the reason is that in current version 0.4.0 the mysql server is 5.7 which is fine, but i need another environment with 5.6 because i have an old project which requires 5.6, so homestead version 0.3.0 would be fine.
Just to be clear: I know how to run multiple sites. That is not the issue. I just want to run a second, custom version of the Laravel Homestead Vagrant box, while still having the possibility to run my normal one.
Details: i managed to add both versions. Output of:
vagrant box list
laravel/homestead (virtualbox, 0.3.0)
laravel/homestead (virtualbox, 0.4.0)
so version 0.4.0 is running fine, now how i can run 0.3.0 ?
Thanks in advance!
Ok i managed it. I will post the solution for those who faced this issue, because I was not able to find a step by step guide with a homestead related instructions.
Without too much theory the steps are:
Decide which box version you need from here (https://atlas.hashicorp.com/laravel/boxes/homestead), in my case it was 0.3.0 and run
vagrant box add laravel/homestead --box-version 0.3.0
Inside Homestead2 directory find scripts/homestead.rb file and edit it. find lines
config.vm.box = settings["box"] ||= "laravel/homestead"
config.vm.hostname = settings["hostname"] ||= "homestead"
between them add line, in my case :
config.vm.box_version = "0.3.0"
you can also rename
vb.name = settings["name"] ||= "homestead"
if you wish
after this you can use it as usual.
I hope this helps somebody.
There's an option for running a box with version 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 it out from documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With