- Deep Shift Labs Development Blog - http://www.deepshiftlabs.com/dev_blog -

CentOS 6 minimal install on VMware with kickstart

Posted By On 19 March 2012 @ 13:21 | Comments Disabled

In this post I would like to show how you can install bare minimum CentOS 6 system on VMware using a kickstart file. You will need to have a VMWare Workstation 8 installed and load either i386 [1] netinstall image or the x86_64 [2] bit version. My links point to the closest CentOS mirrors for me, and you will load it from one [3] close to you.
We will not need Virtual CloneDrive [4] as VMware is capable of running install directly from .iso file.

Let’s begin by creating a new virtual machine.

Step 1 - Create a new virtual machine

Fig. 1 Launch new virtual machine wizard

Step 2 - Select Workstation 8.0

Fig. 2 Select Workstation 8.0

Step 3 - Point to loaded netinstall image

Fig. 3 Point to loaded netinstall image

Step 4 - I install CentOS 6.2 64 bit

Fig. 4 I install CentOS 6.2 64 bit

Step 5 - Select location for VM files

Fig. 5 Select location for VM files

Step 6 - I have 4 cores on i7 so I give 2 of them to VM

Fig. 6 I have 4 cores on i7 so I give 2 of them to VM

Step 7 - I have 16Gb RAM and give 2Gb to CentOS VM

Fig. 7 I have 16Gb RAM and give 2Gb to CentOS VM

Step 8 - I use static IP's and want to use bridged neworking

Fig. 8 I use static IP’s and want to use bridged networking

Step 9

Fig. 9 Accept defaults

Step 10

Fig. 10 Accept defaults

Step 11

Fig. 11 Accept defaults

Step 12 -With minimal install VM file will be less than 1G

Fig. 12 With minimal install VM file will be less than 1G

Step 13

Fig. 13 Accept defaults

Step 14 - VM setup is completed

Fig. 14 VM setup is completed

Step 15 - Press Tab here to plug kickstart in

Fig. 15 Press Tab here to plug kickstart in

Now we have to say a few words about kickstart. There are plenty of [5] options for ‘ks’ parameter. I used web way. This is where [6] my kickstart was but Vadym, who created it for me, may delete it later so I put in in here.

View Code [7] TXT
text
skipx
install
url --url http://mirror.cogentco.com/pub/linux/centos/6/os/x86_64/
repo --name=epel --baseurl=http://download.fedoraproject.org/pub/epel/6/x86_64/
repo --name=updates --baseurl=http://mirror.cogentco.com/pub/linux/centos/6/updates/x86_64/
lang en_US.UTF-8
keyboard us
rootpw 123456
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone Etc/UTC
bootloader --location=mbr
zerombr
clearpart --all --initlabel
part /boot --fstype ext4 --fsoptions="noatime" --size=200
part pv.1 --size 1 --grow
volgroup vg0 --pesize=4096 pv.1
logvol / --fstype ext4 --fsoptions="noatime" --name=root --vgname=vg0 --size=8192
logvol swap --fstype swap --name=swap --vgname=vg0 --size 2048
logvol /var --fstype ext4 --fsoptions="noatime,nodev" --name=var --vgname=vg0 --size=4096
logvol /home --fstype ext4 --fsoptions="noatime,nodev" --name=home --vgname=vg0 --size=2048
 
services --enabled=sendmail,network,ntpd,ntpdate
 
reboot
 
%packages --nobase
epel-release
openssh-clients
openssh-server
yum
at
acpid
vixie-cron
cronie-noanacron
crontabs
logrotate
ntp
ntpdate
tmpwatch
rsync
sendmail
mailx
which
wget
-postfix
-prelink
-selinux-policy-targeted
%end

I do not want to go into true minimal install discussion as I trust Vadym :) Let’s say it is one of the minimal install kickstarts. You can get the most benefits from kickstarts if you are going to install many systems or move them around. We extensively use kickstarts in Nerrvana [8] under Vadym’s guidance. Our core, FTPS servers, Selenium Hub and CentOS RC VMs are all kickstarted. We can move them to another hoster pretty easily and our kickstarts reflect all packages installed as well as our own RPM’s and customisations we need for each system.

In this case we are not going to reinstall or move a system – we just want to start it and not waste time clicking around selecting packages and creating file systems. Basically we want to save time. In future posts we may share different tips of our real kickstarts as well as the way we create Windows based Xen VMs with different browsers for Nerrvana. We simply want to share what we learned while building Nerrvana so others can benefit creating their own Selenum testing systems.

Back to our topic. Put your kickstart file to make it available via HTTP. You can simply start IIS and add this file to default IIS home directoty, for example.

Step 16 - Add kickstart parameters and hit Enter

Fig. 16 Add kickstart parameters and hit Enter

Step 17 - Installation starts

Fig. 17 Installation starts

Step 18 - 'Asknetwork' param at work

Fig. 18 ‘Asknetwork’ param at work

Step 19 - Enter network details

Fig. 19 Enter network details

Step 20 - Installation resumes

Fig. 20 Installation resumes

Step 21 - Use Alt+F3 to see logs while installation goes on

Fig. 21 Use Alt+F3 to see logs while installation goes on

Step 22 - OS and packages from kickstart installed

Fig. 22 OS and packages from kickstart installed

Step 23 - All done. Now install what you want.

Fig. 23 All done. Now install what you want.

Step 24 - Takes 725Mb of disk space

Fig. 24 Takes 725Mb of disk space

Now you can login as root/123456, change password, set sshd, disable root login via ssh, create an account for youself, install MySQL, PHP etc.


Article printed from Deep Shift Labs Development Blog: http://www.deepshiftlabs.com/dev_blog

URL to article: http://www.deepshiftlabs.com/dev_blog/?p=1571&lang=en-us

URLs in this post:

[1] i386: http://mirror.aarnet.edu.au/pub/centos/6.2/isos/i386/CentOS-6.2-i386-netinstall.iso

[2] x86_64: http://mirror.aarnet.edu.au/pub/centos/6.2/isos/x86_64/CentOS-6.2-x86_64-netinstall.iso

[3] one: http://isoredirect.centos.org/centos/6/isos/x86_64/

[4] Virtual CloneDrive: http://www.slysoft.com/en/virtual-clonedrive.html

[5] plenty of: http://www.centos.org/docs/5/html/5.1/Installation_Guide/s1-kickstart2-startinginstall.html

[6] where: http://www.chepkov.com/centos6.cfg

[7] View Code: http://www.deepshiftlabs.com/dev_blogjavascript:;

[8] Nerrvana: http://www.nerrvana.com

Content copyright © 2010 Deep Shift Labs.