Skip to content

Automated VM deployment with Packer, Vagrant, Ansible across hypervisors

License

Notifications You must be signed in to change notification settings

syselement/packertron-vms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 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 vmwareworkstation packer vagrant jq vscode -y

3️⃣ Install Vagrant VMware Plugin

choco install vagrant-vmware-utility -y
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/
β”œβ”€β”€ 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)

πŸš€ Build & Deploy VMs

1️⃣ Open Visual Studio Code

cd packertron-vms
code .

2️⃣ Packer: Initialize & Build Windows Server 2025

cd Win2025
packer init .
packer validate --var-file="winserver2025.pkrvars.hcl" win2025.pkr.hcl
packer build --var-file="winserver2025.pkrvars.hcl" win2025.pkr.hcl

3️⃣ Deploy VM with Vagrant

cd Win2025
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
  • βœ… Ubuntu & Kali Linux Packer builds
  • βœ… 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