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:
- Rocky-8.8
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 38) Intel x86_64.
To build the box files you will need the following installed.
- VirtualBox (7.0.10_rpmfusion)
- LibVirt (9.0.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=8.8 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-vmi
will generate an VMDK
image suitable for importing into AWS.
To build images with an LVM partitioning scheme append the suffix -lvm
.
Build a vagrant box with cloud-init support and an LVM partition:
$ BOX_VARIANT=minimal-cloud-init-lvm make
Build an image suitable for importing to a Cloud Provider such as AWS, DigitalOcean, Oracle OCI etc.
$ BOX_VARIANT=minimal-vmi make
The default provider is libvirt
.
To build a box for the virtualbox
provider use BOX_PROVIDER
.
$ BOX_PROVIDER=virtualbox 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.