Lab 1x: Automated Install of Red Hat 9.0 (Shrike)
Last modified: Aug 30, 2011
The purpose of this lab is to install Red Hat 9.0 onto the Virtual Machine that you made in Lab 0 using a kickstart file to automate the process.
In doing this lab, you will be demonstrating your ability to perform an automated install of a Linux Operating System from a CD-ROM image.
When you are asked to perform a task, such as installing a Linux system, it makes sense to do it by hand so that you understand exactly how the installation is configured. But if you are asked to perform the same task again, it's time to think about automating the process. Linux uses what it calls a kickstart file for just that purpose. The kisckstart file contains all the configuration settings chosen from a previous install and functions as the Windows' equivalent of an answer file.
Procedure
Part I
Prepariing the kickstart file
- Log in to cislab.cabrillo.edu using your remote desktop client, vpxclient.rdp.
- Before you power on your virtual machine, right-click its icon and select "Edit Settings". Click on the "floppy drive 1" label in the left pane. In the right pane click on "Use existing floppy image in datastore:" and Browse one of the datastores[1-4]. Near the bottom of the list you will find a file called myfloppy.flp. Select that file. This prepares your machine to access a floppy disk that you will insert later in the lab.
- Power on your virtual machine containing RedHat 9 and log in as root.
- You are going to be editing the anaconda-ks.cfg in your home directory. What do you suppose "ks" stands for?
- Add the word cdrom immediately below the line near the top of the file that has the word install.
- Near the middle of the file you will find a series of lines dealing with
partitions that have been commented with a (#) symbol at the start of the line.
You must remove that (#) symbol from each line that starts with the word clearpart or part. There should be four such lines.
- On the line that starts with the word clearpart add the option --initlabel at the end.
- Save the file and exit the editor.
- You must now copy this file to a floppy disk and rename it to ks.cfg
- Place the virtual floppy disk into the virtual floppy drive by clicking the
floppy disk tool - second from the right on the tool bar.
Select Connect to a floppy image on the datastore ... on the popup submenu.
Select myfloppy.flp in one of the datastores.
You have just inserted the virtual floppy disk!
- Now you must mount this floppy disk device to your directory hierarchy in
order to copy your anaconda-ks.cfg file to it. Run the command:
mount /dev/fd0 /mnt/floppy
- Copy your file to the mounted floppy disk:
cp anaconda-ks.cfg /mnt/floppy/ks.cfg
Notice that we are changing the name of the file as we copy it.
- Verify that the copy succeeded and then unmount the floppy disk:
ls /mnt/floppy
umount /dev/fd0
(Pay no attention to the other files that are on the floppy.)
- Now you are all set for an automated installation. But since your virtual machine already has Red Hat 9 Linux installed, we should remove the current installation. This is easily done by zeroing out the master boot record:
dd if=/dev/zero of=/dev/sda bs=512 count=1
- Shutdown the virtual machine:
init 0
Part II
Booting with the kickstart file
- Before you boot your VM, make sure the floppy disk is disconnected so that
the VM doesn't try to boot from the floppy.
- If your cdrom is no longer connected to the redhat9-shrike.iso file, then
connect it up.
- Now power on the VM - it should come up to the install boot screen with a boot prompt. Type the string: "linux ks=floppy", but do not hit the enter key.
- Before you hit the Enter key, connect the floppy disk back up, then hit the
enter key.
- Sit back and watch the installation happen automatically.
- You are now ready to turn in your work and shutdown your virtual machine.
Turn in
For this lab, you must submit the ks.cfg file that drove your unattended installtion. To do this, you will have to mount the floppy to the /mnt/floppy directory as you did in the lab. Then cd to the /mnt/floppy directory and
scp the ks.cfg to opus as lab1x. After the transfer is complete, remove the
ks.cfg file, change to your home directory and unmount the floppy.
mount /dev/fd0 /mnt/floppy
cd /mnt/floppy
scp ks.cfg logname@opus.cabrillo.edu:lab1x
rm ks.cfg
cd
umount /dev/fd0
init 0
Grading Rubric
Your lab will be graded for the following components:
- 5 points -
- for the ks.cfg file with the correct specifications outlined above