Linux – Unattended Kickstart Install

kickstartlinux

I've looked around quite a bit and have seen similar setup and questions, but none seem to work for me. I'm using the following command to create a custom ISO:

/usr/bin/livecd-creator --config=/usr/share/livecd-tools/test.ks --fslabel=TestAppliance --cache=/var/cache/live

This works great and it creates the ISO with all of the packages and configs I want on it. My issue is that I want the install to be unattended. However, every time I start the CD, it asks for all of the info such as keyboard, time zone, root password, etc. These are my basic settings I have in my kickstart script prior to the packages section.

cdrom
install
autopart
autostep
xconfig --startxonboot
rootpw testpassword
lang en_US.UTF-8
keyboard us
timezone --utc America/New_York
auth --useshadow --enablemd5
selinux --disabled
services --enabled=iptables,rsyslog,sshd,ntpd,NetworkManager,network --disabled=sendmail,cups,firstboot,ip6tables
clearpart --all

So after looking around, I was told that I need to modify my isolinux.cfg file to either do "ks=http://X.X.X.X/location/to/test.ks" or "ks=cdrom:/test.ks". I've tried both methods and it still forces me to go through the install process. When I tail the apache logs on the server, I see that the ISO never even tries to get the file. Below are the exact syntax I'm trying on my isolinux.cfg file.

label http
  menu label HTTP
  kernel vmlinuz0
  append initrd=initrd0.img ks=http://192.168.56.101/files/test.ks ksdevice=eth0
label localks
  menu label LocalKS
  kernel vmlinuz0
  append initrd=initrd0.img ks=cdrom:/test.ks
label install0
  menu label Install
  kernel vmlinuz0
  append initrd=initrd0.img root=live:CDLABEL=PerimeterAppliance rootfstype=auto ro liveimg liveinst noswap   rd_NO_LUKS rd_NO_MD rd_NO_DM
menu default
EOF_boot_menu

The first 2 give me a "dracut: fatal: no or empty root=" error until I give it a root= option and then it just skips the kickstart completely. The last one is my default option that works fine, but just requires a lot of user input. Any help would be greatly appreciated.

Best Answer

As the comments to the question state, livecd-creator is really intended for a different purpose.

For bootable ISOs there are two paths to take:

  1. Make a network book iso and provide all software from network install tree, most common.
  2. Create a custom rolled ISO that includes the kickstart and install tree.

There are lots of write ups for number 1 as it is fairly common and has lots of benefits. Here are a few:

Number 2 is primarily for the times where you don't have a network available install tree. Here is how you do number 2:

  1. Make sure your kickstart sets in the install source to 'cdrom'
  2. Install mkisofs (this will give you either mkisofs or genisoimage, mkisofs command below should work with both)
  3. Download ISO
  4. Mount ISO

    mount -o loop /path/to/iso /mnt/point
    
  5. Copy entire directory structure of ISO to a new folder.

    mkdir -p /path/to/new/isosource
    cp -pr /mnt/point/* /path/to/new/isosource/
    
  6. Place your kickstart in the new folder

    cp /path/to/my/ks.cfg /path/to/new/isosource/
    
  7. move into folder that contains new folder

    cd /path/to/new
    
  8. Make sure isolinux directory is writeable

    chmod u+w isosource/isolinux/*
    
  9. Add ks entry in isosource/isolinux/isolinux.cfg for the 'Install' entry by changing

    append initrd=initrd.img
    

    to:

    append initrd=initrd.img ks=cdrom:/ks.cfg
    
  10. Make the ISO

    mkisofs -o file.iso -b isolinux/isolinux.bin -c isolinux/boot.cat \
      -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T isosource/