This will make more sense when you start using variables. It's a good practice to keep configuration files in separate folders. To configure our basic image we need answer file with two scripts to configure WinRM and VMware Tools installation.
WINDOWS ISO IMAGE BASIC ISO
Next we define iso paths for Windows and VMware Tools:ġ "floppy_files": The ip_settle_timeout defines amount of time to wait for VM's IP to settle down, sometimes VM may report incorrect IP initially, then its recommended to set that parameter to apx. The vsphere-clone builder is used to clone existing image and perform necessary changes on existing template.ġ "vcenter_server": "", 2 "username":, 3 "password": "VMware1!", 4 "insecure_connection": "true", 5 6 "vm_name": "Windows2016-Template", 7 "folder": "Packer", 8 "datacenter": "DC01", 9 10 "cluster": "CL01", 11 "datastore": "DS-Intel-SSD", 12 "network_adapters":, 41 "ip_settle_timeout": "120s", 42 vSphere-iso is used to build the image from iso file, and we will use this in our case. A vsphere-iso and vsphere-clone builders are designed for vSphere environment although those are used for different purposes. VMware builder is used to build images on VMware Workstation/Fusion platforms. HashiCorp delivers vmware, vsphere-iso and vsphere-clone builders. First we define builder that we want to use. Main JSON template file where we specify your image configuration and parameters. Windows Server 2016 installation iso file.Windows answer file for unattended installation.To build very basic Windows image using Packer we will need just few files.
WINDOWS ISO IMAGE BASIC HOW TO
If you didn't check this blog post how to create it using Terraform. I assume you have already created dedicated account with proper role and permissions on your vSphere environment.
WINDOWS ISO IMAGE BASIC INSTALL
I guarantee that once you will start using Chocolatey you will never again go back and install applications through Windows installer.Īfter you install Chocolatey, run fallowing command from PowerShell:Ģsudo apt-add-repository "deb $(lsb_release -cs ) main" 3sudo apt-get update & sudo apt-get install packerīuild basic Windows 2016 image on vSphere Chocolatey use same concept, but on Windows. On Linux you use yum or apt to obtain packages on your machine. If you are not familiar with Chocolatey, it's a package manager for Windows. If you use Windows as I am, simplest way to install Packer is to use Chocolatey. Installing Packer on Windowsīefore we dive in into building our first image we need to install Packer on our machine. Packer is delivered as single binary that is available for Windows, Linux or Mac. If you don't know what Packer builders, provisioners or post-processors are, check out my previous blog entry. We will look how to use provisioners, post-processors and variables in later posts. This mean our image won't be customized at all. In this blog post we will use only Packer vSphere builder, without any provisioner, post-processor or variables. This will be very simple Windows installation to demonstrate how Packer works. In this blog post I will demonstrate how to build basic Windows 2016 image on vSphere using Packer.