CentOS Stream 8
Sponsored Link

PXE Boot : Diskless Clients2021/06/24

 
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-st8/root

[root@dlp ~]#
dnf group -y install "Server with GUI" --installroot=/var/lib/tftpboot/centos-st8/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$EC1T.oKN5f3seb20$y1WlMQ7Ih424OwOn.....
[root@dlp ~]#
vi /var/lib/tftpboot/centos-st8/root/etc/shadow
# set root password generated above

root:
$6$EC1T.oKN5f3seb20$y1WlMQ7Ih424OwOn.....
:16372:0:99999:7:::
# set locale for clients system

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

[root@dlp ~]#
vi /var/lib/tftpboot/centos-st8/root/etc/hostname
localhost.localdomain
[4] Configure and Start NFS Server for diskless clients.
[root@dlp ~]#
vi /etc/exports
/var/lib/tftpboot/centos-st8/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 --permanent

[root@dlp ~]#
firewall-cmd --reload

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

default centos-st8

label centos-st8
    kernel centos-st8/vmlinuz
    append initrd=centos-st8/initrd.img root=nfs:10.0.0.30:/var/lib/tftpboot/centos-st8/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