The Packer Plugin for VMware is a multi-component plugin that can be used with Packer to create virtual machine images for use with VMware vSphere Hypervisor and desktop hypervisor products such as VMware Fusion Pro, VMware Workstation Pro, and VMware Workstation Player,
The plugin includes two builders which are able to create images, depending on your desired strategy:
-
vmware-iso
- This builder creates a virtual machine, installs an operating system from an ISO, provisions software within the operating system, and then exports the virtual machine as an image. This is best for those who want to start by creating a base image. -
vmware-vmx
- This builder imports an existing virtual machine (from a.vmx
file), runs provisioners on the virtual machine, and then exports the virtual machine as an image. This is best for those who want to start from an existing virtual machine as the source. You can feed the artifact of this builder back into Packer to iterate on a machine image.
While both this plugin and the packer-plugin-vsphere
are designed to create
virtual machine images, there are some key differences:
-
Platforms: This plugin facilitates the creation of virtual machine images by integrating with VMware vSphere Hypervisor and desktop virtualization products such as VMware Fusion Pro, VMware Workstation Pro, and VMware Workstation Player; without using the VMware vSphere API. On the other hand,
packer-plugin-vsphere
is specifically developed to utilize the VMware vSphere API, facilitating the creation of virtual machine images by integrating with VMware vCenter Server and the VMware vSphere Hypervisor. -
Focus: This plugin is purpose-built with a focus on VMware vSphere Hypervisor and desktop virtualization products such as VMware Fusion Pro, VMware Workstation Pro, and VMware Workstation Player. In contrast,
packer-plugin-vsphere
, includes builders and post-processors with a focus on VMware vSphere, offering capabilities such as creating virtual machine images, cloning and modifying base virtual machine images, and exporting artifacts in specified locations and formats.
Please refer to the documentation for each plugin to understand the specific capabilities and configuration options.
Desktop Hypervisor:
- VMware Fusion Pro (macOS)
- VMware Workstation Pro (Linux and Windows)
- VMware Workstation Player (Linux)
Bare Metal Hypervisor:
- VMware vSphere Hypervisor
The plugin supports versions in accordance with the Broadcom Product Lifecycle.
Go:
-
Required if building the plugin.
For a few examples on how to use this plugin with Packer refer to the example template directory.
Packer v1.7.0 and later supports the packer init
command which enables the
automatic installation of Packer plugins. For more information, see the
Packer documentation.
To install this plugin, copy and paste this code (HCL2) into your Packer
configuration and run packer init
.
packer {
required_version = ">= 1.7.0"
required_plugins {
vmware = {
version = ">= 1.0.0"
source = "github.com/hashicorp/vmware"
}
}
}
You can download pre-built binary releases of the plugin on GitHub. Once you have downloaded the latest release archive for your target operating system and architecture, extract the release archive to retrieve the plugin binary file for your platform.
To install the downloaded plugin, please follow the Packer documentation on installing a plugin.
If you prefer to build the plugin from sources, clone the GitHub repository
locally and run the command go build
from the repository root directory. Upon
successful compilation, a packer-plugin-vmware
plugin binary file can be found
in the root directory.
To install the compiled plugin, please follow the Packer documentation on installing a plugin.
For more information on how to configure the plugin, please see the plugin documentation.
vmware-iso
builder documentationvmware-vmx
builder documentation
-
If you think you've found a bug in the code or you have a question regarding the usage of this software, please reach out to us by opening an issue in this GitHub repository.
-
Contributions to this project are welcome: if you want to add a feature or a fix a bug, please do so by opening a pull request in this GitHub repository. In case of feature contribution, we kindly ask you to open an issue to discuss it beforehand.