Regarding your first question, I don't think there's any easier way to enable automated install for debian installer
in terms of passing the preseed file to it. Mounting a second image could be a good idea for your specific need, but AFAIK debian installer
does not respect a second media for its preseed and there are no workarounds that I know of (FYI, ubuntu's subiquity
installer does support such input).
To achieve a "no-hands" install, I'll explain 2 things that should be taken care of.
Debian installer config (preseed)
To make the debian installer
go fully automatic, you'll need this in your preseed file:
d-i debconf/priority select critical
This will simply tell debian installer
not to ask questions it can find an answer to.
In addition to that, you need to enable the auto mode with d-i auto-install/enable boolean true
, but ignore this for now (I'll talk about auto mode in the next part).
From auto mode
doc:
The auto kernel parameter is an alias for auto-install/enable and setting it to true delays the locale and keyboard questions until after there has been a chance to preseed them, while priority is an alias for debconf/priority and setting it to critical stops any questions with a lower priority from being asked.
P.S. You can pass some the question/answers as kernel parameters with key=value
format, where key
is an alias. That requires changing boot parameters. See the full list: aliases useful with preseeding
Bootloader config
In addition to installer configuration, we need to make some changes to the bootloader too. For isolinux
bootloader to work in an unattended install scenario, I make these 2 changes to its config files inside the iso:
- Set auto mode via a kernel parameter.
- Tell
isolinux
auto-select the default entry in the menu.
First change is done by adding auto=true
to the append
line of the default menu entry. For debian 11, I found "Graphical install" to be the default entry. Since the config for this entry is read from isolinux/gtk.cfg
, this change should be applied in that file. e.g. you can change your example bootloader config append line to "append auto=true vga=..."
.
Second goal is achieved by changing timeout 0
to timeout 1
in isolinux/isolinux.cfg
(see this).
Note 1: The auto=true
kernel parameter is the alias for d-i auto-install/enable boolean true
preseed config. It turned out that it should be enabled by kernel parameters for some reasons. Putting its equivalent in preseed file still ends up in language selection prompt waiting for user's input (maybe by the time that the preseed file is read by debian installer
it's too late to enable the auto mode?).
Note 2: You don't need prompt 1
in isolinux config. It will probably do the opposite of what you want, which is preventing automatic selection of default entry (see the last line of this section).
Note 3: Changing bootloader config requires modifications in iso contents (and thus an iso rebuild).
Note 4: The isolinux
bootloader is commonly used for BIOS (legacy) systems. In UEFI systems, you need to configure GRUB instead.