Getting started with Kickstart and TFTP

Hi,

I never worked with Kickstart, and I’d like to use it for automating some installations.

I wonder how I would get my local machines to actually use their Kickstart files. As far as I understand, you have to use a local TFTP server to distribute them over the local network. (I never used TFTP and don’t even know what it is.)

I have a local Dnsmasq server running Rocky Linux 8, and as far as I can tell, Dnsmasq is able to use TFTP.

Here’s what I’m vaguely planning to do (correct me if I’m wrong).

  1. Install Rocky Linux on a local sandbox PC.

  2. Grab the /root/anaconda-ks.cfg file that has been created.

  3. Configure a local TFTP server on my Dnsmasq installation.

  4. Rename the Kickstart file to something like sandbox-ks.cfg and put it on my TFTP server.

  5. Boot the sandbox PC on the Rocky Linux installer and then use some magic option to retrieve the Kickstart file over the network.

Has someone here actually used this kind of scenario? Can you point me to some relevant documentation?

Cheers,

Niki

RH docs: Chapter 2. Preparing for your RHEL installation Red Hat Enterprise Linux 9 | Red Hat Customer Portal

1-2: yes
If you load packages from USB on step 1, then edit (or comment/remove) the installation source from the file. If the kickstart file does not contain decisions for all choices, then the GUI will ask for them and you get “better” /root/anaconda-ks.cfg for next round.

4: To HTTP/HTTPS, NFS, or FTP server. Not to TFTP.

3:
dnf install syslinux-tftpboot
as that provides /tftpboot/pxelinux.0

Copy .../rockylinux.org/9.3/BaseOS/x86_64/os/EFI/ into /tftpboot/EFI/
Copy .../rockylinux.org/9.3/BaseOS/x86_64/os/images/pxeboot/ into /tftpboot/rocky9/

The dnsmasq config needs something like:

dhcp-match=set:bios,option:client-arch,0
dhcp-boot=tag:bios,pxelinux.0
dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-boot=tag:efi-x86_64,EFI/BOOT/grubx64.efi
enable-tftp
tftp-root=/tftpboot

For legacy mode boot a menu:

$ cat /tftpboot/pxelinux.cfg/default
default menu.c32
prompt 0
ALLOWOPTIONS 0
NOESCAPE 1

timeout 300
ONTIMEOUT local

MENU TITLE BIOS PXE Menu

LABEL local
        MENU LABEL Boot local hard drive
        LOCALBOOT 0

LABEL rocky9
         MENU LABEL Rocky 9 installer
         KERNEL rocky9/vmlinuz
         APPEND initrd=rocky9/initrd.img ip=dhcp inst.ks=http:/10.20.30.40/kickstarts/sandbok-ks.cfg

For UEFI mode boot:

set timeout=60
menuentry 'RHEL 9' {
  linuxefi rocky9/vmlinuz ip=dhcp 
  initrdefi rocky9/initrd.img inst.ks=http:/10.20.30.40/kickstarts/sandbok-ks.cfg
}

The location and name of that file … journalctl / /var/log/messages will show some of the candidates after boot attempt. For example:

... dnsmasq-tftp[78379]: file /tftpboot/grub.cfg-0A2 not found
... dnsmasq-tftp[78379]: file /tftpboot/grub.cfg-0A not found
... dnsmasq-tftp[78379]: file /tftpboot/grub.cfg-0 not found
... dnsmasq-tftp[78379]: file /tftpboot/grub.cfg not found
  1. On BIOS/UEFI of the test system there should be the PXE-boot option / way to enable it and then boot with IPv4 NIC (or IPv6 NIC), rather than local HDD, USB, etc.
1 Like