You are on page 1of 15

Quick HOWTO : Ch25 : Network-Based Linux Installation

From Linux Home Networking
Jump to: navigation, search

Fedora Linux allows you to do operating system installations via a network connection using a Kickstart server. It is frequently much faster than using CDs and the process can be automated. The procedure is fairly simple:
y y y y

Connect the new server (installation client) to the same network as the server with the pre-loaded installation files (installation server). Boot the installation client from a specially created boot CD Enter your preferred installation method (FTP, HTTP, NFS) and the needed network parameters to do this The installation procedure will then continue with the more familiar Fedora Linux installation screens. Enter your selections and then complete the installation.

This chapter will briefly explain how to set this up using all three methods using a single installation server (bigboy) with an IP address of

Setting Up The Installation Server
Kickstart can be configured on an FTP, NFS or Apache server. Each method is explained below, but my experience has been that the Apache server has a number of advantages over the other two. Using a web server for kickstart is generally easier because:


Sometimes a kickstart server has to be located on a remote network, often passing through a firewall. Strict firewall rules for HTTP are generally easier to configure than those for FTP or NFS. The http:// nomenclature used by kickstart for accessing files is more familiar to users than that used for NFS and FTP. This may be important for you when configuring files for automated kickstart installation.

Basic Preparation

your /data/networkinstall/RPM directory should look like this: [root@bigboy tmp]# ls -1 /data/network-install/RPM .In this example we are going to set up a kickstart server that will be used in Fedora Core installations. Note: Note: You also have the option to FTP all the files of the desired version of Fedora from the Fedora website to the /data/network-install/RPM directory. [root@bigboy tmp]# mkdir /mnt/cdrom 2) Mount your first Fedora CD ROM. This will require about 3-5 GB of space. [root@bigboy tmp]# umount /dev/cdrom [root@bigboy tmp]# eject cdrom 5) Repeat steps 2 to 4 with all your CDROMs. Here's how to do it: 1) Create a mount point for your CD ROM drive. [root@bigboy tmp]# mkdir -p /data/network-install/RPM [root@bigboy tmp]# mkdir -p /data/network-install/ISO You now need to place the network installation driver files into the base directory. HTTP & FTP Preparation Copy all the contents of each installation CD to the /data/network-install/RPM directory. NFS and FTP kickstart methods all require the base set of Fedora files to be installed on the kickstart server. When this is completed. Overwrite files when prompted. Create The Installation Directories We'll first create the directories /data/network-install/RPM and /data/networkinstall/ISO in which we will copy the necessary files. [root@bigboy tmp]# mount /dev/cdrom /mnt/cdrom 3) Copy the files from the CD ROM base directory to the hard disk [root@bigboy tmp]# cp -r /mnt/cdrom/* /data/network-install/RPM 4) Unmount your CD ROM and use the eject command to retrieve it from the drive bay. All the necessary files will be placed in the /data/network-install directory. Copying The Files The HTTP.

. Follow these steps for each CD. make sure they have the same file names as the ones you can download from the Fedora Web site.eula.100/network-install/RPM/ or http://192.txt Fedora fedora. This will require about 3-5 GB of space as well.100/network- . substituting the filename where necessary: [root@bigboy tmp]# cd /data/network-install/ISO [root@bigboy ISO]# dd if=/dev/cdrom of=filename.html repodata RPM-GPG-KEY RPM-GPG-KEY-beta RPM-GPG-KEY-fedora RPM-GPG-KEY-fedora-extras RPM-GPG-KEY-fedora-legacy RPM-GPG-KEY-fedora-rawhide RPM-GPG-KEY-fedora-test RPM-GPG-KEY-rawhide stylesheet-images [root@bigboy tmp]# NFS Preparation Create ISO images of the installation CDs and place them in the /data/network-install/ISO directory.. .css GPL images index. If you create the ISOs files from CDs. The command requires a mounted CDROM drive. You may have to install the mkisofs RPM on newer Fedora versions.iso bs=32k . You can download the ISO images from the Fedora website or use the Fedora CDs as shown below.168.html isolinux README-Accessibility RELEASE-NOTES-en_US.168.1.1..iso /mnt/cdrom [root@bigboy ISO]# eject cdrom Setup Your Webserver You will now have to setup Apache to give the file listings of your /data/networkinstall/RPM and /data/network-install/ISO directories by pointing your browser to the URL http://192. so don't forget the mount command. [root@bigboy ISO]# mount /mnt/cdrom [root@bigboy ISO]# mkisofs -J -r -T -o filename.. [root@bigboy ISO]# eject cdrom Note: Here is a sample procedure to make ISO files with the older mkisofs command.

install/ISO/ respectively.> ServerName 192.d/kickstart.log Create A Special FTP User You can also create a special user for non anonymous FTP installations with its home directory as "/".conf configuration is below.deny allow from all </Directory> Setup Your FTP Server You'll also have to set up your VSFTPD server to make incoming anonymous FTP connections log in to the /data/network-install/RPM directory by default. [root@bigboy tmp]# useradd -g users ftpinstall . An example is below. You must also make sure that the user has read access to the /data/network-install directory.conf file.1. Remember to restart VSFTPD to make these settings take effect # # File: vsftpd.100 # # For HTTP Installations # <VirtualHost 192.conf # # # Anonymous FTP Root Directory # anon_root=/data/network-install/RPM # # Log file definition # xferlog_enable=YES xferlog_file=/var/log/vsftpd. Here is a sample snippet of the vsftpd. A sample /etc/httpd/conf.1. NameVirtualHost 192.168.100 DocumentRoot /data/ </VirtualHost> <Directory /data/network-install> Options +Indexes AllowOverride AuthConfig order allow. You will also want to enable the correct logging. Remember to restart Apache to make these settings take effect.

nfslock and netfs daemons are all running to create an NFS server. New password: Retype new password: passwd: all authentication tokens updated successfully. I recommend selecting the option that makes the .96 has address 192.168. [root@bigboy tmp]# [root@bigbot tmp]# usermod -d / ftpinstall [root@bigbot tmp]# Setup Your NFS Server The steps for setting up an NFS server are more complicated.d directory. not spaces between the entries /data/network-install *( domain name pointer 192-168-1-96.96 [root@bigboy tmp]# This may mean that you will have to create entries for all your DHCP IP addresses if you choose to use a DHCP method of assigning IP addresses during installation.168. Configure Your DHCP Server During the installation procedure. Chapter 29. 1) Create a /etc/exports file with the following entry in it.1. In other words. The startup scripts for these are found in the /etc/ 2) Make sure that the rpcbind (portmap on older versions of Linux) . will explain this in more [root@bigboy tmp]# exportfs -ra 4) The installation client must have a matching pair of forward and reverse DNS entries on your DNS server. "Remote Disk Access with NFS".my-site. You must use 192-168-1-96. 3) Run the exportfs command to add this directory to the NFS database of network available [root@bigboy tmp]# host 192.168. [root@bigboy tmp]# [root@bigboy tmp]# host 192-168-1-96. a DNS lookup on the IP address of the installation client must return a server name that will map back to the original IP address when a DNS lookup is done on that same server name. nfs. the installation client will prompt you for the IP address it should use for the installation[root@bigboy tmp]# passwd ftpinstall Changing password for user ftpinstall.

The Network Installation . [root@bigboy tmp]# wodim dev=/dev/scd0 driveropts=burnfree. There will be a file there named boot. [root@bigboy tmp]# wodim --devices wodim: Overview of accessible drives (1 found) : ------------------------------------------------------------0 dev='/dev/scd0' rwr--.: 'LITE-ON' 'DVDRW LH-20A1P' ------------------------------------------------------------[root@bigboy tmp]# 3. Fedora mirror sites that have directory structures similar to that of the DVD also have a boot.. [root@bigboy RPM]# Keep the CD. [root@bigboy tmp]# wget http://website.iso file located in the <fedora-version>/Fedora/i386/os/images/ directory. wodim: fifo had 6 puts and 6 gets. wodim: fifo was 0 times empty and 0 times full. Setting up the Installation Server as a DHCP server is fairly straight forward and can be found in Chapter 8.noforcespeed \ fs=14M -dao -eject -overburn -v boot. . You will soon need it for your kickstart client machine.. You will now need the device name of your CDROM device.. It usually larger than 10 MB in size and it is the boot file you need for kickstart. Here are the steps: 1. "Configuring the DHCP Server".iso which is used in booting your system when installing Linux from DVD or CD. The wodim command can now be used again to burn the boot.. Creating A Kickstart Boot CD Creating a kickstart boot CD is easy to do. min fill was .iso . BURN-Free was never needed. Your RPM directory should have a subdirectory named images in it. This file is different in both size and function to that on your DVD.Installation Client get its address via DHCP. Insert a blank CD.iso 2. This can be obtained using the wodim command. It will also reduce the possibility of human error. This will automate the installation more and will therefore make it faster. In this case it is called /dev/scd0.iso ISO image file to the CD...iso file from your favorite mirror site using a utility like wget. Download the boot.

1" 200 844228 "-" "urlgrabber/2.9" 192. This is the only CD you'll need for future network installations. HTTP) Select the Ethernet device to which the installation client is connected to the installation server network.247 .168. This will make the Installation client use DHCP during the installation. FTP.. except for the first couple steps.9.xml HTTP/1. It will help to verify whether the kickstart client is accessing the files correctly.xml.From here on.9" . You will see a number of choices Local CDROM Hard Drive NFS Image FTP HTTP y y y Select the network option of your choice (NFS.247 . Enter the IP address of the installation server when prompted for a "Web site name".1" 200 1140 "-" "urlgrabber/2.1. The following menus will be the usual Fedora GUI installation screens. The following menus will be text based versions of the usual Fedora installation screens.168. the installation procedure mimics the regular Linux installation.1" 200 853899 "-" "urlgrabber/2. This would most likely be interface "eth0".[12/Nov/2006:12:01:04 -0800] "GET /networkinstall/RPM/repodata/repomd.gz HTTP/1.247 .9" 192. issue the following command on the server to check the Apache logs. Select ³Install or upgrade an existing system´. The "Red Hat directory" will be "/data/network-install/ISO". You should retrace your steps if you are not.xml HTTP/1. A menu will appear. During the installation.1.9. y y y y Connect your client Linux box to the DHCP network. If You Selected The HTTP Method You will now reach the "HTTP Setup" menu. If You Selected The NFS Method You will now reach the "NFS setup" menu.[12/Nov/2006:12:01:19 -0800] "GET /networkinstall/RPM/repodata/comps. Boot your system using the kickstart boot CD.1.. You should get a status code of 200<code> after each GET statement. Go through the usual steps until the process prompts for the "Installation Method".168. Enter the IP address of the installation server as the "NFS Server Name".[12/Nov/2006:12:01:05 -0800] "GET /networkinstall/RPM/repodata/primary.. [root@bigboy tmp]# tail -f /var/log/httpd/access_log 192.The "Red Hat directory" will be /network-install/RPM.9. Select "DHCP" in the following "Configure TCP/IP" screen.

xml b _ o r ftp-install ftp 0 * c Troubleshooting The Network Installation You can do some basic troubleshooting by accessing the various installation status screens available.168.1. It will help to verify whether the kickstart client is accessing the files correctly.xml. the /var/log/vsftpd.1.231 844228 /data/networkinstall/RPM/repodata/primary. and your /var/log/messages file for the NFS method.gz b _ o r ftp-install ftp 0 * c Sun Nov 12 20:53:40 2006 2 192.231 853899 /data/networkinstall/RPM/repodata/comps. /var/log/httpd/error_log files for the HTTP method.If You Selected The FTP Method You will now reach the "FTP Setup" menu.231 1140 /data/networkinstall/RPM/repodata/repomd. Note: During the installation. The following menus will be text based versions of the usual RedHat installation screens. [root@bigboy ~]# tail -f /var/log/vsftpd. Automating Installation With Kickstart . Enter the username and password of your special FTP user account. y "Not Selecting" The Non-Anonymous FTP Box The "Red Hat directory" will be "/". Enter the IP address of the installation server as the "FTP Site Name". The following menus will be text based versions of the usual Fedora installation screens.168.xml b _ o r ftp-install ftp 0 * c Sun Nov 12 20:53:21 2006 2 192.1.log Sun Nov 12 20:53:12 2006 1 192.168.log file for the FTP method. issue the following command on the server to check the FTP logs. y "Selecting" The Non-Anonymous FTP Box The "Red Hat directory" will be "/data/network-install/RPM". Examine your server's <code>/var/log/httpd/access_log. y y y y y The installation logs can always be viewed by hitting <CTRL-ALT-F3> Kernel messages can be seen by hitting <CTRL-ALT-F4> Access to a limited BASH shell Kernel can be gained by hitting <CTRL-ALT-F2> You can return to the main installation screen at any time by hitting <CTRL-ALT-F1> for text based installations and <CTRL-ALT-F7> when the GUI is used.

You can use this file to create an automated installation of a duplicate system which can be useful if you have a large number of servers to install. If the server is going to reside on a different network after the installation. This section shows you how to automate network installations using the kickstart application and NFS. Here is an example: %post chkconfig chkconfig chkconfig chkconfig chkconfig chkconfig isdn off pcmcia off portmap off apmd off nfslock off nfs off A Note About Using anaconda-ks. It will bring up a menu from which you can select all your installation options. so you will either have to uncomment it . Adding Post Installation Commands You may want to run some commands on the newly created Linux installation after kickstart is complete. You may want to then edit the configuration file and comment out certain parameters that may change from system to system with a "#". you save the configuration with the filename of your choice. During the kickstart process you will be prompted for these unspecified values. RedHat comments out the partitioning information in this file.Both Fedora and RedHat Linux save all the parameters you used during installation in the /root/anaconda-ks.cfg file as a template for future installations. These could include things like the system's name and IP address. How To Create New Kickstart Configuration Files You can create a customized kickstart configuration file by using the "ksconfig" command from a GUI console. Note: Do not change the order of the entries in the kickstart configuration file. This can be done by placing a %post section at the end of the kicksrart file with all the post installation commands you wish to run. Some processes that are activated by default by Fedora may not be suitable for your server and may need to be disabled. then you'll have to run a separate script to change the IP addressing information after the installation is complete. When finished. Note: The IP address you assign must be on the same subnet as that of the DHCP server for kickstart to work. You can use HTTP and FTP but they have been omitted to keep the discussion brief.cfg kickstart configuration file.cfg It is possible to use the /root/anaconda-ks.

The examples below assume the subdirectory is called /data/network-install/kickstart. If not. Both methods are listed below: Manually Specifying the Kickstart Filename Once you have booted from your boot CDROM. you'll need to use the following command at the lilo boot: prompt to continue with the installation. install nfs --server=192.cfg file is the kickstart configuration file we want to use.cfg HTTP Method .and then make your partitioning modifications or be prepared to be prompted for your portioning information. How To Run A Kickstart Installation It is best to place your kickstart files in a subdirectory under the /data/network-install directory.100:/kickstart/ks. The second is to have your DHCP server automatically tell the Kickstart client about the name of the kickstart file to use when it assigns the IP address. install url --url http://192. The first is to enter it manually from the LILO boot: prompt when you insert the boot CD.168.100/network-install/RPM Booting With Your Kickstart Files There are two ways to specify the name of the kickstart file to use.16. The ks. NFS Method boot: linux ks=nfs:192.1. Using a NFS Server Verify that the first two lines of the file look like this or else you may be prompted for NFS ISO file location information. you will be prompted for this information.1. Remember that you may want to remove the "#" comments from the partition section of the file.168.100 --dir=/data/network-install/ISO Using a Web Server Verify that the first two lines of the file look like this or else you may be prompted for RPM base file location information.1.

filename "/data/network-install/kickstart/ks.conf file and add the following lines to the section for the interface that will be serving DHCP IP addresses.100/network-install/kickstart/ks. but also because it can be left unattended to install a predetermined Linux configuration. Time is saved not only because a network connection can be faster than using CDs. Conclusion The Kickstart method of Fedora Linux installation can greatly reduce the length of time it takes to install the operating system.cfg". then you may want to configure your DHCP server to specify the single kickstart configuration file you wish to use.100. Here is how it's done: 1) Place your kickstart file in the /data/network-install/kickstart directory. 3) Insert the boot CD into the kickstart client Linux box and connect it to the DHCP network. A Kickstart server connected to an isolated wireless network dedicated to the purpose may be a good idea for data centers with hundreds of Linux servers. A recent standard called PXE allows you to run kickstart without a CD ROM if you configure the NIC card to do a network boot from a specially configured DHCP server.1. The rest should be automatic. The topic is beyond the scope of this book. It will then automatically attempt to get a DHCP IP address and see if the DHCP server will specify a configuration file.168.cfg Configuring The Filename Automatically Whenever you have to create lots of cloned Linux servers.168.boot: linux ks=http://192. ===================================================================================== +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ . The next-server value is the IP address of the kickstart server. 2) Edit your dhcpd. At the boot: prompt type in the following command: boot: linux ks Kickstart will first search for a configuration file named ks.1. Kickstart will then use NFS to get both the configuration file and the installation ISOs. next-server 192. but it may be interesting for readers with more complex projects to research this option more.cfg on either the boot CD.

the presence of these adapters can dramatically lengthen the time it takes the system to boot. you cannot boot from a floppy. NFS. Refer to "BIOS setup" on page 25 if the system does not boot from the CD. insert the first installation CD into the CD drive and turn on or reset the system. Give the following command to install Fedora with SELinux turned on: boot: linux selinux When you give this command to install Fedora. Fedora gives you the option of booting from a USB pen drive using the diskboot. that is.Installing Red Hat Linux To begin most installations. The system boots from the CD and displays a screen of instructions with a boot: prompt at the bottom. or HTTP. you can generally press RETURN without entering a command to start installing Red Hat Linux. Booting the System: The boot: Prompt Normal installation You can give many different commands at a boot: prompt.img file. For more information. the installation proceeds as though you pressed RETURN. You may be able to fit some Red Hat Enterprise Linux kernels on a diskette. For hard disk and network-based installations. Fedora is installed with SELinux (page 379) turned off. in response to the boot: prompt: boot: linux nofb SELinux By default. page 51). Many newer motherboards come with SATA (Serial ATA) adapters ready for use. give the following command in response to the boot: prompt: . Non-CD installations If you are installing from other than CDs. the Firewall screen allows you to set up SELinux (Figure 3-5. Display problems If you have problems with the display during installation. You cannot fit a standard Fedora Core 2 (and later) kernel on a floppy diskette. if you do not type anything for a minute. if you are installing from files on the local hard disk or from files on another system using FTP. If you are installing from CDs. which turns off video memory. Or you can just wait. Unless you need a very secure system. give the following command. If you do not have SATA devices. refer to "CMOS" on page 25. Before starting the installation. you can use the rescue CD (page 39) in place of the first installation CD. you do not need to turn this feature on. disable SATA adapters in the BIOS. You cannot boot from a floppy diskette Because most kernels have grown too large to fit on a floppy diskette.

This installation probes the computer to determine as much as possible about the hardware. depending on the system you are installing and the commands you gave at the boot: prompt. RETURN Without entering a command.memtest86. to install Linux in text mode using a terminal running at 115. or other). FTP site. "The Anaconda Installer" on page 46. connected to the first serial device. 8 bits. press RETURN in response to the boot: prompt to perform a graphical installation from CDs. no parity. without probing for any devices. The balance of this section covers the commands you can give in response to the boot: prompt. the installer displays a graphical or pseudographical display. FTP. linux askmethod Gives you a choice of installation sources: local CD or hard drive or over a network using NFS. Many of the commands can be combined. After a while (up to a few minutes. or HTTP.115200n8 The next command installs Red Hat Linux in graphical mode (by default) on a monitor with a resolution of 1024x768. See www.boot: linux askmethod Booting As the system boots. memtest86 FEDORA Calls memtest86 when you boot from a CD only. Unless you are having problems with the installation or have special requirements. y Local CD Displays the CD Found screen. pausing occasionally. Boot Commands All the commands (except for memtest86) you can give in response to the boot: prompt consist of the word linux followed by an argument that is passed to the Anaconda installer. you can skip to the next section.200 for more information. The installation program asks you to specify the source of the installation data (CD. give the following command (the . Each command must be terminated with RETURN. Press C to configure the test. which allows you to test the installation media (the same as if you had just pressed RETURN). ESCAPE to exit. text scrolls on the monitor. For example. boot: linux resolution=1024x768 noprobe askmethod Following are some of the commands you can give at the boot: prompt.115200n8 is optional): boot: linux text console=ttyS0. The GPL-licensed memtest86 utility is a standalone memory test for x86-based computers. depending on the speed of the system). .

graphics cards. Use when probing causes the installation to hang or otherwise fail. page 51). and the monitor. Useful when problems occur when the graphical phase of the installation starts. hard drive ISO. linux selinux FEDORA Enables SELinux (page 379) on the system you are installing. the Firewall screen allows you to set up SELinux (Figure 35. including network cards (NICs). You must know exactly which cards or chips the system uses when you use this command. DVD. or HTTP Displays the Configure TCP/IP screen from which you can select DHCP or enter the system's IP address. netmask. and primary nameserver.y y Hard drive Prompts for the partition and directory that contains the ISO images of the installation CDs. see linux noprobe for more information. default gateway (IP). Particularly useful for systems with LCD displays. resolution=1024x768 specifies a monitor with a resolution of 1024 by 768 pixels. For example. . linux vnc FEDORA Installs over a VNC (Virtual Network Computing) remote desktop session. linux noprobe Disables hardware probing for all devices. Replace xxx with the number of megabytes of RAM in the computer. linux nofb no framebuffer Turns off the framebuffer (video memory).realvnc. For more information. you can control the installation remotely using a VNC client from a remote computer. This command allows you to give arguments for each device driver you specify. linux lowres Runs the installation program at a resolution of 640x480. refer to "Check the CDs" on page 47. See also linux resolution. FTP .com. When you give this command to install Fedora. linux text Installs Linux using pseudographical mode. see page 377 for details. This option works with the CD. and NFS ISO installation methods. Forces you to select devices from a list. After providing an IP address. NFS . Although the images on the screen appear to be graphical. linux mem= xxx M Overrides the detected memory size. from www. Linux rescue Puts the system in rescue mode. FEDORA This test is performed automatically during a normal CD installation. they are composed entirely of text characters. linux resolution= WxH Specifies the resolution of the monitor you are using for a graphical installation. You can download the VNC client. linux mediacheck Tests one or more installation CDs using an MD5 sum. linux skipddc Allows you to configure the monitor manually. which runs on several platforms.