This provides the configuration and Makefile to build a Vagrant minimal base box using Packer. The base box is intended for server (terminal) use only so is restricted to a single locale (with en_US
being the default) which allows for a smaller box size.
There are templates provided for the following with x86_64
architecture:
- CentOS-7.9.2009
- CentOS-7.7.1908
- CentOS-7.6.1810
- CentOS-7.5.1804
- CentOS-7.4.1708
- CentOS-7.3.1611
- CentOS-7.2.1511
There is currently no requirement to support older minor release versions or alternative architectures but they could be added if necessary.
The build environment required is macOS or GNU Linux (Fedora 37) Intel x86_64.
To build the box files you will need the following installed. Version numbers are those tested on Fedora 37.
- VirtualBox (7.0.4_rpmfusion)
- LibVirt (8.6.0)
- Vagrant (2.2.19)
- Packer (1.8.5)
NOTE: You may need to create the VirtualBox NAT Network 10.0.2.0/24 if it doesn't already exist.
To build the latest, x86_64
base box run make
or make build
.
$ make
To build a specific release version, use the BOX_VERSION_RELEASE
variable.
$ BOX_VERSION_RELEASE=7.2.1511 make
For usage instructions run make help
.
$ make help
To build a box variant from an alternative box template use BOX_VARIANT
. The default is Minimal
but there is an alternative Minimal-Cloud-Init
template to build boxes that include Cloud-Init. The variant Minimal-AMI
will generate an ova image suitable for importing into AWS.
$ BOX_VARIANT=Minimal-Cloud-Init make
To build a box for the libvirt
provider use BOX_PROVIDER
.
$ BOX_PROVIDER=libvirt make
To install from a box file, generated by a successful build, use make install
supplied with the same environment variables used to build the require box. This will add the box and output a minimal Vagrantfile template that can be used to create a Vagrantfile in a suitable directory for testing.
$ BOX_VARIANT=Minimal-Cloud-Init make install
NOTE: If running vagrant via sudo
do the same here to ensure the box is installed for the expected user.