This is a tutorial to rebuild Teams/Cloud/VagrantBaseBoxes yourself.

Requirements

Installing Packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration. Packer is written in Go.

Dependencies for building

sudo apt install packer qemu-kvm moreutils jq libxml-writer-perl libguestfs-perl uuid-runtime

Dependencies for testing and dev tools

sudo apt install vagrant virtualbox

NOTE: virtualbox is in contrib because the emulator part requires a BIOS that can only be compiled with a non-free compiler. However we're using here only to test the Vagrant box, it is not required for building the box.

Rebuild the vanilla Debian base boxes

Checkout the debian-vm-templates git repo:

git clone https://salsa.debian.org/cloud-team/vagrant-boxes

Validate a template before building

cd debian-vm-templates/packer-virtualbox-vagrant
packer validate jessie.json

Rebuild the box. This will start a VirtualBox virtual machine, in which a preseeded debian installer will run:

packer build jessie.json

This produces only a RAW Qemu image, however. To produce a BOX file as expected by Vagrant, you should probably use the wrapper scripts provided in the Makefile, which also test the box:

#build a Jessie base box, and test it is working as expected
make jessie.tested

The resulting box will be in jessie.box.

If you see the following error when trying to build a basebox:

ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy

It's most likely because VirtualBox is still running a VM. You may need to shutdown (vagrant halt) all running VMs to complete the build.