An example for setting up Windows VMs using Packer for Proxmox
- *Packer (I recommend using Chocolatey)
- *VirtIO Drivers ISO
- Proxmox
- Windows Server 2022 ISO
- imgburn (or similar) to create the autounattend ISO
* = Required
Run the following commands to build your Windows Server 2022 Proxmox template:
Initialize Packer:
packer init -var-file "variables.pkrvars.hcl" ./windows-2022.pkr.hcl
Validate the Packer template configuration:
packer validate -var-file "variables.pkrvars.hcl" ./windows-2022.pkr.hcl
Build the Packer template:
packer build -var-file "variables.pkrvars.hcl" ./windows-2022.pkr.hcl
Tip: You can also use just a single . if you want to automate without knowing the name of the packer configuration.
packer build -var-file "variables.pkrvars.hcl" .
You can set the debug flag in powershell using:
$Env:PACKER_LOG="1"
You will then see debug log messages in the terminal and get a text copy in the same directory as where you ran packer.