After many years of maintaining my original Packer-Templates project. I've decided to bring my Packer templates into an even more consumable format. Hence this project.
The following table represents all distros including versions and builders supported.
| Distro | Version | Server/Desktop | Template | Builder |
|---|---|---|---|---|
Arch |
Latest |
Server | Arch/arch.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf |
CentOS |
7 |
Server | CentOS/centos7.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
CentOS |
7 |
Desktop | CentOS/centos7-desktop.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
CentOS |
8 |
Server | CentOS/centos8.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
Debian |
Buster |
Server | Debian/debian-buster64.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
Debian |
Stretch |
Server | Debian/debian-stretch64.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
Fedora |
31 |
Server | Fedora/fedora31.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
Fedora |
32 |
Server | Fedora/fedora32.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
Ubuntu |
Bionic |
Server | Ubuntu/ubuntu-bionic64.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
Ubuntu |
Bionic |
Desktop | Ubuntu/ubuntu-bionic64-desktop.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
Ubuntu |
Focal |
Server | Ubuntu/ubuntu-focal64.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
Ubuntu |
Focal |
Desktop | Ubuntu/ubuntu-focal64-desktop.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
Ubuntu |
Xenial |
Server | Ubuntu/ubuntu-xenial64.json |
proxmox, qemu, vagrant, virtualbox-iso, virtualbox-ovf, vmware-iso, vmware-vmx, vsphere-iso |
NOTE: All distros are built with
username: packerandpassword: packer. And for Vagrant builds, they will also have the normalusername: vagrantandpassword: vagrant.
Using the table from above:
- Find the
Distro - Find the
Version - Find the
Template - Find the
Builder
Once you've chosen the information from above, you can then build the respective image.
We will use Ubuntu Bionic for the example using the virtualbox-iso builder.
cd Ubuntu
packer build -only virtualbox-iso ubuntu-bionic64.jsonIn order to build Proxmox images, do the following:
NOTE: Replace values which represent your environment.
export PROXMOX_NODE=pve-02
export PROXMOX_PASSWORD=packer
export PROXMOX_URL=https://192.168.2.22:8006/api2/json
export PROXMOX_USER=root@pamNOTE: All Proxmox builds have
cloud-initinstalled and ready for usage.
In order to leverage the proper acceleration for QEMU builds, do the following:
Linux hosts:
export QEMU_ACCEL=kvmmacOS hosts:
export QEMU_ACCEL=hvfNOTE: The
vagrantbuilder is currently only used for testing. So, this builder is excluded from Vagrant and Vagrant Cloud post-processors. The default provider is set asvirtualboxas well.
The Vagrant builder is useful for testing an existing Vagrant box that has already been published (you may want to change this).
NOTE: The
virtualbox-ovfbuilder is currently only used for testing. So, this builder is excluded from Vagrant and Vagrant Cloud post-processors.
To properly use the virtualbox-ovf builder, you must first build a
virtualbox-iso image.
Example usage:
packer build -only virtualbox-iso distro-version.jsonOnce you have built a virtualbox-iso, there will be a symlink created to the
latest version built. This is the source_path used for the virtualbox-ovf
builder.
Example usage of virtualbox-ovf:
packer build -only virtualbox-ovf distro-version.jsonNOTE: The
vmware-vmxbuilder is currently only used for testing. So, this builder is excluded from Vagrant and Vagrant Cloud post-processors.
To properly use the vmware-vmx builder, you must first build a
vmware-iso image.
Example usage:
packer build -only vmware-iso distro-version.jsonOnce you have built a vmware-iso, there will be a symlink created to the
latest version built. This is the source_path used for the vmware-vmx
builder.
Example usage of vmware-vmx:
packer build -only vmware-vmx distro-version.jsonIn order to build vSphere images, do the following:
NOTE: Replace values which represent your environment.
export VSPHERE_CLUSTER=Compute
export VSPHERE_DATACENTER=ATL
export VSPHERE_DATASTORE=Datastore
export VSPHERE_FOLDER=Templates
export VSPHERE_NETWORK=Default
export VSPHERE_PASSWORD=VMw@re!
export VSPHERE_USERNAME=administrator@vsphere.local
export VSPHERE_VCENTER_SERVER=vcenter.localAnsible will be used for all provisioning of these Packer templates. Whereas,
previously it was a mixture of Shell and PowerShell scripts.
To properly upload to Vagrant cloud, do the following:
export VAGRANT_CLOUD_TOKEN=yourapitoken
export VAGRANT_CLOUD_USER=yourusernameMIT
Larry Smith Jr.
