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: packer
andpassword: packer
. And for Vagrant builds, they will also have the normalusername: vagrant
andpassword: 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.json
In 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@pam
NOTE: All Proxmox builds have
cloud-init
installed and ready for usage.
In order to leverage the proper acceleration for QEMU builds, do the following:
Linux hosts:
export QEMU_ACCEL=kvm
macOS hosts:
export QEMU_ACCEL=hvf
NOTE: The
vagrant
builder is currently only used for testing. So, this builder is excluded from Vagrant and Vagrant Cloud post-processors. The default provider is set asvirtualbox
as 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-ovf
builder 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.json
Once 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.json
NOTE: The
vmware-vmx
builder 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.json
Once 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.json
In 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 [email protected]
export VSPHERE_VCENTER_SERVER=vcenter.local
Ansible 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=yourusername
MIT
Larry Smith Jr.