Practicalweb Ltd

Technical information on this site may be out of date : no updates since 2015

Creating new Vagrant base boxes with Veewee

October 28 2014 : posted under vagrant veewee virtualbox

Creating your own base box for vagrant is a great thing to do, you get to undestand exactly what is on that box and to choose exactly what base OS you use.

After all one of the big draws of vagrant is keeping your dev environment close to what production looks like - and for that you need to know what is in the base box.

When I first started using vagrant I wrote a post How to build a Centos 6 base Box for vagrant whcih details the manual steps needed. At the time I was busy learning puppet, vagrant and related tools - veewee was just one tool too many and a manual build seemed the best way to get my head around what a base box was.

While the base box isn’t something I have needed to repeat much, it is beneficial to update the base image from time to time and here veewee is brilliant. It also makes shareing the reponnsbibility for the base box within a team easy.

Here’s what I did

veewee vbox tenplates | grep -i centos

This told me that the template I wanted was CentOS-6.5-x86_64-minimal

veewee vbox define centos65 CentOS-6.5-x86_64-minimal

Now I made some edits to customise the base box how I wanted

vim definitions/centos65/definition.rb # comment out the chef line
vim definitions/centos65/ # remove build packages like gcc
vim definitions/centos65/ # remove insecure vagrant key and add your own public key


veewee vbox build centos65
veewee vbox export centos65

add to my local vagrant so I can test

vagrant box add centos65 ./

Now I can copy the base box to a team-accessible server

And push my custom definition to my veewee fork so anyone from the team can build an updated box.

vim .gitignore # remove definitions/*
git add .gitignore 
git add definitions/
git commit -m "added my definition"
git push