PXE_With_Kick-Start

PXE_With_Kick-Start

 

PXE Boot with kick-start configuration.

 

Configure PXE server.

[root@feenixdv_pix tftpboot]# cat /etc/redhat-release

CentOS Linux release 7.1.1503 (Core)

Step 1 :-

Install CentOS/RHEL on the virtual machine or any physical machine.

Step 2 :-

Install some prerequisite on PXE Server.

  • vsftpd
  • DHCP
  • xinted
  • tftp-server
  • syslinux

Step 3 :-

To install these package configure local YUM repository with FTP.

YUM configuration:-

                1st copy all data from CDROM to “/var/ftp/pub” location

                Next update yum repo file.

[root@feenixdv_pix tftpboot]# mount /dev/cdrom /mnt/
                                [root@feenixdv_pix tftpboot]# cat /etc/yum.repos.d/my.repo
                         [FTP]
name= feenixdv
baseurl=ftp://192.168.43.206/pub
gpgcheck=0
enable=1

Note:- To use this setting “vsftpd” must be install first and start “vsftpd” service.

 

Step 4 :-

  • Install all package after yum configuration.

     

     

     

     

    • yum install dhcp –y
    • yum install tftp-server
    • yum install syslinux

xinted automation installed with syslinux.

Step 5 :-

Now configure DHCP server.

Copy “dhcpd.conf” from from example file.

cat /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example > /etc/dhcp/dhcpd.conf

                update “/etc/dhcp/dhcpd.conf” according to network setting.

 

Step 6 :-

Now configure TFTP-SERVER server.

Then copy and create some configuration file for PXE installation.

[root@feenixdv_pix tftpboot]# cd /var/lib/tftpboot
[root@feenixdv_pix tftpboot]# cp /mnt/isolinux/* .  (Copy bootable file from CD)
[root@feenixdv_pix tftpboot]# mkdir pxelinux.cfg
[root@feenixdv_pix tftpboot]# vim pxelinux.cfg/default

Configure «default».

Step 7 :-

Now configure kick-start file.

                Copy this.

[root@feenixdv_pix tftpboot]# cp /root/anaconda-ks.cfg /var/ftp/pub/ks.cfg      

                Need to add url

Then copy “pxelinux.0” which was define in dhcpd.conf

cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

Step 8 :-

Start all services and check on also.

[root@feenixdv_pix tftpboot]# systemctl restart vsftpd xinetd dhcpd

[root@feenixdv_pix tftpboot]# systemctl enable  vsftpd xinetd tftp.service dhcpd

Note:- Cross check firewall and selinux are disabled.

Now install new VM without in boobable media or source disk.

Some advance configuration in PXE for multiple version option.

For example we want to install RHEL5, RHEL6 and RHEL7 using PXE then first need to create same structure in “/var/ftp/pub” directory.

For RHEL5.

  • Create directory “/var/ftp/pub/rhel5”
  • Copy all package inside directory including ks.cfg, vmlinuz and initrd.img file.

Same for RHEL6 and RHEL7

Now update “/var/lib/tftpboot/pxelinux.cfg/default” and add below entry.

label RHEL_5
  menu label Install RedHat 5
  kernel rhel5/vmlinuz
  append initrd=rhel5/initrd.img ks=ftp://192.168.43.206/pub/rhel5/ks.cfg repo=ftp://192.168.43.206/pub/rhel5
  
label RHEL_6
  menu label Install RedHat 6
  kernel rhel6/vmlinuz
  append initrd=rhel6/initrd.img ks=ftp://192.168.43.206/pub/rhel6/ks.cfg repo=ftp://192.168.43.206/pub/rhe6
 
label RHEL_7
  menu label Install RedHat 7
  kernel rhel7/vmlinuz
  append initrd=rhel7/initrd.img ks=ftp://192.168.43.206/pub/rhel7/ks.cfg repo=ftp://192.168.43.206/pub/rhel7

Now again restart all services. After that we have below boot option on PXE boot.

 

Leave a Reply

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