Better structure

This commit is contained in:
jostein@valkyrie3.skyfritt.net 2025-10-08 21:45:36 +02:00
parent 9b37643d89
commit 1a19086934

View file

@ -4,17 +4,34 @@ source: [https://forum.proxmox.com/threads/pve9-create-a-vm-template-for-a-debia
### Tools man-pages
* virt-customize: [https://manpages.debian.org/trixie/guestfs-tools/virt-customize.1.en.html](https://manpages.debian.org/trixie/guestfs-tools/virt-customize.1.en.html)
* qemu-img: [ ]}
Install mandatory tools for image customization:
``` ```
apt install libguestfs-tools #needed for the virt-customize tool apt install libguestfs-tools
```
wget https://cloud.debian.org/images/cloud/trixie/latest/debian-13-genericcloud-amd64.qcow2 #the current Trixie latest cloud image available Download the latest cloudinit-image for Trixie:
```
wget https://cloud.debian.org/images/cloud/trixie/latest/debian-13-genericcloud-amd64.qcow2
```
Verify cheksum against: [https://cloud.debian.org/images/cloud/trixie/latest/SHA512SUM](https://cloud.debian.org/images/cloud/trixie/latest/SHA512SUM)
```
sha512sum debian-13-genericcloud-amd64.qcow2 #check against https://cloud.debian.org/images/cloud/trixie/latest/SHA512SUMS sha512sum debian-13-genericcloud-amd64.qcow2 #check against https://cloud.debian.org/images/cloud/trixie/latest/SHA512SUMS
```
customize the image:
#customize the image: ```
virt-customize -a debian-13-genericcloud-amd64.qcow2 --install qemu-guest-agent,curl,wget,nano,rsync,htop,tmux #tools I like to add virt-customize -a debian-13-genericcloud-amd64.qcow2 --install qemu-guest-agent,curl,wget,nano,rsync,htop,tmux #tools I like to add
virt-customize -a debian-13-genericcloud-amd64.qcow2 --run-command "sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config" #to enable root login which is off by default virt-customize -a debian-13-genericcloud-amd64.qcow2 --run-command "sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config" #to enable root login which is off by default
@ -22,10 +39,10 @@ virt-customize -a debian-13-genericcloud-amd64.qcow2 --run-command "sed -i 's/#P
virt-customize -a debian-13-genericcloud-amd64.qcow2 --run-command "sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config" #to enable SSH authentication by password - my use choice virt-customize -a debian-13-genericcloud-amd64.qcow2 --run-command "sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config" #to enable SSH authentication by password - my use choice
qemu-img convert -O qcow2 -c -o preallocation=off debian-13-genericcloud-amd64.qcow2 debian-13-genericcloud-amd64-shrink.qcow2 #convert & compress qcow2 image qemu-img convert -O qcow2 -c -o preallocation=off debian-13-genericcloud-amd64.qcow2 debian-13-genericcloud-amd64-shrink.qcow2 #convert & compress qcow2 image
```
#send image to PVE host: #send image to PVE host:
```
scp debian-13-genericcloud-amd64-shrink.qcow2 root@........................... #enter desired location on host node scp debian-13-genericcloud-amd64-shrink.qcow2 root@........................... #enter desired location on host node
``` ```