It is time to look into build process of Debian Vagrant box, create one using packer utility for creating machine and container images and alter the whole process it a little bit.

I will be honest with you and say that I have underestimated this utility at first, but it is irreplaceable for this kind of operation.

Install packer utility

Install unzip utility.

$ sudo apt-get install -y unzip

Download packer utility.

$ curl -O

Extract it to /usr/local/bin directory for an easy access.

$ sudo unzip -d /usr/local/bin/ packer
Note that packer is statically linked, so it will work without additional dependencies.

Download source of vanilla Debian base box

Install qemu utility as it will be used during build process.

$ sudo apt-get install -y qemu

Install git utility to download source code.

$ sudo apt-get install -y git

Clone vanilla Debian base box debian-vm-templates repository.

$ git clone git://

Build an image using packer utility

Install qemu utility.

$ sudo apt-get install -y qemu

Change working directory to packer-virtualbox-vagrant inside downloaded earlier debian-vm-templates project.

packer-virtualbox-vagrant$ cd debian-vm-templates/packer-virtualbox-vagrant/

Verify that template is valid.

packer-virtualbox-vagrant$ packer validate jessie.json

Perform build process.

packer-virtualbox-vagrant$ make

Create box file that can be used with Vagrant.

packer-virtualbox-vagrant$ make

Apply custom modifications

Modify operating system installation process

Modify http/vanilla-debian-8-jessie-preseed.cfg to alter installation process.

It is good place to modify default timezone and basic package manager settings.

Modify initial Vagrantfile

Note that file will be packaged with a box, so modify it to according to your needs. It will be loaded before other Vagrant files according to Load order and merging.

These steps will be included or performed later during Vagrant operations, not during build process.

You can use it to perform configuration steps (like nfs mounts and so on) shared across different Vagrant configurations.

Modify build process

Alter provisioners block inside jessie.json configuration file to add custom shell scripts that will be executed during build process.

You can use it to install puppet and perform other steps shared across different Vagrant configurations.


Teams – Cloud – Vagrant Base Boxes

Teams – Cloud – Rebuild Vagrant Base Boxes

Packer documentation

Vagrant – Vagrantfile

Vagrant – Package

Debian installer – Preseed