You’ll need Virtual box so download and install that
Then you’ll need vagrant
You can check out the getting started guide here:
Open a terminal session (iTerm2 on mac or cmder windows) and run:
vagrant init hashicorp/precise64
Lets make our own
Lets commit it to a github repo so we have source control on it. Go to github.com and create a repo. Replace the url below with your .git file.
echo "# Vagrants" >> README.md
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/phpdave/Vagrants.git
git push -u origin master
Lets find a box we want to add to our vagrantfile
I chose the most popular vagrant ubuntu/trusty64. Edit the vagrantfile and Below “Vagrant.configure(“2″) do |config|” add:
config.vm.box = “ubuntu/trusty64”
config.vm.box_version = “20160926.0.1”
exit your editor and do
Then you have your ubuntu server to setup how you want.
Example of setting up PHP 7 dev vagrant:
Provisioning w/ external shell script:
config.vm.provision "shell", path: "script.sh"
in script.sh you could run an update and install of apache, php:
sudo apt-get -y update
sudo apt-get -y install apache2 php7 libapache2-mod-php7
Give a network IP address
config.vm.network "private_network", ip: "192.168.50.4"
Want to do this on a power System? Well VirtualBox doesnt appear to support powerpc so looks like you have to use powerkvm instead.