How to create a Custom Linux ISO Image with a kickstart file

Introduction to Custom Linux ISO

Custom Linux ISO – In this guide, we are about to see how to create a customised Golden ISO image with the kickstart file.

During RedHat, CentOS, Oracle Linux installation. we need to manually interact for every step. To automate those steps by predefined actions under the kickstart file we can save a lot of time and make an automated environment to quickly deploy the required machines on Virtual and Physical environment.

Note:> We need to create separate ISO images for both Physical and Virtual server installation, This can be overridden by creating some Ifelse postscript under kickstart file.

Customised Linux Golden ISO

More articles related to OS Installation

Prepare Kickstart file with required actions, If you do not have any idea how to prepare a kickstart file look into your new build server’s /root directory you should found one default kickstart file in the name “anaconda-ks.cfg”. We are good to start with creating our a kickstart file now, Just modify the required parameter in our existing file.

To make life easier, RedHat provided an online tool to create the kickstart file. RedHat KickStart Generator this not require any subscription. However, we required an account in redhat.com.

To learn more about preparing a kickstart file read this. It could help with more answers to prepare your first kickstart file.

Install the Required Package

Let’s start by installing the required packages. To read about how to install packages using yum continue reading 31 Yum command for Package Management in Linux

# yum install isomd5sum -y

Prepare for Custom Linux ISO

First, in place, create a directory to start building our customized ISO image. Moreover, enable shopt to copy files. It helps to copy all hidden files which require for our setup.

# mkdir /OEL_6.8_Custom/ 
# shopt -s dotglob

Mount the required ISO file from somewhere

Mount ISO to copy the files

To copy the files mount the ISO file with filetype under /mnt.

# mount -t iso9660 -o loop /dev/sr0 /mnt/

Copy all the file including hidden files, Copy kickstart file under the custom directory

# sudo cp -riv /mnt/* /OEL_6.8_Custom/
# sudo cp /root/ks.cfg /OEL_6.8_Custom/

Change the required parameter in isolinux.cfg. If you need to add more packages or location where the packages are residing it can be included as well.

# sudo vim /OEL_6.8_Custom/isolinux/isolinux.cfg

Once the required parameters are changes we are good with creating a custom ISO file.

Creating Customised Linux ISO file

Run the “mkisofs” command with options and arguments to create our custom ISO file.

 # sudo mkisofs -o /OEL68.iso -b isolinux/isolinux.bin -c isolinux/boot.cat --no-emul-boot --boot-load-size 4 --boot-info-table -J -R -V disks .

Make a note to not forget the leading dot “.” at the end of the command. It represents the current directory.

Verify the Custom Build ISO

While we share the ISO to someone else or to make sure everything was working as expected we need to add a checksum to do an integrity check for our ISO.

Add MD5 checksum in ISO file, Check for MD5 implementation using checkisomd5.

# implantisomd5 /iso/custom_dvd.iso  
# checkisomd5 --verbose /iso/custom_dvd.iso

That’s it, We have done with creating a new Golden ISO image. Hereafter if we need to install any servers without human interaction this ISO can be used. Just mount the ISO in ILO and start the installation else burn to any media and start the build.

Conclusion

To automate the installation using an ISO file can be achieved by creating a Custom Linux ISO file. Above steps similar for RHEL based operating systems such as CentOS. Let us come up with new articles, Subscribe to our newsletter and stay connected.

One thought on “How to create a Custom Linux ISO Image with a kickstart file

  1. Alternatively, if you don’t want to go through all that process but still want a customized Linux ISO image, you can try linuxcustomizer.com, it’s free!

Comments are closed.