Configure PXE Boot Server for Rocky Linux 8/CentOS 8 Kickstart Installation

Rocky Linux is now in GA.

Pre-requisites

We are using our existing PXE boot homelab server in this article.

All commands to be run on the PXE boot server.

Download and Create Rocky Linux 8 FTP Installation Media

Download the DVD version of Rocky Linux 8 ISO image.

$ sudo yum install curl -y
$ curl -# -O https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.4-x86_64-dvd1.iso

Mount the image and copy its content to the FTP location:

$ sudo mkdir -p /mnt/iso /var/ftp/pub/pxe/Rocky8
$ sudo mount Rocky-8.4-x86_64-dvd1.iso /mnt/iso
$ sudo cp -prv /mnt/iso/* /var/ftp/pub/pxe/Rocky8/
$ sudo umount /mnt/iso

Verify:

$ curl ftp://10.11.1.20/pub/pxe/Rocky8/
dr-xr-xr-x    4 0        0              38 Jun 20 16:15 AppStream
dr-xr-xr-x    4 0        0              38 Jun 20 16:15 BaseOS
dr-xr-xr-x    3 0        0              18 Jun 20 16:15 EFI
-r--r--r--    1 0        0            2204 Jun 19 14:22 LICENSE
-r--r--r--    1 0        0             883 Jun 20 16:15 TRANS.TBL
dr-xr-xr-x    3 0        0              76 Jun 20 16:15 images
dr-xr-xr-x    2 0        0             256 Jun 20 16:15 isolinux
-r--r--r--    1 0        0              86 Jun 20 16:13 media.repo

Create Rocky Linux Kickstart File

This is the kickstart file /var/ftp/pub/pxe/rocky8-k8s-ks.cfg that I use for my Rocky Linux 8 Kubernetes servers (a 16GB disk required).

#version=RHEL8
# https://access.redhat.com/labs/kickstartconfig/
# System authorisation information
auth --useshadow --passalgo=sha512
# Use network installation
url --url="ftp://10.11.1.20/pub/pxe/Rocky8/BaseOS"
repo --name="AppStream" --baseurl=ftp://10.11.1.20/pub/pxe/Rocky8/AppStream

# Use graphical install
graphical
# Keyboard layouts
keyboard --vckeymap=gb --xlayouts='gb'
# System language
lang en_GB.UTF-8
# SELinux configuration
selinux --enforcing
# Firewall configuration
firewall --enabled --ssh
firstboot --disable

# Network information
network  --bootproto=dhcp --device=eth0 --nameserver=10.11.1.2,10.11.1.3 --noipv6 --activate
# Reboot after installation
reboot
ignoredisk --only-use=vda

# Root password
rootpw --iscrypted $6$7YZ0gnLkLPrl6rRO$NTjTQx1nesw5JLjtiAVdn3UBSbahUBGDFSiGGfrMNfGBum5aFs.TQcNX1SEuoWX/TmQ/ZMfiMnyHDs9uu9VH9.
# System timezone
timezone Europe/London --isUtc
# System bootloader configuration
bootloader --location=mbr --timeout=1 --boot-drive=vda
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel

# Disk partitioning information
#autopart --type=lvm
part /boot --fstype="xfs" --ondisk=vda --size=1024 --label=boot --asprimary
part pv.01 --fstype="lvmpv" --ondisk=vda --size=15359
volgroup vg_os pv.01
logvol /tmp  --fstype="xfs" --size=1024 --label="lv_tmp" --name=lv_tmp --vgname=vg_os
logvol /  --fstype="xfs" --size=14331 --label="lv_root" --name=lv_root --vgname=vg_os

%packages
@^minimal-environment

%end

%addon com_redhat_kdump --disable --reserve-mb='auto'

%end

%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end

Copy the content and save it as /var/ftp/pub/pxe/rocky8-k8s-ks.cfg on the PXE boot server.

Copy initrd.img and vmlinuz from the Rocky Linux 8 installation media to /var/lib/tftpboot/networkboot/Rocky8/:

$ sudo mkdir -p /var/lib/tftpboot/networkboot/Rocky8
$ sudo cp -pv /var/ftp/pub/pxe/Rocky8/images/pxeboot/{initrd.img,vmlinuz} /var/lib/tftpboot/networkboot/Rocky8/

Update the PXE boot configuration file /var/lib/tftpboot/pxelinux.cfg/default with the following content:

label Install Rocky Linux 8 K8s Node
  kernel /networkboot/Rocky8/vmlinuz
  append initrd=/networkboot/Rocky8/initrd.img inst.repo=ftp://10.11.1.20/pub/pxe/Rocky8 inst.ks=ftp://10.11.1.20/pub/pxe/rocky8-k8s-ks.cfg

Perform a Network Boot

Create a VM that uses Network Boot (PXE), start it and check the automated process.

7 thoughts on “Configure PXE Boot Server for Rocky Linux 8/CentOS 8 Kickstart Installation

  1. what version is the rocky linux i am using 8.7 and get the issue
    Started cancel waiting for multipath siblings of sda

  2. Hi,

    I have created custom ISO image from “Rocky-8.7-x86_64-minimal.iso” using
    “mkksiso /root/anaconda-ks1.cfg /root/Rocky-8.7-x86_64-boot.iso /root/Rocky-8.7-x86_64-test.iso”

    When I try to setup machine from my custom ISO image using .ks(kick start config file) .
    All the ‘OS’ configurations are setting up properly and machine is going for reboot. But after the reboot again it is reinstalling ‘OS’ and rebooting and continues to reboot.

    Ks.file

    #version=RHEL8
    # Use graphical install
    #graphical
    install

    %packages
    @^minimal-environment
    kexec-tools

    %end

    # Keyboard layouts
    keyboard –xlayouts=’us’
    # System language
    lang en_US.UTF-8

    # Network information
    network –bootproto=dhcp –device=enp0s3 –ipv6=auto –activate
    network –hostname=localhost.localdomain

    # Run the Setup Agent on first boot
    firstboot –enable

    ignoredisk –only-use=sda
    autopart
    # Partition clearing information
    clearpart –none –initlabel

    # System timezone
    timezone America/New_York –isUtc

    # Root password
    rootpw –iscrypted $6$FFOHl40vEkoTSlO6$NOrM5i3/VroVyNFQOaQwhFNbhqE0ZoglCa9HC3JUWBxxAbxnPoJkTVkVisahEC96FkcsuM3pBom5eYMs5LH2s/

    %addon com_redhat_kdump –enable –reserve-mb=’auto’
    # OMIT X11
    skipx

    # Use network installation
    url –url download.rockylinux.org/stg/rocky/8/BaseOS/$basearch/os/
    repo –name=”BaseOS” –baseurl=http://dl.rockylinux.org/pub/rocky/8.7/BaseOS/$basearch/os/ –cost=200
    repo –name=”AppStream” –baseurl=http://dl.rockylinux.org/pub/rocky/8.7/AppStream/$basearch/os/ –cost=200
    repo –name=”PowerTools” –baseurl=http://dl.rockylinux.org/pub/rocky/8.7/PowerTools/$basearch/os/ –cost=200
    repo –name=”extras” –baseurl=http://dl.rockylinux.org/pub/rocky/8.7/extras/$basearch/os –cost=200

    # System bootloader configuration
    bootloader –append=”no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop” –location=mbr –timeout=1
    # Clear the Master Boot Record
    zerombr
    # Partition clearing information
    clearpart –all –initlabel –disklabel=gpt
    # Disk partitioning information
    part biosboot –size=1 –fstype=biosboot –asprimary
    part /boot/efi –size=100 –fstype=efi –asprimary
    part /boot –size=1000 –fstype=xfs –label=boot
    part / –size=8000 –fstype=”xfs” –mkfsoptions “-m bigtime=0,inobtcount=0” –grow

    # Shutdown after installation
    shutdown

    %end

    %anaconda
    pwpolicy root –minlen=6 –minquality=1 –notstrict –nochanges –notempty
    pwpolicy user –minlen=6 –minquality=1 –notstrict –nochanges –emptyok
    pwpolicy luks –minlen=6 –minquality=1 –notstrict –nochanges –notempty
    %end

    • Hi, what is your boot order configuration on the machine? Try setting the first boot option to your hard disk rather than removable media/CD/DVD.

Leave a Reply

Your email address will not be published. Required fields are marked *