4

I am trying to create an automated installer for my debian server, so if the hardware breaks, my employees can reinstall it without selecting languages, adding users and most importantly without having to call the IT dept. I read all the documentations related to preseed files on debian's website but I could not make it work. I already created the preseed.cfg file and it should be working, but the installer never recognises it. I even tried a third party script, that embeds my preseed file to the ISO but it did not work either (was unable to boot from USB). Could anyone provide a simple step-by-step guide on where should I put the preseed.cfg and how to launch the installer in a way it actually uses that file?

[UPDATE]

This is what I did so far:

1) I created a pressed.cfg file, based on the example file on debian's website.

2) I made an USB debian installer (Tried with both dd command and rufus) both worked WITHOUT the preseed file.

3) I copied preseed.cfg to the USB root and also to a folder called 'preseed' (I read it somewhere that it might help).

4) Started the PC, booted from the USB.

5) Selected the automated install option, pressed TAB key to open up the parameter editor and added "preseed/file=/hd-media/preseed.cfg".

At this point I either get an error message saying the preseed file not found or my boot parameter get completely ignored and a normal install start.

This is the error message I get:

Failed to retrieve the preconfiguration file

The file needed for preconfiguration could not be retrieved from /hd-media/preseed.cfg.
The installation will proceed in non-automated mode.

I really want to avoid hosting the preseed file on my site because I do not want to expose my server settings.

voider
  • 43
  • 1
  • 4
  • I provided an answer, though I am not sure how useful it is going to be to you. I think the official docs are pretty clear. You might need to add more details about specifically what you have tried. Perhaps with more details about what you are trying we can point out what the problem is. – Zoredache Jul 24 '19 at 18:25

3 Answers3

2

Change your preseed/file=/hd-media/preseed.cfg to preseed/file=/cdrom/preseed.cfg.

The preseed path has to be specified with the file system layout of the installer in mind. While the initramfs is mounted as the root filesystem, the default installation media mounts its source at /cdrom/.

  • if your preseed.cfg is at the root of the initramfs, it will be at /preseed.cfg
  • if your preseed.cfg is at the root of the cdrom/usb, it will be at /cdrom/preseed.cfg

Afaik, this is currently accurate for all official Debian and Ubuntu installation media. If this ever changes or you changed something in building your installation media, you could always verify the correct path by entering expert mode in the installer, using the option to launch a shell from there and check the filesystem locations.

anx
  • 8,963
  • 5
  • 24
  • 48
  • I put the preseed.cfg on the USB stick and I can see the file in /cdrom, if I start a shell on the second console while the installer runs. But the kernel paramter `preseed/file=/cdrom/preseed.cfg` throws the error that `file:///cdrom/preseed.cfg` can not be found. – ceving Nov 20 '19 at 15:15
1

Preseed files can work many ways. The specific details gets can get pretty complicated and be different based on your hardware.

Assuming your installer supports your network hardware, one way is to pass the installer a url to the preseed file.

Another way is to modify the initrd.gz and embed the file in there.

You can provide the preseed via DHCP server.

You can place it in a file on a CD image.

In almost all cases you do have to pass an additional parameter in the boot command line, so you need to update install media bootloader in addition to placing the file.

The installation guide does provide most of the general information you would need.

Since you mentioned USB media to boot, you probably want to see the section B.2.1 which mentions what where to place the file and the boot options you need.

- if you're installing from USB media (put the preconfiguration file in the
  toplevel directory of the USB stick):
  preseed/file=/hd-media/preseed.cfg
  preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
Zoredache
  • 130,897
  • 41
  • 276
  • 420
  • Thanks for you reply! I already tried these things, updated my original post with more details on what I did so far and what I got. – voider Jul 25 '19 at 08:25
  • Why is this an accepted answer? The text is just pasted from the net and does not work. – ceving Nov 20 '19 at 15:17
  • @ceving hard to know why. I would guess the OP figured out something and some part of my 'answer' was useful enough to point them in the right direction. I think the original version of the question was pretty light on details so I gave a pretty generic answer. – Zoredache Nov 20 '19 at 21:08
0

What I've done: 1) prepared a bootable USB with Debian 10; 2) copied my preseed.cfg as "preseed.txt" at home directory of the pen drive; 3) selected "Advanced > Automated Install" at install menu; 4) informed: file:///cdrom/preseed.txt as the Preseed file;

PS: with the name "preseed.cfg" it didn't work.