Small collection of basic scripts I made for Proxmox that someone may find useful.
When I made these scripts, I made them very fast and lazily because I needed them at the moment. I'll probably look into improving these to fit everyone.
Please please review each of these scripts and change it for your use case. MOST VARIABLES ARE HARDCODED, so if left unchanged it will either fuck with your system (very bad) or just fail.
-
Create vm, and then use
./vm2lxcscript to convert to lxc container -
Adjust container as needed and then make a backup as snapshot with zstd compression in the webUI
-
Find the dump directory for the drive you pointed the backup to
-
local-disk:
/var/lib/pve/local-disk/dump/ -
DIR drive:
/mnt/pve/<DIR>/dump/Hint: note the
../dump/sub-directory
- Go to appropiate datacenter shell and run the following:
$ unzstd vzdump-*.tar.zst -o mytemplate-0.1.0-minimal_20260413_amd64.tar
# For reference, templates should follow this formatting:
# [ $DISTRO-$VERSION-minimal|default_$DATE_$ARCH.tar ]
$ gzip mytemplate-0.1.0-minimal_20260413_amd64.tar
#^^^ same output file into tar.gz
$ mv mytemplate-0.1.0-minimal_20260413_amd64.tar.gz /mnt/pve/<DRIVE>/template/cache/
#^^ move file to correct drive -->- Spawn a LXC instance with the template you just made and congrats.
This is based from the article here (huge shoutout to DietPi): https://dietpi.com/blog/?p=2642