Skip to content

syselement/packertron-vms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

packertron-vms

Automated VM deployment with Packer, Vagrant, Ansible across hypervisors

syselement - packertron-vms stars - packertron-vms forks - packertron-vms License

Package - Packer Package - Vagrant Package - VMware Workstation Pro

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).


πŸ“– Table of Contents


πŸš€ Features

  • 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

πŸ›  Requirements

Ensure you have the following installed before proceeding:

System Requirements

  • Windows 10/11 or Linux
  • VMware Workstation Pro (or Proxmox in future support)

Software Dependencies


πŸ”§ Installation

1️⃣ Install Chocolatey (Windows Users Only)

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 -?

2️⃣ Install Dependencies

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).

3️⃣ Install Vagrant VMware Plugins

# choco install vagrant-vmware-utility -y
# ^^ may not work anymore since vmwareworkstation dependency URL is broken
# ^^ use binary

vagrant plugin install vagrant-vmware-desktop

4️⃣ Clone packertron-vms Repository

git clone https://github.com/syselement/packertron-vms.git
cd packertron-vms

πŸ“ Directory Structure

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)

πŸš€ Build & Deploy VMs

1️⃣ Open Visual Studio Code

cd packertron-vms
code .

2️⃣ Packer: Initialize & Build Windows Server 2025

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"

3️⃣ Deploy VM with Vagrant

cd win-srv-2025
vagrant up

4️⃣ Manage VM Lifecycle

# Shut down VM
vagrant halt

# Restart VM
vagrant up

# Destroy VM
vagrant destroy -f

πŸ›  Troubleshooting

  • 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

πŸ“œ License

Released under MIT by @syselement.

🀝 Contributing

Pull requests and improvements are welcome! Ensure your code follows the repo’s standards.

🌍 Future Roadmap

  • Proxmox support
  • O.S Packer builds:
    • Win11
    • Ubuntu Server/Desktop
    • Kali Linux
  • Integration with Ansible for advanced provisioning

πŸš€ Happy Virtualizing with packertron-vms!

About

Automated VM deployment with Packer, Vagrant, Ansible across hypervisors

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •