Skip to content

Add Proxmox LXC creator script - #36

Merged
modem7 merged 3 commits into
masterfrom
feature/lxc-create-script
Oct 11, 2026
Merged

modem7 merged 3 commits into
masterfrom
feature/lxc-create-script

Conversation

@modem7

@modem7 modem7 commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Adds Bash/Proxmox Scripts/LXC Template/create-lxc.sh, the container counterpart of create-ubuntu-cloud-template.sh.

What it does

  • Builds an Ubuntu or Debian container from the Proxmox pveam templates.
  • Leaves it running, or cleans it and converts it to a template with --template.
  • Same interface as the VM script: prompts, --config, --unattended, --ctid / --auto-ctid, --force-overwrite (templates only).
  • Answers can be saved as a profile at the summary.
  • Optional features, all off by default, asked in interactive runs or set in a profile: Ansible and admin users (SSH key only), zsh and dotfiles, Postfix relay, unattended-upgrades, snapd removal, IPv6 off, pip system-wide, sudo coredump fix, keyctl.
  • Hooks: UPLOAD_FILES and PROVISION_SCRIPTS.
  • Clones of a template get their own SSH host keys and mail sender name on first boot (ct-identity.service).

Design notes are in docs/superpowers/specs/2026-10-11-lxc-create-script-design.md.

Testing

  • bash -n and shellcheck: clean apart from SC2015 info notes.
  • The generated in-container script was run end to end (provision then seal) in debian:13 and ubuntu:24.04 Docker containers with every feature on.
  • Container mode run on Proxmox VE 9.2 (Ubuntu 26.04, static IP, VLAN, admin user): built and left running.
  • Template mode (--template) has not been run on a Proxmox host yet. The interactive feature prompts were tested with scripted answers only.

Builds an Ubuntu or Debian container from the pveam templates and either leaves it running or converts it to a template. Follows the conventions of the Ubuntu cloud template script: profiles, --unattended, optional features and hooks.
Interactive runs now ask about the optional features and start at boot. Commands run in the container with C.UTF-8, so the host locale no longer causes warnings before it is generated. Proxmox firewall bridges (fwbr*) are left out of the bridge list.
@modem7
modem7 marked this pull request as ready for review October 11, 2026 13:34
@modem7
modem7 merged commit 557d939 into master Oct 11, 2026
1 check passed
@modem7
modem7 deleted the feature/lxc-create-script branch October 11, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant