There are many builder plugins - this project will look only at virtualbox and vmware
$echo "alias 'packer=/mnt/c/HashiCorp/Packer/bin/packer.exe'" >> ~/.bashrc
cd packer
$packer validate templates/rhel8/gold.pkr.hcl
$packer fmt templates/rhel8/gold.pkr.hcl
$update-gold-md5
(Get the ISO md5)
$packer build templates/rhel8/gold.pkr.hcl
$revert-md5-placeholder
(Remove the ISO md5)
For convenience - added small noddy script to clean up the info.json and gold.pkr.hcl before and after builds
$create-packer-iso <format|validate|build|force>
Running packer build will create a build folder containing both an OVF and a VMDK and also output a Vagrant BOX file.
Right click on the OVF and Open-With either Virtualbox or VMware Workstation Player to import and create new VMs
Edit any settings cush as the VM name then select ‘Finish’ and wait for the ‘Importing appliance …’ process to complete which will build a new VM in a powered off state.
Even though this Packer template has not yet created a vmware image - we can still import the OVF into VMware Workstation Player - you will be prompted to set a name and the location. When ready hit the ‘Import’ button and wait. Unlike VirtualBox these VMs will be created in a powered on state.
You may see this prompt - just hit ‘Retry’ and the image will be imported and VMs created.
This is what the packer build process looks like…
$packer build templates/rhel8/gold.pkr.hcl
You may now ADD the Vagrant BOX and procede as per Vagrant instructions.