Automated Ubuntu Server virtual machine builder using Packer and VMware Fusion/Workstation. This project creates baseline Ubuntu Server virtual machines from the latest daily builds with automated provisioning using cloud-init
.
- Latest Ubuntu Server: Uses daily builds from Ubuntu's official repository.
- Automated Setup: Fully automated virtual machine creation with cloud-init
- Cross-Platform: Supports both VMware Fusion (macOS) and VMware Workstation (Windows/Linux)
- Architecture Support: Works with both AMD64 and ARM64 architectures.
- Secure Random Passwords: Cryptographically secure password generation.
- Override Support: Customize virtual machine settings without modifying core files.
- Force Build: Automatically overwrites existing VMs for clean builds.
- Packer (>= 1.0)
- VMware Fusion 13 (macOS) or VMware Workstation 17 (Windows/Linux)
curl
- for downloading ISO filesopenssl
- for password encryption
-
Clone the repository
git clone https://github.com/tenthirtyam/packer-vmware-desktop-ubuntu-daily cd packer-vmware-desktop-ubuntu-daily
-
Run the build script
./ubuntu-daily.sh
-
Wait for completion The script will automatically:
- Download the latest Ubuntu Server daily ISO
- Validate checksums
- Overwrite any existing VMs
- Build the virtual machine using Packer
- Create a snapshot
- Clean up temporary files
- VM Name:
ubuntu-YYYYMMDD-{arch}
(e.g.,ubuntu-20250911-arm64
) - Username:
ubuntu
- Password: Cryptographically secure random (12 characters)
- Memory: 4GB
- Disk: 20GB
- CPUs: 2 cores
- Locale:
en_US.UTF-8
- Keyboard Layout:
us
- Timezone:
UTC
# Use auto-generated secure password.
./ubuntu-daily.sh
# Use custom password (prompts securely).
./ubuntu-daily.sh --password=<your_password>
# Show help.
./ubuntu-daily.sh --help
- Auto-generated: Cryptographically secure (12 characters) using OpenSSL.
- Custom passwords: Prompted securely (no echo) with confirmation.
- No command-line exposure: Passwords never appear in shell history.
- Validation: Ensures passwords are not empty and match confirmation.
- ISO Files:
./iso/
(created automatically) - Virtual Machine Output:
./output/
(created automatically)
Create an overrides.pkrvars.hcl
file to customize the settings without modifying the main configuration:
# Copy the example file.
cp overrides.pkrvars.hcl.example overrides.pkrvars.hcl
# Edit with your preferred settings.
vim overrides.pkrvars.hcl
# Hardware Settings
vm_cpu = 4
vm_memory = 12288
vm_disk_size = 102400
# Locale & Timezone Settings
locale = "en_GB"
keyboard_layout = "uk"
timezone = "Europe/London"
# Extended Timeout Settings
ssh_timeout = "30m"
shutdown_timeout = "20m"
The script automatically detects and uses overrides.pkrvars.hcl
if present.
The build process follows these steps:
- Validation: Checks for required tools and dependencies
- Password Generation: Creates cryptographically secure random password
- ISO Download: Downloads the latest Ubuntu Server daily ISO
- Checksum Verification: Validates ISO integrity
- Packer Initialization: Initializes Packer plugins
- Configuration Validation: Validates Packer configuration
- VM Creation: Creates and configures the virtual machine
- OS Installation: Automated Ubuntu installation via cloud-init
- Post-Processing: Creates snapshot and cleans up files
After successful completion, you'll find the virtual machine in output/
.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
Copyright © 2025 Ryan Johnson
Licensed under the MIT License.