I never tried using a debian preseed.cfg file, but I thought there were some post-install commands that could get issued. Maybe using one of these is how you can set hostname.
On Tue, 11 Jun 2019, john doe wrote: > Date: Tue, 11 Jun 2019 12:25:47 > From: john doe <johndoe65...@mail.com> > To: debian-user@lists.debian.org > Subject: Re: Preseed file and hostname not used on installed system > Resent-Date: Tue, 11 Jun 2019 16:26:06 +0000 (UTC) > Resent-From: debian-user@lists.debian.org > > On 6/10/2019 8:24 PM, john doe wrote: > > Hi, I'm installing Debian Stretch using a preseed file, the preseed file > > is common for multiple hosts with the exception of the hostname. > > > > boot: auto hostname=try domain=example.com ... > > url=tftp://hostname/preseed.cfg > > > > The host name specified is not used when Debian is installed, it is > > always set to 'bad'. > > > > I understand the limitations but what is the proper way to specify the > > desired hostname or are workarounds (1) the way to go? > > > > Any help/hints is appriciated. > > > > > > https://unix.stackexchange.com/questions/106614/preseed-cfg-ignoring-hostname-setting > > > > After some digging/testing I'm not able to supply by kernel boot > parameter the hostname: > > boot: auto hostname=foobar url=... > > From what I understand, 'hostname' as kernel boot parameter takes > precedence over the hostname provided by dhcp. > > > It is miserably failing and I don't understand what I'm missing here? > > > In other words, how can I set the hostname while using a preseed file > loaded with 'auto url=server'. > > Any input is welcome. > > -- > John Doe > > --