Skip to content

Instantly share code, notes, and snippets.

@david-shepard
Last active September 22, 2025 21:39
Show Gist options
  • Select an option

  • Save david-shepard/9dc21db3f773e18ea66e82496fcd486e to your computer and use it in GitHub Desktop.

Select an option

Save david-shepard/9dc21db3f773e18ea66e82496fcd486e to your computer and use it in GitHub Desktop.
Reuse a LXC Container Config in Proxmox
#!/bin/bash
if [[ "$#" != 2 ]]; then
echo "Usage $0 <config path> <hostname>"
exit 1
fi
mapfile -t configs < <(ls -1 /etc/pve/lxc/)
last_config="${configs[-1]%%.*}"
new_config=$((last_config+1))
pct create "$new_config" local:vztmpl/ubuntu-20.04-standard_20.04.1-1_amd64.tar.gz \
--config "$1" \
--hostname "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment