Need a legacy vagrant box?

August 06, 2016 Written By Marco Monteiro

Last week I was contacted by some really old client. You know, the kind of client that you think that they don’t even have the app you made for them online anymore.

Turns out, they do have such app online, and they wanted me to change some minor things in it. But obviously I couldn’t do it directly in production. I needed to create a local environment that would mimic the one the client had.

I havent developed anything in PHP 5.3 in a long time, and since I’m using vagrant mostly with Phansible I couldnt create a machine with it. Because the oldest PHP version phansible supports is 5.4.

So I made a small box that supports what I needed and here’s what you need to do:

Download the box and init vagrant

$ vagrant box add legacy-box https://www.dropbox.com/s/ch0rq7ajonkzimp/lucid64-lamp.box?dl=1
$ vagrant init legacy-box

Edit your vagrant file

config.vm.network "private_network", ip: ""
config.vm.synced_folder "./", "/vagrant", type: "nfs"

Boot up the machine

$ vagrant up
$ vagrant ssh

You can add this to your provision id you want

$ sudo apt-get install php5 // no futuro adicionar à provision
$ sudo apt-get install php5-cli // no futuro adicionar à provision

If you need mysql you might want yo edit your bindaddress so you can connect via ssh tunnel

$ sudo nano /etc/mysql/my.cnf
bindaddress passa de a // no futuro adicionar à provision

With the lattest versions of vagrant using such a old version of ubuntu you might need to create this file with the following contents

$ cat /etc/os-release
VERSION="12.04 LTS, Precise Pangolin"
PRETTY_NAME="Ubuntu precise (12.04 LTS)"

Exit and restart the machine

$ exit
$ vagrant reload

Here’s your default connection to mysql

user: root
password: password

SSH host:
SSH user: vagrant
SSH pass: vagrant



Like it? Tweet it.

"Need a legacy vagrant box?" via @marcogmonteiro