Assignment #1: Kickstart
Date: January 23, 2008

Previously, we manually installed CentOS on a removable hard disk. While the process isn't difficult, we saw that system administrators can make mistakes or interpret directions differently, as everyone didn't end up with an identical system at the end of the lab.

Today we're going to solve those problems by automating the installation process using Kickstart. You're going to setup the Kickstart installation environment, then install CentOS via Kickstart on a virtual machine under VMWare Server. To do a Kickstart install, you'll need to:

  1. Make the installation directory tree available. This has already been done for you.
  2. Create a Kickstart configuration file.
  3. Make the configuration file available via the network or boot media.
  4. Create a boot media to use Kickstart with (we'll use the CentOS install DVD.)
  5. Start the Kickstart installation with the boot media.

The lab will take you through all of those steps below, including setting up a virtual machine under VMWare Server to do the install on.

Select a PC in the lab and boot it with your removable hard disk. Login as student, not root.

  1. Create a new Virtual Machine (VM)
    1. Start VMWare Server from the System Tools submenu of the Applications menu. You'll see the Connect to Host dialog box.



    2. Select "Connect to Host" in the dialog box and you'll see the main window in VMWare Server



    3. Create a new VM.
      1. Click on "Create a new virtual machine" to start the New Virtual Machine Wizard.



      2. Click on Next then select a Typical configuration.



      3. Click on Next then select Linux as the OS and "Red Hat Enterprise Linux 4" as the version (RHEL 5 is not an available option in this version of VMWare Server.)



      4. Click on Next then give the virtual machine the name CentOS5.



      5. Click on Next then select bridged networking.



      6. Click on Next then set the virtual disk size to 8.0GB.



      7. Wait for disk creation to finish.



      8. Now you should see the CentOS5 VM Tab, displaying information about the virtual machine you just created.

    4. Find Kickstart Repository
      1. Mount the NFS Kickstart repository on your physical machine (not the VM.)
        # mount -t nfs 10.11.241.9:/images /images
                    
      2. Verify that you have successfully mounted the filesystem.
        $ df -h /images
        Filesystem            Size  Used Avail Use% Mounted on
        10.11.241.9:/images    197G   13G  181G   7% /images
                    
      3. Find the CentOS image files
        $ find /images -name 'CentOS*'
                    
      4. Record the IP address and path to get access the CentOS Kickstart repository, as these will be the values for the --server and --path options to the nfs command in your Kickstart configuration. Unmount the filesystem once you're done.
        # umount /mnt
                    
    5. Configure Kickstart
      1. Copy Kickstart configuration file from your original CentOS install. This file will have all of the configuration choices you made when installing CentOS from DVD. However, we must make some changes to do an automatic network install. Our configuration file will be ks.cfg.
        # cp /root/anaconda-ks.cfg /root/ks.cfg
        
      2. Edit Kickstart configuration file. If you need help with the syntax, reread the Kickstart Options page in the RHEL System Administration Guide. At a minimum, you'll need to change the install method from cdrom to nfs, disable X-Windows (replace the xconfig line with skipx), and you'll also need to change the disk partition sizes so that they'll fit on your virtual disk, which is only 10% the size of your physical disk. You'll also need to remove some of the software packages that are unnecessary for a server that's not running X-Windows, including Gnome Desktop, the Office packages, graphical Internet, etc.
        # yum install vim-X11
        # gvim /root/ks.cfg
        
    6. Make Kickstart configuration available.
      1. Start the Apache web server on your physical machine.
        # service httpd start
                    
      2. Turn off the iptables firewall for now, as we haven't learned how to configure it to only allow web access to our host yet.
        # service iptables stop
                    
      3. Record your IP address.
        # ifconfig eth0
                    
      4. Copy your Kickstart configuration into the web server directory.
        # cp /root/ks.cfg /var/www/html
                    
      5. Make your ks.cfg file world readable so the web server can serve it.
        # chmod 644 /var/www/html/ks.cfg 
                    
      6. Retrieve a copy of the Kickstart file from the web server.
        # cd /tmp
        # wget http://YOUR_IP_ADDRESS/ks.cfg
                    
      7. Verify that it's identical to the Kickstart configuration file you created. If the diff command returns no output, the two files are identical and you're ready to do a Kickstart install.
        # diff /tmp/ks.cfg /root/ks.cfg
                    
    7. Install CentOS via Kickstart on the VM.
      1. Insert your CentOS 5 DVD into the drive.
      2. Click on "Power on this virtual machine" in the CentOS5 tab to start the VM. The VM will boot using the CentOS 5 DVD.



      3. Specify the location of your Kickstart configuration at the boot: prompt.
        linux ks=http://YOUR_IP_ADDRESS/ks.cfg
        
      4. The Kickstart installer should work automatically, with the exception of the following error message the first time you run it. Click on Yes.



      5. Eject the DVD and reboot the VM when the install is complete.
      6. Login to the machine as root to verify that your install worked correctly.
    8. Submit your lab
      1. Use sftp to transfer your ks.cfg file to kosh.
      2. Create a file named readme that provides one-sentence explanations of each change you made from the original anaconda-ks.cfg file.
      3. Login to kosh
      4. Use the submit program to submit the files you transferred to kosh with an assignment name of "a1".
     

    ©2008 James Walden, Ph.D.