Showing posts with label RHEL 6. Show all posts
Showing posts with label RHEL 6. Show all posts

RHEL6.1 Kickstart file

RHEL6.1 Kickstart file


The following file is the kickstart file for installing RHEL6.1

#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use NFS installation media
nfs --server=192.168.0.254 --dir=/var/ftp/pub/rhel6.1
# Root password
rootpw --iscrypted $1$x7Z15vjx$hG7xzuDLfLbCqgvxiazDx.
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use text mode install
text
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone --isUtc Asia/Kolkata
# System bootloader configuration
bootloader --location=mbr --md5pass="$1$phl5jhIB$vIl45UqkSrUgZnUxdyySw."
# Partition clearing information
clearpart --all  
# Disk partitioning information
part / --fstype="ext4" --size=10000
part /home --fstype="ext4" --size=1024
part swap --fstype="swap" --size=1024

%packages
@additional-devel
@backup-client
@backup-server
@base
@cifs-file-server
@client-mgmt-tools
@compat-libraries
@console-internet
@core
@debugging
@basic-desktop
@desktop-debugging
@desktop-platform
@desktop-platform-devel
@development
@dial-up
@directory-client
@directory-server
@mail-server
@eclipse
@emacs
@identity-server
@ftp-server
@fonts
@general-desktop
@graphical-admin-tools
@graphics
@hardware-monitoring
@ha
@ha-management
@infiniband
@input-methods
@internet-browser
@java-platform
@kde-desktop
@large-systems
@legacy-unix
@legacy-x
@load-balancer
@mainframe-access
@system-management-messaging-client
@mysql-client
@mysql
@nfs-file-server
@network-server
@storage-server
@network-file-system-client
@network-tools
@php
@performance
@perl-runtime
@postgresql-client
@postgresql
@print-server
@print-client
@remote-desktop-clients
@resilient-storage
@system-management-snmp
@scientific
@security-tools
@server-platform
@server-platform-devel
@server-policy
@storage-client-multipath
@system-management
@system-admin-tools
@system-management-messaging-server
@tex
@technical-writing
@turbogears
@virtualization-client
@virtualization-platform
@web-server
@web-servlet
@system-management-wbem
@x11
@storage-client-iscsi
libXinerama-devel
xorg-x11-proto-devel
startup-notification-devel
libgnomeui-devel
libbonobo-devel
junit
libXau-devel
libgcrypt-devel
popt-devel
libdrm-devel
libXrandr-devel
libxslt-devel
libglade2-devel
gnutls-devel
mtools
pax
python-dmidecode
oddjob
sgpio
genisoimage
wodim
abrt-gui
qt-mysql
desktop-file-utils
ant
rpmdevtools
jpackage-utils
rpmlint
krb5-pkinit-openssl
certmonger
openldap-clients
pam_krb5
krb5-workstation
ldapjdk
samba
krb5-server-ldap
krb5-server
slapi-nis
netpbm-progs
ImageMagick
telnet
tcp_wrappers
xterm
xorg-x11-xdm
libXmu
perl-DBD-MySQL
dnsmasq
radvd
sg3_utils
perl-DBD-SQLite
perl-Mozilla-LDAP
rdesktop
atlas
numpy
hmaccalc
ipmitool
pexpect
crypto-utils
libvirt-java
mod_auth_kerb
mod_nss
certmonger
perl-CGI
mod_revocator
tog-pegasus
%end

PXE Server in RHEL 6 ?

How to configure PXE Server in RHEL 6 ?

Server IP settings.

IP 192.168.0.70
SUBNET 255.255.255.0
nmcontrolled no
onboot yes
DNS1=192.168.0.1

 
Yum install system-config-kickstart
# Install the kickstart package.

system-config-kickstart
# run the kickstart utility.
In the second last option you can remove text mode installation option and opt For a graphical one. 

Select the http installation method 
Use the defaults. 
In the disk label option choose the first option (Initialize the disk label).
The partitions that I have created are like this.

Mount Point            type         size
/boot         ext4         500
 swap         swap         2048
  /                     ext4         18000
 
Make sure that SELinux option is disabled and Security level is set to Disable firewall.
Save the ks.cfg file to the filesystem.
Yum install –y syslinux xinetd tftp-server dhcp httpd
# Install all the required packages through yum

mkdir /var/lib/tftpboot/pxelinux.cfg
cp  /usr/share/syslinux/pxelinux.0  /var/lib/tftpboot/

vi /etc/xinetd.d/tftp
# Open the xinetd settings to enable tftp server.
# at line 14 set the parameter to no from yes.
Disable=no 
service xinetd restart
# Restart the service to apply the settings made.

chkconfig xinetd on
# set the service to start with each subsequent system reboots.


vi /etc/dhcp/dhcpd.conf
# Open the file and configure the DHCP Server.


# Global Options
Allow booting;
Allow bootp;
authoritative;

# Subnet definition
subnet 192.168.0.0 netmask 255.255.255.0 {
# Parameters for the local subnet
option routers               192.168.0.1;
option subnet-mask           255.255.255.0;
option domain-name           “example.com”;
option domain-name-servers   192.168.0.1;
default-lease-time           21600;
max-lease-time               43200;
# Client IP range
range dynamic-bootp 192.168.0.100 192.168.0.200;
filename  “pxelinux.0”;
next-server  192.168.0.70;
}

# Here the next–sever parameter is the address of the kickstart server.

service dhcpd restart
Chkconfig dhcpd on

# restart the service and make it permanent.

mkdir –p /var/pxe/rhel6
mkdir /var/lib/tftpboot/rhel6
# make some required directories.

Insert your RHEL 6 dvd

mount  /dev/cdrom   /mnt
# Mount it to /mnt

ls –l /mnt
# Check the contents to see if it is properly mounted.

cp –ivr /mnt/*  /var/pxe/rhel6
# copy all the contents to the /var/pxe/rhel6 directory.

umount /mnt
eject
# after the file copy operation unmount and eject the dvd.

cp  /var/pxe/rhel6/images/pxeboot/vmlinuz   /var/lib/tftpboot/rhel6
cp  /var/pxe/rhel6/images/pxeboot/initrd.img   /var/lib/tftpboot/rhel6
# copy the vmlinuz and initrd.img files to the tftpboot directory.

cp /usr/share/syslinux/menu.c32  /var/lib/tftpboot/
# copy the menu file.

vi /var/lib/tftpboot/pxelinux.cfg/default

timeout 100
default menu.c32

menu title $$$$$$Boot Menu$$$$$$
label 1
  menu label ^ 1) RHEL6
  kernel rhel6/vmlinuz
  append initrd=rhel6/initrd.img  ks=http://192.168.0.70/ks/ks.cfg  ksdevice=eth0

# Prepare the boot menu. 
 
 
 
 
chkconfig httpd on

vi  /etc/httpd/conf.d/pxeboot.conf

# create new entry

Alias /rhel6 /var/pxe/rhel6

   Options Indexes FollowSymLinks
   Order Deny,Allow
   Deny from all
   Allow from 127.0.0.1  192.168.0.0/24
# Ip address you allow



service httpd restart
(ignore the domain name error if it occurs.)

# Prepare the httpd server


mkdir /var/www/html/ks

cp /ks.cfg   /var/www/html/ks/ks.cfg
chmod 644 /var/www/html/ks/ks.cfg

# make the directory and copy the kickstart file to it.
# and make the kickstart file globally read only.

The pxe server is ready.

Plug a computer into the network and boot it through LAN using pxe.

The client pc should  have a display as below.