LAB 01 - Introduction, overview and installation

From JaxHax
Jump to: navigation, search

The differences between CentOS and RHEL

The Red Hat corporation is one of the leading developers in the linux environment. They offer a community version of Linux (Fedora) and an enterprise version of Linux (RHEL). They release the sources for both Fedora and RHEL to the community free of charge, however if you want to download a version from them (or from associated mirrors), you are able to download Fedora, but not RHEL as it is a product that is sold.

RHEL or Red Hat Enterprise Linux is a version of linux that is built and maintained by the Red Hat corporation, it draws heavily from a community of open source developers that develop Fedora linux (the community version of RHEL, newer and faster development but less stable for servers) and from other linux projects.

CentOS (or Community ENTerprise Operating System) is a rebuild of the sources of RHEL. The object of CentOS is to be binary compatible with RHEL, and because they use the RHEL sources, and just strip out the RedHat name and logo from the product, they remain very close to the Red Hat offical product. The obvious drawback to using CentOS is that any patches or new rollouts of products will be delayed by days, weeks or months depending on the need or size of the deployment. Patches are usually very quick to change, but full version releases take a significant amount of time because the CentOS team needs to get the sources (after Red Hat releases them), compile them, and test them as well as building all new processes around them and new documentation.

Because CentOS strives to be binary compatible, and relies on the sources of RHEL, it is a very good learning tool, as well as a test environment tool. However if you want to get first rate support and put your machine in a production environment, it is highly suggested you purchase RHEL from the Red Hat corporation or one of their subsidiaries.

Where to get centos and the differences between all of the isos and mirrors

For our lab inside of JaxHax, we have a local mirror at http://linux.jaxhax.lan

If you are not inside JaxHax, there are a slew of mirrors for linux, my favorites being RIT (Rochester Institute of Technology) and GTLIB (Georgia Tech Library) both of which are very nice mirrors graciously hosted by said institutions. To obtain a listing of mirrors, go here

We will be using CentOS 6.4 in this class. The 6 is the major version and the 4 is the minor version. When RHEL/CentOS, from now on called CentOS for brevity, major version changes, they change the design of the operating system, change what packages come with the OS, process changes, and major functionality changes. When the CentOS minor version changes, it is due to patches to applications that are not 'game changers' like security patches, and small additions to functionality. Minor patches generally do not break application support, so when an application say supports CentOS 5, it supports 5.0 - 5.9, but if you move that application to 6.x, it may or may not work due to the differences in design and package version and availability.

Architecture: There are two different architectures supported by CentOS, x86 and x86_64 (also known as amd64 because AMD was the first to create the 64bit processor that could do 64 bit and 32 bit code processing while Intel was pushing for a 64 bit exclusive model called Itanium). x86 is a 32 bit operating system. Memory limit on this version is high vs other 32 bit operating systems (for instance Windows XP x86 is restricted to 4GB addressable memory) and is limited to 16GB, but a single process can only take about 3GB of memory. x64 or x86_64 is able to address 2TB or 64TB of memory depending on the kernel in use, of which a process can take 128TB (yes its higher) of virtual address space. More information about CentOS and its version limitations can be found here

The main distributions we will be concentrating on here are CentOS 6.4 x86_64 version, minimal install.

  • CentOS-6.4-x86_64-LiveCD.iso - this iso contains a live version of CentOS, just boot it and you will be running a non-permanent version of CentOS.
  • CentOS-6.4-x86_64-LiveDVD.iso - same as the LiveCD version, but with more packages.
  • CentOS-6.4-x86_64-bin-DVD1.iso - part 1 of the 'binary dvd' which is an installer that holds all the packages you could install for CentOS (you can install any version from this and the following DVD). This is useful if you are installing desktops or are in a place with no internet or local repository access.
  • CentOS-6.4-x86_64-bin-DVD2.iso - part 2 of the 'binary dvd', usually unnecessary, contains less-used packages
  • CentOS-6.4-x86_64-minimal.iso - this iso allows you to install the 'minimal' version of CentOS, or the base install. This is what we will be using for the class
  • CentOS-6.4-x86_64-netinstall.iso - this is a smaller iso that allows you to pull packages from the network, and cannot install the product on its own.

There are also other methods of install, including PXE, USB, Kickstart, as well as others, some of which will be covered in the lab.

Setting up a VirtualBox VM

VirtualBox is a product that was created by the innotek corporation, which then was bought by Sun Microsystems, which was then in turn bought by Oracle. The core product was GPLv2 opensourced in December 2010, however some connected products do not share that license. More information can be found on the wikipedia page

You can download VirtualBox for Linux, Windows, and OSX from their site at

For this lab, it is preferred that you use a computer that has virtualization support in the processor, at least 2GB of memory and is running a 64 bit operating system. That being said all of those things are optional, as well you can just install directly on the hardware you are using or use another virtualization product such as QEMU/KVM for linux or vmware. VirtualBox was chosen because it is free and available on all platforms and easy to obtain. Installation instructions and usage can be found on their site as cited above.

Installing CentOS minimal from a CD ISO

This process will be covered in the lab, it is fairly straight forward and may be expanded upon later in this wiki.

tecmint tutorial if you need one

Pointing YUM at a local mirror

Since we have a local mirror that is updated nightly at the space, we will want to use it because pulling the packages from it is much faster.

YUM or Yellowdog Update Manager, is a package management system that CentOS uses for installing, updating and removing packages from a system. This system is configured using configuration files.

On a normal, internet connected system that is not part of a large cluster of systems, or in a situation like this special case, you would not usually change the sources.

The files that control yum's repo lists are located under /etc/yum.repos.d/ and end in .repo

Below is a modified configuration to use the JaxHax mirror, note that mirrorlist has been commented out (the #) and baseurl has been commented in (removed the #)and has also been changed from the default to linux.jaxhax.lan

# CentOS-Base.repo
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
# If the #mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
name=CentOS-$releasever - Base
#released updates 
name=CentOS-$releasever - Updates
#additional packages that may be useful
name=CentOS-$releasever - Extras
#additional packages that extend functionality of existing packages
name=CentOS-$releasever - Plus
#contrib - packages by Centos Users
name=CentOS-$releasever - Contrib

very basic VI and NANO usage along with a few basic commands


vi file ## opens a file with the vi editor
I,i,A,a ## turns on insert mode
<esc> ## moves from insert mode to command mode
:wq ## while in command mode, writes to the file, then quits the editor
:q! ## while in command mode, quits without writing to the file


nano file ## open a file with the nano editor
<ctrl>+Letter ## the control characters are at the bottom of the screen when using nano, <ctrl>x exits

some basic commands:

cd directory_name ## change directory to new directory, used without directory takes you to the current user's home
id ## shows what user you are currently logged in as
ls -lh ## gives directory listing, the -l is long listing (gives you more information), 
          the -h is human readable changing the format of the size to be easier to read by humans
ps aux ##  a lists all processes with a terminal, x lists all processes without a terminal, u associates them with a username
pwd ## present working directory
who ## shows who is currently on the system
rm ## removes a file
rmdir ## removes an empty directory
touch file ## makes a blank file
mkdir directory ## makes a empty directory

Updating the machine using YUM

yum update (thats pretty much it)

Installing a desktop environment and other tools using YUM

yum -y groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"

Breakdown of the above command: yum ## command that installs/updates/removes packages from the system -y ## says yes to questions, useful if you know what yum is doing groupinstall ## special modifier like install, update, groupinfo, ect, tells yum you want to install a group of packages "Desktop" ## A minimal desktop that can also be used as a thin client. "Desktop Platform" ## Supported libraries for the CentOS Linux Desktop Platform. "X Window System" ## X Window System Support. (this is the gui backend server) "Fonts" ## Fonts for rendering text in a variety of languages and scripts.

Logging into the machine using the new desktop environment.

Since you have now installed a desktop system. You can log in via one of two ways.

1: Manually log into the system on the command line as your user, run startx

2: change /etc/inittab in the following way and reboot: