| 1 | #### Debian 13 (trixie) unattended netinst preseed |
| 2 | #### Generic base-OS bootstrap — gets a blank VM to "Debian installed, SSH + |
| 3 | #### sudo reachable" so provision-satellite.sh can take over from there. |
| 4 | #### Not satellite-specific beyond that; hostname/domain are passed as |
| 5 | #### separate boot params (hostname=... domain=...), not hardcoded here, so |
| 6 | #### this file is reusable for any future from-scratch rebuild. |
| 7 | #### |
| 8 | #### Usage: serve this file over HTTP reachable from the VM's network, then |
| 9 | #### at the installer's boot menu (Tab to edit on isolinux/BIOS boot): |
| 10 | #### auto=true priority=critical url=http://<host>:<port>/debian-preseed.cfg hostname=<name> domain=<domain> |
| 11 | |
| 12 | ### Localization |
| 13 | d-i debian-installer/locale string en_CA.UTF-8 |
| 14 | d-i keyboard-configuration/xkb-keymap select us |
| 15 | |
| 16 | ### Network |
| 17 | d-i netcfg/choose_interface select auto |
| 18 | d-i netcfg/get_hostname string unassigned-hostname |
| 19 | d-i netcfg/get_domain string unassigned-domain |
| 20 | d-i netcfg/wireless_wep string |
| 21 | |
| 22 | ### Mirror |
| 23 | d-i mirror/country string manual |
| 24 | d-i mirror/http/hostname string deb.debian.org |
| 25 | d-i mirror/http/directory string /debian |
| 26 | d-i mirror/http/proxy string |
| 27 | |
| 28 | ### Clock and time zone |
| 29 | d-i clock-setup/utc boolean true |
| 30 | d-i time/zone string America/Toronto |
| 31 | d-i clock-setup/ntp boolean true |
| 32 | |
| 33 | ### Account setup — normal user only, root login disabled (sudo instead). |
| 34 | ### Initial password is a dummy placeholder, overwritten in late_command to preseed-<MAC>. |
| 35 | d-i passwd/root-login boolean false |
| 36 | d-i passwd/user-fullname string debian |
| 37 | d-i passwd/username string debian |
| 38 | d-i passwd/user-password password bootstrap-temp-pw |
| 39 | d-i passwd/user-password-again password bootstrap-temp-pw |
| 40 | d-i user-setup/allow-password-weak boolean true |
| 41 | d-i passwd/user-default-groups string sudo |
| 42 | |
| 43 | ### Partitioning — dynamic first disk selection, guided layout, UEFI & BIOS safe |
| 44 | d-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" |
| 45 | d-i partman-auto/method string regular |
| 46 | d-i partman-auto/choose_recipe select atomic |
| 47 | d-i partman-partitioning/confirm_write_new_label boolean true |
| 48 | d-i partman/choose_partition select finish |
| 49 | d-i partman/confirm boolean true |
| 50 | d-i partman/confirm_nooverwrite boolean true |
| 51 | |
| 52 | ### Package selection — minimal + SSH only + ca-certificates for HTTPS key fetch |
| 53 | tasksel tasksel/first multiselect standard, ssh-server |
| 54 | d-i pkgsel/include string sudo ca-certificates |
| 55 | d-i pkgsel/upgrade select safe-upgrade |
| 56 | popularity-contest popularity-contest/participate boolean false |
| 57 | |
| 58 | ### Boot loader — dynamic device target for BIOS (MBR) and UEFI |
| 59 | d-i grub-installer/only_debian boolean true |
| 60 | d-i grub-installer/with_other_os boolean true |
| 61 | d-i grub-installer/bootdev string default |
| 62 | |
| 63 | ### Post-install setup — MAC fallback hostname, MAC password, and SSH key pull |
| 64 | d-i preseed/late_command string \ |
| 65 | MAC=$(ip link | awk '/ether/ {print $2; exit}'); \ |
| 66 | HN=$(cat /target/etc/hostname 2>/dev/null); \ |
| 67 | if [ "$HN" = "unassigned-hostname" ] || [ -z "$HN" ]; then \ |
| 68 | SHORT_MAC=$(echo "$MAC" | tr -d ':'); \ |
| 69 | HN="vm-${SHORT_MAC: -6}"; \ |
| 70 | echo "$HN" > /target/etc/hostname; \ |
| 71 | sed -i "s/unassigned-hostname/$HN/g" /target/etc/hosts; \ |
| 72 | fi; \ |
| 73 | in-target sh -c "echo debian:preseed-$MAC | chpasswd"; \ |
| 74 | in-target mkdir -p /home/debian/.ssh; \ |
| 75 | in-target wget -O /home/debian/.ssh/authorized_keys https://git.ergosteur.com/ergosteur.keys; \ |
| 76 | in-target chown -R debian:debian /home/debian/.ssh; \ |
| 77 | in-target chmod 700 /home/debian/.ssh; \ |
| 78 | in-target chmod 600 /home/debian/.ssh/authorized_keys |
| 79 | |
| 80 | ### Finish installation |
| 81 | d-i finish-install/reboot_in_progress note |
| 82 | d-i cdrom-detect/eject boolean true |
ergosteur / Debian Preseed for MCP Control
Last active 1 month ago
Debian 13 (trixie) unattended netinst preseed Generic base-OS bootstrap — gets a blank VM to "Debian installed, SSH + sudo reachable" so provision-satellite.sh can take over from there. Not satellite-specific beyond that; hostname/domain are passed as separate boot params (hostname=... domain=...), not hardcoded here, so this file is reusable for any future from-scratch rebuild. Usage: serve this file over HTTP reachable from the VM's network, then at the installer's boot menu (Tab to edit on isolinux/BIOS boot): auto=true priority=critical url=http://<host>:<port>/debian-preseed.cfg hostname=<name> domain=<domain> See ../provision-satellite.sh and ../docs/ for the rest of the setup this hands off to.
Revision b4ccd213a36c3e4d25194888a75956b35beb2668