Packer >= 1.7.x, Vagrant >= 2.2.x and VirtualBox >= 6.1.x must be installed (beyond the scope of this document).
This Packer build generates a minimal Rocky Linux 8 or 9 core image using the virtualbox-iso
builder and a Vagrant box based on it using the vagrant
post-processor.
-
Adjust the contents of
variables-8.json
orvariables-9.json
accordingly. It's a good idea to always grab the latest upstream ISO. -
Build the box (e.g. for Rocky Linux 9):
packer build -var-file variables-9.json packer.json
-
Test the box locally:
vagrant box add --name rocky-9.3-core-20231121 rocky-9.3-core-20231121.box vagrant init --minimal rocky-9.3-core-20231121 vagrant up # test here vagrant destroy -f rm -f Vagrantfile vagrant box remove rocky-9.3-core-20231121
-
Upload the box to Vagrant Cloud: dhml/rocky-9.3-core-20231121
-
Test the box from Vagrant Cloud:
vagrant init --minimal dhml/rocky-9.3-core-20231121 vagrant up # test here vagrant destroy -f rm -f Vagrantfile vagrant box remove dhml/rocky-9.3-core-20231121
-
Update box names/versions/URLs in Vagrantfiles in other repositories that reference this box.