Automated VM deployment with Packer, Vagrant, Ansible across hypervisors
Warning
π§ Project instructions and commands under review π§
The setup and deployment instructions in this README file are currently being tested and refined.
Expect updates and improvements as I validate each step.
packertron-vms
is a collection of templates for automated VM deployment, designed for home lab environments and testing setups. Using Packer and Vagrant, it simplifies the creation, provisioning, and management of virtual machines. The templates currently support VMware Workstation (future plans include Ansible automation and expanding hypervisor support like VirtualBox, Proxmox, etc).
- packertron-vms
- Automated VM builds using Packer
- Provisioning with Vagrant
- Support for multiple OS images (Windows, Ubuntu, Kali Linux, etc)
- Customizable HCL templates and scripts
- Hypervisor-agnostic VM automation
Ensure you have the following installed before proceeding:
- Windows 10/11 or Linux
- VMware Workstation Pro (or Proxmox in future support)
- Chocolatey (Windows package manager)
- VMware Workstation
- HashiCorp Packer
- HashiCorp Vagrant
- Vagrant VMware Utility
- Vagrant VMware Plugin
- Visual Studio Code
Open PowerShell as Administrator and run:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Verify installation:
choco -?
choco install packer vagrant jq vscode -y
# choco install vmwareworkstation
# ^^ may not work anymore since vmwareworkstation URL is broken
# install with official installer - read bellow
# To upgrade
choco upgrade all
The latest VMware Workstation Pro version installer can be found at the official Broadcom link (login necessary for free download).
- More info at my wiki about the tool -> vmware-workstation.md Β· syselement/blog
- Requirement: Install Vagrant VMware Utility using the binary (for Win).
- Install
vagrant-vmware-desktop
plugin
# choco install vagrant-vmware-utility -y
# ^^ may not work anymore since vmwareworkstation dependency URL is broken
# ^^ use binary
vagrant plugin install vagrant-vmware-desktop
git clone https://github.com/syselement/packertron-vms.git
cd packertron-vms
packertron-vms/
βββ win-srv-2025/
β βββ config/ # Configuration files (autounattend.xml, unattend.xml)
β βββ output/ # VM build output
β βββ scripts/ # Automation scripts (Powershell, Batch)
β βββ vagrant/ # Vagrant Automation scripts (Powershell, Batch)
β βββ README.md # Readme file
β βββ Vagrantfile # Vagrant configuration
β βββ winserver2025.pkr.hcl # Packer HCL template
β βββ winserver2025.pkrvars.hcl # Packer variables
βββ .gitignore # Ignore unnecessary files (ISO, temp builds)
cd packertron-vms
code .
Setup the necessary variables inside the win-srv-2025\winserver2025.pkrvars.hcl
file, adjusting them accordingly based on your ISO folder, name and checksum.
Open VMware Workstation Pro (before running Packer build).
Proceed with Packer initialize and build.
cd win-srv-2025
packer init .
packer validate --var-file="winserver2025.pkrvars.hcl" "winserver2025.pkr.hcl"
packer build --var-file="winserver2025.pkrvars.hcl" "winserver2025.pkr.hcl"
cd win-srv-2025
vagrant up
# Shut down VM
vagrant halt
# Restart VM
vagrant up
# Destroy VM
vagrant destroy -f
-
VMware Workstation Not Detected? Ensure it is installed and running.
-
ISO Checksum Mismatch?
Run:
Get-FileHash C:\ISO\windows\your_iso.iso
-
Vagrant Plugin Issues?
Reinstall:
vagrant plugin repair
Released under MIT by @syselement.
Pull requests and improvements are welcome! Ensure your code follows the repoβs standards.
- Proxmox support
- O.S Packer builds:
- Win11
- Ubuntu Server/Desktop
- Kali Linux
- Integration with Ansible for advanced provisioning
π Happy Virtualizing with packertron-vms!