Sunday, March 20, 2011

Installing CentOS Step-by-Step


This procedure walks you through a step-by-step installation of CentOS 5.5.  This procedure is performed using VMware Workstation 7.1.3 to host the guest operating system.  Installation of CentOS in this procedure will occur in five distinct steps: 1) setting up the virtual drive; 2) partitioning the disk using CentOS Disk Druid; 3) performing a default installation of CentOS 5.5; 4) updating CentOS; and 5) installing Sysstat.  The latest version of CentOS can be downloaded free from the CentOS website [1].  You can get a 30-day trial of VMware Workstation from the VMware website [2].  This step-by-step walkthrough is similar to Robinson's excellent walkthough [9], but updated and with additional detail on partitioning. More detailed installation instructions can be found in the CentOS documentation [3].  All references "[]" used in this walkthrough are listed below, in the References section.  Good Luck!


Step 1: Setting up the Virtual Drive

VMware Workstation provides some handy features that substantially automate installation of common Linux distributions, such as CentOS.  VMware will recognize the Linux distribution, automatically partition the virtual disk, configure it, and then install Linux.  The problem with VMware's automated installation is that it's automated disk partitioning routine may not partition the disk adequately, leaving insufficient space in certain partitions for software installation.  To avoid this problem at the outset, this procedure will manually walk you through manual configuration of the CentOS partitions prior to OS installation in order to ensure that the root partition has enough space for Jive installation.  The next few steps show you how.

Download the CentOS installation ISO [1] and burn to disk.  Insert the CentOS installation disk in the disk drive.

From the File menu, point to New, and then select Virtual Machine...  The New Virtual Machine Wizard appears.

Select Custom, and then click Next.

Accept the default workstation, and then click Next.

Select I will install the operating system later, and then click Next.  This option will likely already be selected for you.

On the Guest operating system, select Linux; then, from the Version drop down list, select CentOS; and then click Next.

In the Virtual machine name text box, enter a name; then browse to the location you want to store this virtual machine; and then click Next.

Accept the defaults, and then click Next.

Accept the defaults, and then click Next.  1 GB is more than sufficient for a development machine.

For the purposes of this procedure, the Use bridged networking options is selected.  However, any of the options may be selected at this point.  Select the option most appropriate to your needs, and then click Next.

Accept the default, and then click Next.

Select the Create a new virtual disk option, and then click Next.

Accept the default, and then click Next

Enter the size of the virtual disk; check the Allocate all disk space now option; select the Store virtual disk as a single file option; and then click Next.  For development purposes, 15 GB is more than sufficient.  It is easier to track a single disk file rather than multiple disk files for a given installation.  Allocating all of the disk space immediately simplifies future software installation.

Accept the default, and then click Next.

Review the configuration options you have made, and then click Finish.  A progress meter will appear.

Once the disk has been created, VMware Workstation returns to the Summary View for the newly-created VM.

Be sure your CentOS installation disk has been inserted into the desk drive. 

Check to make sure that the CD/DVD drive has been configured to point to the ISO image on the CentOS installation disk.  To do this, first click Edit virtual machine settings, and then, on the Hardware tab, select CD/DVD (IDE).

On the right side, be sure that the Use physical drive option has been selected, and then select the appropriate drive from this option's list box.  Click OK.
TIP: it's best to insert the CentOS disk in the drive at the beginning of VM setup, and then step right into CentOS installation after setting up the VM.  The reason being that VMware Workstation will detect the installation disk in the drive during the VM setup process and subsequently step right into launching the installation after starting the VM.
Step 2: Launching the installation

Click Power on this virtual machine. VMware Workstation will automatically detect the CentOS installation disk in the drive and then launch the installation.  Incidentally, you'll also see the VMware Workstation prompt, at the bottom of the window.  Ignore this for the time being.

 A prompt appears on top of the CentOS installation screen.  Click OK.

Click anywhere on the CentOS screen, in order to pass the mouse pointer awareness into the virtual machine, and then press ENTER.  Be sure to do this quickly, as this option does not remain for long.  The installation preparation begins.

At some point during this preparation, you'll be prompted to perform a CD test.

Click anywhere on the blue part, press the Tab or right-arrow keys, and then press ENTER.  If you got this far, there's no need to test the CDROM any further.

The preparation will proceed for several minutes.  When this phase of the preparation is completed, a new screen will appear.

Click Next.

Select the language appropriate for you, or accept the default, and then click Next.

Select the keyboard layout appropriate for you, or accept the default, and then click Next.

Click Yes.  This launches Disk Druid, and you'll continue this procedure in the next section.

Step 3: Partitioning the Disk using CentOS Disk Druid

After the CentOS installation preparation routine finishes scanning the disk, it will launch Disk Druid.

Click on the bar that states Remove linux partitions on selected drives and create default layout.  A list of several more options here will be displayed. 
NOTE: check out references [5-7], below, for additional helpful detail on partitioning in Linux.

Select the list option Create custom layout, and then click Next.

Click the New button.  The first partition you'll create is the boot partition.

From the Mount Point drop-down list box, select /boot.  Make sure that the File System Type shown is ext3.  For the Size (MB), enter 100.  Leave all other options default.  Then click Next.

Click the New button again.  The next partition you'll create is the root partition.  This is where most of your applications will be installed to.

From the Mount Point drop-down list box, select "/".  Make sure that the File System Type shown is ext3.  For the Size (MB), enter 8500.  Leave all other options default. Then click OK.

Click the New button again.The next partition to create is the swap partition.  This is where CentOS keeps its swap file - similar to the Page file in Windows.  Search the Internet for guidance on how large this should be.  For the purposes of this procedure, you'll set this to 1500, which just about takes care of the remainder of the disk space available.

On the File System Type drop-down list box, select swap.  For the Size (MB), enter 1500.  Leave all other options default. Then click OK.  Lastly, the final drive to create is the /home drive, where user files are stored.  Repeat the above procedures to create this drive, and then click OK.

This completes disk partitioning using Disk Druid.  Click Next.

Step 3: Installing CentOS

The next few steps involve preparatory configuration prior to launching the actual installation of CentOS.

Accept the defaults, and then click Next.

If you have Dynamic Host Configuration Protocol configured on your network, ensure that the automatically via DHCP option is selected.  Otherwise, configure as necessary.  Then click Next.

Select the city nearest you, leave all other settings as their default, and then click Next.

Enter the root password, and then click Next. A progress meter will appear for a few moments.

Now you are at the last preparation step. 

Leave all settings at their default, and then click Next.

Click Next.  This launches the installation, which lasts several minutes.  During the installation, you'll be presented with several different screens.

After several minutes, the installation will be completed.  After installation is completed, you will be prompted to reboot.

Click Reboot.  Hang in there!  You're in the home stretch.

Click Forward.

If you want to interact with Windows systems over your network, check NSF4 and Samba.  If you intend to build web applications, check WWW and Secure WWW.  For the purposes of this procedure, I will check just WWW and Secure WWW.  This opens those ports through the firewall to allow these services to operate.  Click Forward.

At the prompt, click Yes.

Click on the SELinux Setting drop-down list box, and then select Permissive [10].  Otherwise, you won't be able to install or run some applications.  Then click Forward.

Check the Enable kdump option.  Leave the other options here default.  This will be useful later if you need to troubleshoot something later.  Then click Forward.  You'll be prompted to confirm the kdump option setting.  Click OK to proceed.

Make the appropriate time adjusts as needed, and then click Forward.

Enter a username, etc, and then click Forward.

Accept the defaults, and then click Forward.

Unless you have more software you want to install, just click Forward.

Congratulations!  If you've reached the login screen, you've successfully installed and configured CentOS Linux.  It remains to update your CentOS Linux instance with the latest upgrades and patches, and to install one tool that you will find useful later and that some applications require in order to be intsalled successfully.

Step 4: Updating CentOS

At the CentOS login screen, login using the root account.

At this point, I performed an install the VMware extras (that's what the prompt is for, down at the bottom of the screen).  As a result, the yellow prompt area at the bottom of the screen will disappear.

Open a terminal.  Enter the following command [12]:
# yum update
This will automatically determine what can be updated, compile a list of things needing update, download the updates from CentOS, and then install them.  It will take several minutes for the update to complete.  Accept the default at all prompts.

This completes updating of CentOS.  Continue on to the next step.

Step 5: Installing Sysstat

Before you finish up, there's one tool that it's useful to install before moving on to other things: sysstat [11].  You'll find that it is needed when installing other applications, such as Jive.  sysstat can be installed either through the CentOS Package Manager or from the command line. Both methods will be presented here.  First, from the command line.

At the prompt, enter the following command:
# yum list
This will cause a listing to be generated of all possible applications and tools that you can install.  Scroll through this list until you find an item beginning with sysstat. It will probably look something like: sysstat.i386.  Take note of its entire name, and then enter the following command:
# yum install sysstat.i386
Note that your sysstat entry may be somewhat different from what is shown here.  Once the installation begins, follow all prompts.

This completes insallation from the command prompt using YUM.  Next, using Package Manager. 

From the Gnome panel, Applications menu, select Add/Remove Software.  Then, on the Browse tab, in the left panel, select Base System, and then on the right panel, select System Tools

Click the Optional packages button, and then scroll down until you see the entry, sysstat-[version].i386, where your version may vary.  Select this entry, check it, and then click Close.

You'll be returned to the Package Manager tool.  The Apply button will be enabled.

On the Package Manager tool, click Apply.  You'll be prompted to confirm your selections.

Click Continue.  A progress meter will appear momentarily.

...and then you'll be informed of the outcome of the installation.

Click OK.  You're returned to the Package Manager tool.  Note that now the Apply button is no longer enabled.

That's it.  You're done with installing sysstat.

This completes the installation and configuration of CentOS!  Congratulations!  I bet you never thought you would complete this.  Happy Computing!

  1. CentOS
  2. VMware Workstation
  3. CentOS Documentation: Red Hat Enterprise Linux 5 Installation Guide
  4. Linux Clues: 2. Linux Installation
  5. CentOS Documentation: 4.15. Disk Partitioning Setup
  6. The Ultimate Guide to Hard Drive Partitioning
  7. Setting up a home directory
  8. CentOS Documentation: Chapter 19. Samba
  9. How to install Centos 5.3 On VMWare Workstation to prepare for IBM WebSphere Application Server version 7
  10. SELinux - CentOS How Tos - CentOS Wiki
  11. sysstat - About.Com
  12. Searching for Packages with yum, CentOS 5 Documentation
  • TIP: before searching the web for some new tool you want installed, be sure to perform a search using Package Manager's Search capability.  Your CentOS installation may already have it available and you just need to install it.
  • About CentOS

No comments: