Not much has changed since the Debian 9 preseed that I can tell.
This is a basic implementation of what is possible with preseeding.
Investigating to see what can be preseeded was quite the learning experience! You quickly find out that there isn't much recent info readily available to figure these things out.
sudo debconf-get-selections --installer > filename debconf-get-selections >> filename
/var/log/installer/cdebconf/templates.dat
/var/log/installer/cdebconf/questions.dat
I created this script to help me sort through the dat files (and to test my awk and sed skills).
You can find it in my gitlab repo as well.
mkdir ~/preseed && cd ~/preseed
wget https://gitlab.com/preseed/preseed-scripts/raw/master/filterdat
chmod +x filterdat
sudo cp /var/log/installer/cdebconf/*.dat ~/preseed
sudo chown $USER ~/preseed/*.dat
./filterdat templates.dat ./filterdat questions.dat
less ~/preseed/templates.dat.filtered less ~/preseed/questions.dat.filtered
#!/usr/bin/env bash outfile="$1.filtered" # Only print the lines we want filter_dat() { awk 'BEGIN { RS = "" ; FS = "\n" } { if ( $2 !~ /(text|error|note|title)/) { print $1 print $2 print $3 if ($4 !~ /UTF-8/) print $4 if ($5 !~ /UTF-8/) print $5 if ($6 !~ /UTF-8/) print $6 if ($7 !~ /UTF-8/) print $7 } }' $1 } # Run filter_dat then pipe output to sed to strip all empty # lines, then add one newline above Name and save it to a file filter_dat $1 | sed '/^$/d; s/Name/\n&/g' > "$outfile" printf '%s%s\n' 'Processing complete! The filtered file is: ' "$outfile"
d-i passwd/user-password insecure d-i passwd/user-password-again insecure
# Expire it at the bottom of the file d-i preseed/late_command string in-target passwd --expire chuck
# Generate the password mkpasswd -m sha-512 -S $(pwgen -ns 16 1) mypassword # Set the password d-i passwd/user-password-crypted password $6$UyIcAz99JRIjOF9d$R/x4Z6JgS0ICE5U/VhIyqKMMK29aPhlBfj1MXuFuww9i9ry9fLVy/LzfO4QPExAWAYZX97euihMU8yHtmF4wI0
Preseed partitioning is still a thorn in my side. Every time I think I have it figured out, it slaps me around for a few hours and puts me back in my place. I'll put all the links and info I've gathered below.
Please note that some of these links have moved on me from time to time and they were just a few clicks away from where I had originally bookmarked them.
You can also browse the default recipes located inside the installer.
ls /lib/partman/recipes-amd64-efi
ls /lib/partman/recipes
more
command to read the contents.Try performing the install over ssh which will allow you to select and copy the text to a file to your local machine
Here's a couple ways to install some additional programs.
d-i pkgsel/include string firmware-amd-graphics \ firmware-linux-nonfree firmware-misc-nonfree git intel-microcode libgl1-mesa-dri \ linux-headers-amd64 mesa-utils openssh-server pulseaudio vim xorg
d-i preseed/late_command string \ in-target apt-get install firmware-amd-graphics \ firmware-linux-nonfree firmware-misc-nonfree git intel-microcode libgl1-mesa-dri \ linux-headers-amd64 mesa-utils openssh-server pulseaudio vim xorg
I'm sure there are other ways, but those two are what has worked for me so far.
You can also run commands on the target system. Here's some examples:
d-i preseed/late_command string \ mkdir -p -m 700 /target/home/chuck/.ssh; \ echo "ssh-ed25519 YOURxwxPUBLICxxxSSHxyxKEYxzx" > /target/home/chuck/.ssh/authorized_keys; \ in-target chown --recursive chuck:chuck /home/chuck/.ssh; \ in-target chmod 0644 /home/chuck/.ssh/authorized_keys; \ in-target update-alternatives --set editor /usr/bin/vim.basic; \ in-target passwd --expire chuck
/target
so you can copy/create/modify the files there:d-i preseed/late_command string mkdir -p -m 700 /target/home/chuck/.ssh
d-i preseed/late_command string chroot /target <commands>
;
There's a few ways to use the preseed file.
I'll cover the first 2 for now.
https://wiki.debian.org/DebianInstaller/Preseed/EditIso
I used the following packages to complete these steps:
xorriso
isolinux
zip
unzip
mkdir isofiles
xorriso -osirrox on -indev debian.iso -extract / isofiles
chmod +w -R isofiles/install.amd
gunzip isofiles/install.amd/initrd.gz
echo preseed.cfg | cpio -H newc -o -A -F isofiles/install.amd/initrd
gzip isofiles/install.amd/initrd
chmod -w -R isofiles/install.amd
cd isofiles
chmod 666 md5sum.txt find -follow -type f -exec md5sum {} \; > md5sum.txt chmod 444 md5sum.txt
cd ..
xorriso -as mkisofs \ -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \ -c isolinux/boot.cat \ -b isolinux/isolinux.bin \ -no-emul-boot \ -boot-load-size 4 \ -boot-info-table \ -eltorito-alt-boot \ -e boot/grub/efi.img \ -no-emul-boot \ -isohybrid-gpt-basdat \ -o preseed-debian.iso \ isofiles/
After doing that a couple of times when making changes, it got a little old. I figured why not create a bash script to handle most of it for me? You can check it out at my git repo.
Take the generated iso (preseed-debian.iso if you’re using the commands from above) and write it to a USB jump drive or upload it to Proxmox.
Boot the computer/VM from it and at the menu, select Advanced Options > Automated Install.
Wait a few seconds and it should start the installation process!
If you don't feel like navigating the menu and selecting the Automated Install, follow the zero interaction steps!
cd ~/preseed/
python3 -m http.server
http://xxx.xxx.xxx.xx:8000/preseed.cfg
auto url=xxx.xxx.xxx.xx:8000/preseed.cfg
Make sure your firewall ports are open to allow access to port 8000 (or whatever port you have the http.server set to). You should see the GET request on the computer hosting the file if it all worked out.
You can configure the iso file so all you have to do is boot the machine with the iso inserted.
It will automatically select the Automated Install option from the menu and proceed with the install.
This should be done before generating the md5sums in the above steps of adding the preseed to the iso.
chmod +w isofiles/isolinux/{gtk.cfg, isolinux.cfg}
vim isofiles/isolinux/gtk.cfg
default auto label auto menu label ^Automated install menu default kernel /install.amd/vmlinuz append auto=true priority=critical vga=788 initrd=/install.amd/initrd.gz --- quiet
vim isofiles/isolinux/isolinux.cfg
# D-I config version 2.0 # search path for the c32 support libraries (libcom32, libutil etc.) path include menu.cfg default vesamenu.c32 prompt 0 timeout 1 autoselect auto
chmod -w isofiles/isolinux/{gtk.cfg, isolinux.cfg}