CentOS Stream 9
Sponsored Link

PXE Boot : Diskless Clients2022/07/13

 
Start a client computer which has no local drives from booting OS image from PXE server.
[1]
[2] Install required packages on PXE server.
[root@dlp ~]#
dnf -y install dracut-network nfs-utils
[3] Build a System for diskless clients on PXE server.
[root@dlp ~]#
mkdir -p /var/lib/tftpboot/centos-st9/root

[root@dlp ~]#
dnf group -y install "Server with GUI" --installroot=/var/lib/tftpboot/centos-st9/root/
# generate root password

[root@dlp ~]#
/usr/libexec/platform-python -c 'import crypt,getpass; \
print(crypt.crypt(getpass.getpass(), \
crypt.mksalt(crypt.METHOD_SHA512)))'
Password:
$6$PF3scDJw51cmx.....
[root@dlp ~]#
vi /var/lib/tftpboot/centos-st9/root/etc/shadow
# set root password generated above

root:
$6$PF3scDJw51cmx.....
:16372:0:99999:7:::
# set locale for clients system

[root@dlp ~]#
vi /var/lib/tftpboot/centos-st9/root/etc/locale.conf
LANG="en_US.UTF-8"
# set hostname for clients system

[root@dlp ~]#
vi /var/lib/tftpboot/centos-st9/root/etc/hostname
localhost.localdomain
[4] Configure and Start NFS Server for diskless clients.
[root@dlp ~]#
vi /etc/exports
/var/lib/tftpboot/centos-st9/root 10.0.0.0/24(rw,no_root_squash)
[root@dlp ~]#
systemctl enable --now nfs-server
# if Firewalld is running, allow service

[root@dlp ~]#
firewall-cmd --add-service=nfs

[root@dlp ~]#
firewall-cmd --runtime-to-permanent

[5] Configure for BIOS based clients.
[root@dlp ~]#
wget -P /var/lib/tftpboot/centos-st9/ \
http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/images/pxeboot/vmlinuz \
http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/images/pxeboot/initrd.img
[root@dlp ~]#
vi /var/lib/tftpboot/pxelinux.cfg/default
# create new

default centos-st9

label centos-st9
    kernel centos-st9/vmlinuz
    append initrd=centos-st9/initrd.img root=nfs:10.0.0.30:/var/lib/tftpboot/centos-st9/root rw selinux=0 
[6] That's OK.
Power on a computer which is enabled network booting on BIOS settings, then, System starts from shared OS image on PXE server.
Matched Content