diff --git a/.vscode/settings.json b/.vscode/settings.json index e68f961..92f2d4e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,7 @@ "editor.formatOnSave": true, "editor.formatOnPaste": false, "files.associations": { - ".ssh-keys.pub": "plaintext" + "ssh-keys.pub": "plaintext" }, "[shellscript]": { "editor.defaultFormatter": "foxundermoon.shell-format" diff --git a/README.md b/README.md index cc567cb..b27af0d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,35 @@ # proxmox-vm-template -A simple script to download and create a cloud init ready Ubuntu LTS vm. +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-lvm` and bridge `vmbr0` +- `libguestfs-tools` (installed automatically if missing) + +## Usage + +```bash +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 + +1. Downloads the current Ubuntu cloud image to `/tmp` (only if newer) and verifies its SHA256 checksum +2. Installs `qemu-guest-agent` into a copy of the image and resets `/etc/machine-id` +3. 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 `devops` with keys from `ssh-keys.pub`, DHCP for IPv4 and IPv6 + - Starts on boot + +If a step fails after the VM was created, the incomplete VM is destroyed again.