Saturday, March 20, 2010

How to configure kickstart with remote installation in rhel5 [kickstart + dhcp] or centos5

Advertisements

KickStart [Unattended Installation]
When installing linux we have to sit if front of the system and answer the questions whenever it asks. This process is time consuming and needs one to attend while installation take process.Kickstart helps to install system unattended. We can create an answer file and notify the system to take the answers from the file. The file is known as kickstart file. We can configure dhcp such a way that it will automatically provide the system the path and details of the kickstart file in the network .In windows systems kickstart file is known as answer file. In this post we will see howto configure kickstart server linux step step and doing the remote installation using kickstart.

it is advised to read the remote installation post if you dont have much idea about remote installation.
These are the steps happening.
Server[dhcp+ks] client
1. asks IP and location of kickstart file
2.gives the info
3. Takes the ks.cfg file and mounts share of OS



dhcp [nfs / ftp / http] + ks.cfg [nfs]
The dhcp is using for getting IP for the client machine at first for instation and to get the location of Ks.cfg file. The remote installation image can be of NFS, HTTP or FTP. The kickstar file will be shared using NFS.

KickStart Configuration
package = system-config-kickstart
#yum -y install system-config-kickstart
#system-config-kickstart

Basic configuration
Default Language = English USA
Keyboard = U S English
Time Zone = Asia/Culcutta
Root Password = redhat
Confirm Password = redhat
check the encryption box
Target Architecture = x86,AMD64 or Intel EM64T
Check the reboot checkbox

Installation Method
Installaton method = Perform new installation
Choose the Installation Method = NFS //You can use HTTP or FTP if you want
NFS server = IP of the machine which contains NFS image of DVD
NFS directory = Path of NFS share

Boot Loader options
Install New Boot Loader
Use GRUB password if required
Install boot loader on MBR

Partition Information
Do not clear MBR
Remove all exisiting partitions //Removing linux partitions only wont work all time. Windows partitions will be deleted.
click add button and configure as required

Network Configuration
Click Add Network Devices button
Select the network device which is connected to ur machine
network type = DHCP or STATIC [manual]

Authentication
Authentication Configuration
check use shadow passwords
check use MD5

Firewall Configuration
Firewall Configuration
Security level = Disable firewall
SELinux = Disabled

Display Configuration
Check Configure the x-window system
In General Tab
Color Depth Resolution
8 1024*768 //Default 640*480 will give a blurred image
Default Desktop
Check Gnome
Check Start X window system on Boot

package selection
Nothing to do //We will add package lines

Pre-Installation Script
Add if wanted

Post-Installation Script
Add if wanted

Configuration over. Save the file. Open the file for further editing.
#vi ks.cfg

Add these lines - Otherwise it wont work.
key --skip
%packages

And these lines for Graphics

@admin-tools
@base
@base-x
@core
@dialup
@editors
@games
@gnome-desktop
@graphical-internet
@graphics
@java
@office
@printing
@sound-and-video
@text-internet

###Make it as NFS share###
copy the ks.cfg file to some dir and share it via NFS

#mkdir /kick
#cp ks.cfg /kick/


#vi /etc/exports
/kick *()

#exportfs -a

###DHCP Configuration###
Add these lines to DHCP Configuration file
#vi /etc/dhcpd.conf

filename "/kick/ks.cfg";
next-server 192.168.1.101; // [ip of the machine which contains kickstart file(ks.cfg)]

#service dhcpd restart
#service nfs restart

###Installation###

#Boot: linux ks
Have a break. The system will be ready when you get back!

If you are not using dhcp, you can use following format at boot
#Boot: linux ks=nfs:IP_ADDR_NFS_SVR:/location/of/ks.cfg ksdevice=eth0 IP:IP_ADDR_CLIENT netmask=255.255.255.0 gateway=IP_ADDR_gateway

Recommended Reading

1. Practical Guide to Linux Commands, Editors, and Shell Programming, A (2nd Edition)
2. UNIX and Linux System Administration Handbook (4th Edition)
3. Linux All-in-One For Dummies
4. Introduction to the Command Line (Second Edition): The Fat Free Guide to Unix and Linux Commands

24 comments:

  1. great man it is helpful for my
    hello man pls help me how to install rhel5.5 from nfs server and what will be the mount point

    ReplyDelete
  2. hello great topic help me for nfs installation what will be the mount point

    ReplyDelete
  3. Hello,
    I have a problem with a network installation (NFS server).
    In the machine to be installed, the message:

    "Unable to download the kickstart file. Please modify the kickstart parameter below or press cancel to proceed as an interective installation"

    Below I show the full path configuration file .Ks:

    "nfs: 195.3.100.101: / install/common/scripts/TRANSNOA/noa1pdsora.ks"

    Can guide me on the possible error? thank you very much to anyone who can help me.

    Best Regards

    ReplyDelete
  4. Did you give enough permission for the ks file? give 777

    ReplyDelete
  5. Helo Randeep, I gave the 775 permission, but still doesn't works.

    The Linux instalation is advancing, until the drivers scsi charging, and then the error messages appear.

    if I modify the name or contents of noa1pdsora.ks, the message is the same. I think the problem is near of boot file: /tftpboot/pxelinux.cfg/

    The mac_file archive says where found the kickstar file:


    #Customer:TRANSNOA Hostname:noa1pdsora 64bit
    default 1
    timeout 100
    label 1
    kernel /rhel5_64/vmlinuz
    append initrd=/rhel5_64/initrd.img ramdisk_size=9216 ks=nfs:195.3.100.101:/install/common/scripts/TRANSNOA/noa1pdsora.ks ksdevice=eth0 ip=195.3.100.193 netmask=255.255.255.0 gateway=195.3.100.253 lang=en_US01 nicdelay=30

    Could you help with any idea?, I don't know how to resolve the issue

    Tell me please, If you need more information.

    Thank you in advanced.

    carlino

    ReplyDelete
    Replies
    1. It seems the error ""Unable to download the kickstart file. Please modify the kickstart parameter below or press cancel to proceed as an interective installation"" is resolved? Can you provide a screenshot? Did you export the directory /install/common/scripts/TRANSNOA/ on 195.3.100.193? is it available to mount? did u try mounting it to other systems?

      Delete
  6. Randeep was not resolved. I can not generate a screenshot, because the installation is from zero, there is not operating the machine to be installed.

    When I do:

    noa1kick.xa21ems.transnoa.com.ar: # / install / common / scripts / Transnoa> exportfs
    I see:
    / install

    this is correct?

    In the remote machine I saw the follow, With ALT + F3:
    ERROR: NO NETWORK DEVICES NETWORK DEVICE IN CHOOSE!
    ERROR: NETWORK DEVICES FOR NOT DOING KICKSTAR
    ERROR: UNABLE TO BRING UP NETWORK

    And in the server kickstar, / var / log / messages
    Jan 26 16:48:53 noa1kick in.tftpd [15206]: tftp: client does not accept options

    Any idea whats is wrong?
    Thankyou in advanced.

    Carllino

    ReplyDelete
  7. The error is because your system(the one being installed) does not have an ip. You better run dhcp service in the system where ks file is placed. and give the location of ks file in dhcpd.conf

    ReplyDelete
  8. Randeep, the dhcpd service is running in the kickstar server:

    here the dhcpd.conf file, where I must give the location of .ks?

    ddns-update-style interim;
    ignore client-updates;

    allow bootp;
    allow booting;

    class "pxeclients" {
    match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
    next-server 195.3.100.101;
    filename "pxelinux.0";
    }

    subnet 195.3.100.0 netmask 255.255.255.0 {
    range 195.3.100.192 195.3.100.200;
    option routers 195.3.100.253;
    default-lease-time 21600;
    max-lease-time 43200;
    }

    group TRANSNOA {
    option routers 195.3.100.253;
    option subnet-mask 255.255.255.0;

    host noa1pdsora {
    hardware ethernet 50:e5:49:49:40:11;
    fixed-address 195.3.100.193;
    }
    }

    ReplyDelete
    Replies
    1. try without dhcp

      linux ks=nfs:IP_ADDR_NFS_SVR:/location/of/ks.cfg ksdevice=eth0 IP:IP_ADDR_CLIENT netmask=255.255.255.0 gateway=IP_ADDR_gateway

      Delete
  9. HI: I could solve the connectivity between computers by assigning a static IP (before install windows to do so), it is assumed that the installation of Redhat will tread all.

    But the error message remains:

    "Unable to download the kickstart file. Please modify the kickstart parameter below or press cancel to proceed as an interective installation"

    But now I get to the installation Intec (I choose NFS image):

    I request: server name or IP
    path

    But any path I guess I should enter, tell me you can not mount:

    In the server I did:

    mount-t nfs 195.3.100.101: / install / mnt / tmp

    but the message is identical

    Are saying?, Something wrong with these steps?

    thanks

    ReplyDelete
  10. The output of exportfs, says:

    noa1kick.xa21ems.transnoa.com.ar:#/mnt/tmp> exportfs
    /cots/yum.repo
    /install

    ReplyDelete
  11. What is the output of these commands.
    showmount -e IP_address_of_the_ks_file_system

    it should be like this

    root@cpaneltest [~]# showmount -e 192.168.1.10
    Export list for 192.168.1.10:
    /install *
    root@cpaneltest [~]#

    And the output of the following command from the system where ks file resides
    root@cpaneltest [~]# exportfs -v
    /install (rw,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)

    ReplyDelete
  12. noa1kick.xa21ems.transnoa.com.ar:#/> showmount -e 195.3.100.101
    Export list for 195.3.100.101:
    /install *
    /cots/yum.repo *

    noa1kick.xa21ems.transnoa.com.ar:#/> exportfs -v
    /cots/yum.repo (ro,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
    /install (ro,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)

    Anything wrong?
    Thankyou Randeep!

    ReplyDelete
  13. It looks fine. What is the exact error message you are getting now? when giving the ks file details on boot prompt?

    like
    linux ks=nfs:IP_ADDR_NFS_SVR:/location/of/ks.cfg ksdevice=eth0 IP:IP_ADDR_For_the_machine_to_be_installed netmask=255.255.255.0 gateway=IP_ADDR_gateway

    ReplyDelete
  14. The boot process begins ... then the graphics mode (blue screen) appears Linux installation ...

    Then it starts to install SCSI drivers ....

    And then the error message (in a graphic mode) are:

    "You can not download the kickstart file. Please modify the kickstart parameter below or press cancel to proceed as an interactive installation"

    and below the line:

    "nfs: 195.3.100.101: / install/common/scripts/TRANSNOA/ks.cfg"

    I tried to change this line, but never successfully

    Cancel option does not work, I can not move from this step.

    Assigning a static IP, I could to proceed with an interactive installation, but here is the last error:

    "Failed to mount nfs source."

    ReplyDelete
  15. please create a directory /kickstart with 775 permission and put ks.cfg in it and try. giv e ks.cfg 755 permission.

    ReplyDelete
  16. Didnt works. Also, I configured de /tftpboot/pxelinux.cfg/01-50-e5-49-49-40-11 with the line:
    ks=nfs:195.3.100.101:/kickstart/ks.cfg

    In the target installation machine, I make ALT + F3, and I saw:

    INFO : doing kickstart... setting it up
    WARNING : no network link detected on eth0
    error : no dns server, can´t look up hostname.
    info : url is 195.3.100.101:/kickstart
    info : file location: nfs:/195.3.100.101:/kickstart/ks.cfg
    error : failed to mount nfs source

    Im not sure, but the connection isnt established, any idea?

    Regards!

    ReplyDelete
  17. HI,
    I am configuring kickstart file on vmware,
    I have created redhat server,
    and created ks.cfg file to /var/ftp/pub directory as i wanted to do installation using ftp.
    On server side i did all configurations like ks.cfg file and service vsftpd restart.
    and i start installation on client vmware machine using command as you stated above
    " If you are not using dhcp, you can use following format at boot
    #Boot: linux ks=nfs:IP_ADDR_NFS_SVR:/location/of/ks.cfg ksdevice=eth0 IP:IP_ADDR_CLIENT netmask=255.255.255.0 gateway=IP_ADDR_gateway "
    but i am getting error massage
    " There was error configuring your network interface "
    Pls help me

    ReplyDelete
  18. is /var/ftp/pub shared through nfs? are the ips of both server and client in same network? is the name of the ethernet device correct(eth0)?

    ReplyDelete
  19. iam not able to start the installation even after folloing the same procedure. i have dhclient and try downloading dhcpd .conf file. iam getting the error unable to download. please modify kickstart parameter

    ReplyDelete
  20. hello
    iam getting an error unable to download the kickstart file.
    iam confused with dhcpd.conf file because i have dhclient ho to configure?

    Please help me out

    ReplyDelete
  21. hello

    iam getting an error unable to download and modify the parameters and the parameters i have given are nfs:10.10.2.123:/kick/ks.cfg
    Please do help me out
    i have checked permissions to 777
    but still couldnot do it
    help me out with this

    ReplyDelete
  22. are we supposed to edit our /etc/fsck file anytime for this kickstart installation

    ReplyDelete

Be nice. That's all.