Virt-kscfg

From JJBwiki

Jump to: navigation, search


Here's a sample kickstart (ks) file that will build a minimalistic RHEL5 machine suitable for use with Xen. It's up to you to build your own kickstart server. This ks file assumes the kickstart server is NFS-based (which I recommend). When virt-install prompts you, make the vm size 8GB. See the Virt-install page for details on how to create the vm and launch into a kickstart.

install
nfs --server=10.10.10.1 --dir=/kickstart/install/rhel5
lang en_US.UTF-8
langsupport --default=en_US.UTF-8 en_US.UTF-8
keyboard us
mouse none
skipx
network --device eth0 --bootproto dhcp --hostname localhost 
timezone America/New_York
rootpw FreshInstall 
reboot
text
firewall --disabled
selinux --disabled
authconfig --enableshadow --enablemd5

# Use license key for rhel5
key xxxxxxxxxxxxxxx


# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
bootloader --location=mbr --append="console=xvc0"
clearpart --all --initlabel

# standard LVM partitioning
part /boot --fstype ext3 --size=120 --asprimary
part pv.01 --size=0 --grow --asprimary
volgroup vg00 --pesize=32768 pv.01
logvol / --fstype ext3 --vgname=vg00 --size=2048 --grow --name=root
logvol /var --fstype ext3 --vgname=vg00 --size=4096 --name=var
logvol swap --fstype swap --vgname=vg00 --size=1024 --grow --maxsize=2048 --name=swap

%packages
# Installs @ base and @ core by default
# Install X-Window system
@ base-x

# Best parts of @ system-tools
arpwatch
dtach
net-snmp-libs
net-snmp-utils
nmap
screen

# Best parts of @ text-internet
elinks
lynx
tftp

# Others to install
curl
libcap
openldap-clients
net-snmp
perl-Digest-HMAC
perl-Digest-SHA1
vim-enhanced
ntp

# Do not install these (includes parts of @ base)
-arts
-unixODBC-kde
-alsa-lib
-alsa-utils
-bluez-utils
-cups
-cpuspeed
-desktop-backgrounds-basic
-evolution-data-server
-ghostscript
-NetworkManager
-pcmciautils
-rp-pppoe
-system-config-network-tui
-wireless-tools

%post

# Strip out the splashimage from grub.conf, so console redir won't spag.
cp /boot/grub/grub.conf /boot/grub/grub.conf.splashimage
grep -v splashimage /boot/grub/grub.conf.splashimage > /boot/grub/grub.conf

# adjust services
/sbin/chkconfig --level 345 avahi-daemon off
/sbin/chkconfig --level 345 netfs on
/sbin/chkconfig --level 345 portmap on
/sbin/chkconfig --level 345 nfs off
/sbin/chkconfig --level 345 nfslock on
/sbin/chkconfig --level 345 microcode_ctl off
/sbin/chkconfig --level 345 gpm off
/sbin/chkconfig --level 345 kudzu off
/sbin/chkconfig --level 345 syslog on
/sbin/chkconfig --level 345 network on
/sbin/chkconfig --level 345 rawdevices off
/sbin/chkconfig --level 345 saslauthd off
/sbin/chkconfig --level 345 atd on
/sbin/chkconfig --level 345 irda off
/sbin/chkconfig --level 345 psacct off
/sbin/chkconfig --level 345 diskdump off
/sbin/chkconfig --level 345 isdn off
/sbin/chkconfig --level 345 iptables off
/sbin/chkconfig --level 345 pcmcia off
/sbin/chkconfig --level 345 irqbalance on
/sbin/chkconfig --level 345 sendmail on
/sbin/chkconfig --level 345 smartd off
/sbin/chkconfig --level 345 autofs on
/sbin/chkconfig --level 345 netdump off
/sbin/chkconfig --level 345 sshd on
/sbin/chkconfig --level 345 mdmonitor off
/sbin/chkconfig --level 345 mdmpd off
/sbin/chkconfig --level 345 crond on
/sbin/chkconfig --level 345 xinetd off
/sbin/chkconfig --level 345 cups off
/sbin/chkconfig --level 345 rhnsd off
/sbin/chkconfig --level 345 snmpd on
/sbin/chkconfig --level 345 snmptrapd off
/sbin/chkconfig --level 345 ntpd on
/sbin/chkconfig --level 2345 haldaemon off
/sbin/chkconfig --level 345 yum-updatesd off
/sbin/chkconfig --level 345 nscd on

Personal tools