mirror of
https://github.com/RogerSik/proxmox-vm-template.git
synced 2026-11-17 13:34:24 +01:00
149925c094f6ad0323e3e2150c5e7c629fdf7a84
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
proxmox-vm-template
A simple script to download and create a cloud-init ready Ubuntu LTS VM on Proxmox VE.
Requirements
- Proxmox VE host, script runs as
root - Storage
local-lvmand bridgevmbr0 libguestfs-tools(installed automatically if missing)
Usage
cp ssh-keys.pub.dist ssh-keys.pub
# add your public SSH keys to ssh-keys.pub
./ubuntu-lts.sh # interactive release selection
./ubuntu-lts.sh noble # select release by codename
The script asks for a VM ID (defaults to the next free ID) and a VM name.
What it does
- Downloads the current Ubuntu cloud image to
/tmp(only if newer) and verifies its SHA256 checksum - Installs
qemu-guest-agentinto a copy of the image and resets/etc/machine-id - Creates the VM:
- 2 cores, 1024 MB memory, CPU type
x86-64-v2-AES - 32G disk with discard and SSD emulation
- Serial console, QEMU guest agent enabled
- Hotplug for disk, network, USB, memory and CPU
- Cloud-init user
devopswith keys fromssh-keys.pub, DHCP for IPv4 and IPv6 - Starts on boot
- 2 cores, 1024 MB memory, CPU type
If a step fails after the VM was created, the incomplete VM is destroyed again.
Languages
Shell
100%