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 vmwareworkstation packer vagrant jq vscode -y
choco install vagrant-vmware-utility -y
vagrant plugin install vagrant-vmware-desktop
git clone https://github.com/syselement/packertron-vms.git
cd packertron-vms
packertron-vms/
βββ Win2025/
β βββ config/ # Configuration files (autounattend.xml, unattend.xml)
β βββ scripts/ # Automation scripts (Powershell, Batch)
β βββ variables.pkrvars.hcl # Packer variables
β βββ win2025.pkr.hcl # Packer HCL template
β βββ vagrantfile # Vagrant configuration
β βββ output/ # VM build output
βββ .gitignore # Ignore unnecessary files (ISO, temp builds)
cd packertron-vms
code .
cd Win2025
packer init .
packer validate --var-file="winserver2025.pkrvars.hcl" win2025.pkr.hcl
packer build --var-file="winserver2025.pkrvars.hcl" win2025.pkr.hcl
cd Win2025
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
- β Ubuntu & Kali Linux Packer builds
- β Integration with Ansible for advanced provisioning
π Happy Virtualizing with packertron-vms!