Every new VM needs the same setup: enable universe, run a full upgrade, set the timezone, fix NTP, install the right guest tools and the usual packages, harden SSH, and add swap. Do that twenty times and you’ll skip a step at least once, usually the one that would have kept you out of trouble.
Ubuntu-vm-bootstrap runs the whole list for you. It checks what’s already done and asks before it changes anything.
Ubuntu installed, configured and hardened in one run.
What it does
- Core setup. Enables the universe repo, runs a full upgrade and cleanup, sets the timezone and NTP, and installs a baseline set of CLI packages.
- Guest tools for your hypervisor. It detects XCP-ng, KVM/Proxmox, VMware, Hyper-V or VirtualBox and installs the matching tools.
- Optional extras, each behind its own flag. SSH hardening with UFW, a swap file, growing the LVM root after you enlarge the disk, unattended security upgrades, and Zabbix Agent2 with PSK encryption.
- Two ways to run it. With a terminal it walks you through a wizard. Under automation it takes flags and doesn’t stop to ask questions.
Quick start
# Interactive wizard (needs a terminal): asks yes/no + confirm-default for
# every setting, applies at the end.
sudo ./ubuntu-vm-bootstrap.sh
# Non-interactive, safe preview: report intended actions, change nothing.
./ubuntu-vm-bootstrap.sh --yes --fix --dry-run --verbose
Built not to lock you out
- A plain run only reports. Nothing changes until you add
--fix, and--dry-runshows exactly what--fixwould do. --hardenwon’t turn off SSH password login until it finds an authorized key. Losing access to your own VM is not on the list.- The Zabbix PSK is printed to your terminal once and never written to a log.
The full story is in the release post.
Is it for you?
Yes, if you set up Ubuntu 22.04, 24.04 or 26.04 VMs more often than you’d like. It needs Bash 4+, and root only when it makes changes. MIT licensed.
