Sunday, March 18, 2012

Step by Step Installing Oracle Database 10g Release 2 on Linux (CentOS)

Step by Step Installing Oracle Database 10g Release 2 on Linux (CentOS) and AUTOMATE the installation using Linux Shell Script

In order to use Oracle Database, first of all we need to setup Oracle Software. Installation of Oracle Database on Windows is very easy. By running setup.exe from installation CD of Oracle for Windows, we can invoke a setup and by clicking NEXT buttons we can install Oracle Software and Database without any problem. We don’t need any prerequisite actions before installation. But in Linux it’s different. If we want to install Oracle Database on Linux OS, we should follow some prerequisite actions.

Today, we’re going to install Oracle Database on CentOS. To do it, we use last version of CentOS (the latest release for now) – “CentOS-5.2” and mostly used release of Oracle Database – “Oracle Database 10g Release 2”. And we’re going to practice this whole project on VMware 6.0.0

Before starting, we need to install VMware. Then, we need to install CentOS on VMware. After that, we are going to install Oracle Database. You should refer to my previous posts in order to install VMware and Centos

Step by step installing VMware

Step by Step Installing CentOS on VMware

But there’s one thing we should keep in mind. During installation of CentOS, on the “package lists” page, we should behave differently. It will be discussed in the next paragraphs.

This project covers following steps:

Checking minimum hardware requirements
Installing rpm packages which are required for Oracle installation
Configuring kernel parameters
Creating groups and user for Oracle Installation
Installing Oracle Software
Creating an Oracle Database
Connecting to Database with Enterprise Manager
AUTOMATING all processes and steps of installation Oracle 10g R2 on Centos using Shell Script

As you see from the list above, in order to setup Oracle Database, we need to change some parameters in the system. Changing these parameters each time could lead to mistakes and waste of time. The main purpose of our article is to automate all these processes and save your time. For this purpose we’re going to use “Shell Script”

Now I’m going to explain above mentioned steps one by one

1. Checking minimum hardware requirements

At least, your system should meet the following requirements:

- 1GB RAM

- Requirement for swap space in Oracle installation is as follows:

Available RAM Swap Space Required

Between 1 GB and 2 GB 1.5 times the size of RAM

Between 2 GB and 8 GB Equal to the size of RAM

More than 8 GB .75 times the size of RAM

- 400MB free space in /tmp directory

- Depending on type of the installation, 1.5-3.5 GB free space for Oracle Software

- 1.5GB free space if new Oracle Database is created

Getting familiar with requirements mentioned above, we need to get hardware information of our system. To check the size of RAM, Swap space and tmp directory, we run these commands:

- To check the size of physical memory, execute grep MemTotal /proc/meminfo

- To check the size of swap space, execute grep SwapTotal /proc/meminfo

- To check the space in /tmp directory, execute df –h /tmp

2. Installing rpm packages which are required for Oracle installation

While installing CentOS, we have to install some rpm packages. During the installation, on the installation window you get list of packages. Here, we select “Customize” choice

oracle_install1

On “Customized” window, we check required packages and uncheck packages that are not required for Oracle Installation

oracle_install2

In the packages list, check following packages. Uncheck all packages that are not in the list below

Desktop Environments

GNOME Desktop Environment

Applications

Graphical Internet

Development

Development Libraries

Development Tools

GNOME Software Development

Java Development

Legacy Software Development

X Software Development

Servers

Server Configuration Tools

Web Server

Windows File Server

Base System

Administration Tools

Base

Java

Legacy Software Support

System Tools

X Window System

Furthermore, after installation of CentOS, we have manually to install these four rpm packages. Surely, you can select them (except libaio-devel package) from the package list during setup, for many people who don’t want to find these packages in the package list, installing it manually after system installation is the best option. These are packages which should be installed before Oracle installation

- compat-db-4.2.52-5.1.i386.rpm

- sysstat-7.0.2-1.el5.i386.rpm

- libaio-devel-0.3.106-3.2.i386.rpm

- libXp-1.0.0-8.1.el5.i386.rpm

In order to install these packages, you can use rpm –Uvh command by changing directory to CentOS directory inside the CD (DVD) of CentOS installation as shown below




3. Changes to be made to Kernel parameters

After installing above mentioned packages, we need to change some Kernel parameters and make them match to Oracle requirements. Parameters which should be changed are shown below
shmmax 2147483648
shmmni 4096
shmall 2097152
shmmin 1
semmsl 250
semmns 32000
semopm 100
semmni 128
file-max 65536
ip_local_port_range 1024 65000
rmem_default 1048576
rmem_max 1048576
wmem_default 262144
wmem_max 262144



We do all these changes in the /etc/sysctl.conf file by adding these lines to that file:

kernel.shmmax = 2147483648

kernel.shmall = 2097152

kernel.shmmni=4096

kernel.sem=250 32000 100 128

fs.file-max=65536

net.ipv4.ip_local_port_range=1024 65000

net.core.rmem_default=1048576

net.core.rmem_max=1048576

net.core.wmem_default=262144

net.core.wmem_max=262144

After appending those lines we save that file and run the following command to make these changes effective immediately in the running system

/sbin/sysctl –p



Setting Shell limits for the Oracle UserTo improve the performance of the software on Linux systems, you must increase the following shell limits for the oracle user:

1. Add the following lines to /etc/security/limits.conf file

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

2. Add the following lines to /etc/pam.d/login file

session required /lib/security/pam_limits.so

session required pam_limits.so

3. In order to use Oracle Software, we need to make a change in “oracle” user’s buffer size and number of opened file descriptors. In order to do it, we add below lines to /etc/profile file

if [ $USER = "oracle" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi

4. Changing redhat-release file

One of the first checks performed by the Oracle Universal Installer (OUI) is to determine if the host platform is supported. The OUI uses the file /etc/redhat-release to determine the platform. For the case of Red Hat Enterprise Linux, Oracle Database 10g Release 2 expects either RHEL 3 or RHEL/OEL 4.

The easiest way to get around this error is to modify the /etc/redhat-release file replacing the current release information (CentOS release 5 (Final)) with the following:

redhat-4

Before modifying /etc/redhat-release, make a backup copy of the file and ensure to replace the original one after the Oracle installation and patch process has been completed.

cp /etc/redhat-release /etc/redhat-release.original

echo “redhat-4″ > /etc/redhat-release

After all these configurations, you should get this result:



4. Create groups and user for Oracle Installation

In this step, we create “oinstall” and “dba” groups and “oracle” user to install Oracle Software, and create new Database

groupadd oinstall

groupadd dba

useradd -m -g oinstall -G dba -d /home/oracle -s /bin/bash -c “Oracle Software Owner” oracle

passwd oracle

oracle_install6

5. Installing Oracle Database 10g Release 2

First of all, we need to download Oracle Database 10g R2. To download it, use this link:

http://download.oracle.com/otn/linux/oracle10g/10201/10201_database_linux32.zip

After download finish, we need to copy this file to the Virtual Machine. To copy it, we have two choices:

Copy it using USB Flash Drive
Copy it using Samba service
Create an image file (.iso) from zipped installation and mount it to Virtual Machine

Here, we’re going to copy the zipped file using second technique. With any ISO creator program, create .iso file from zipped installation file of Oracle Database. And then mount it to the Virtual Machine as shown below:

oracle_install7

Now switch to the desktop of CentOS, right click on DVD of CentOS installation on the desktop and click “Eject” as shown below:

oracle_install8

Now enter to “Computer” and double click on “CD-ROM” icon.

oracle_install9

Installation file of Oracle Database will be opened:

oracle_install10

Now, create install folder on the /tmp directory, change owner of this folder to “oracle”, copy this file into /tmp/install directory

Then unzip this file and begin installation as follows:

oracle_install11

After unzip completes, installation will begin automatically

oracle_install12

Oracle Database 10g Installation

oracle_install13

If you want to create new database after software installation, check “Create Starter Database” checkbox and enter database name and password, then click Next

oracle_install14

Specify Inventory directory (keep it as default) and click Next

oracle_install15

Here we see that all Prerequisite Checks succeeded.

oracle_install16

Click Install to begin installation

oracle_install17

Now, we’re installing Oracle 10g Software.

6. Creating an Oracle Database

As we’ve checked “Create Starter Database” at the first page of the installation, new database will be created automatically after software installation

oracle_install18

After database created, you’ll get information about your database, Enterprise Manager and Spfile

oracle_install19

Click Ok. In the below window, you’ll get location for two scripts which you should run as a root user to complete last configurations. Open new Terminal window and run those two scripts:

oracle_install20

Installation of Oracle Database 10g completed successfully! Congratulations!

Now reboot your server and login as oracle user and start newly created database.

oracle_install21

If we want to login to our database, we run sqlplus. But before it, we need to set Environment Variables. We can do it automatically by adding them to .bashrc file in the /home/oracle directory as below:

export ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

export PATH=$ORACLE_HOME/bin:$PATH

alias database =’export ORACLE_SID=kamran;sqlplus “/ as sysdba”‘

oracle_install22

Now, let’s open new terminal and try again

oracle_install23

As you see, after setting Environment Variables to their correct values, I was able to login to SQL*Plus using two ways.

7. Connecting to Database with Enterprise Manager

Now, let’s start Oracle Enterprise Manager. In order to use EM, we should firstly start listener. In production environment, you need automate database, listener and EM startup. To automate them, please refer to one of my previous blogs – “Automatically StartUp and Shutdown an Oracle Database in Linux OS”

Start the listener

oracle_install24

Then, start Enterprise Manager

oracle_install25

Now, we can login to EM page to administer our database using above given address:

http://localhost.localdomain:1158/em/

oracle_install26

Enter user sys and its password, then select “SYSDBA” as a role and click Login

oracle_install27

Using Enterprise Manager, you can administer your database in very easy steps

That’s all!! Our Database and EM is ready for use! Congratulations!!!

By following above mentioned steps we were able to install Oracle 10g R2 on CentOS 5. But if we carry out frequent tests and as a result of these tests each time we are to install Oracle Database, then we need to automate installation of Oracle Database. I would suggest two options to overcome this problem:

To install CentOS+Oracle on VMware and copy image of VMware to elsewhere, then each time use this image to get fresh copy of Oracle Database
To automate installation of Oracle Database by using Shell Script

Let’s explain each option in details:

Firstly, I usually create new Virtual Machine with 10GB size. Then, I install CentOS on it and create an Oracle Database with all its configurations. Then I shut down Virtual Machine and copy all the folders to another directory. Usually, I create two copies of the Virtual Machine. Then I do all my tests on the first Virtual Machine. When it becomes useless, I shut down and delete it as a whole folder, open second Virtual Machine which I’ve copied and continue my tests.
Second way is the best method of approach to the problem. For this, I create a shell script and write all steps and do all configuration changes from this script. By running this script once, all configurations needed for Oracle Installation will be changed automatically and we will only be asked for new oracle user’s password and next we’ll see installation page open.



Automating installation of Oracle Database 10g Release 2 on Centos 5 using Shell Script

To automate this job, we wrote a Shell Script. Before running this script, we should follow some steps as shown below:

1. Firstly you should know that before running this script we should create install directory in /tmp directory and copy zipped installation file of Oracle to this directory with this installation script

2. Before running this script we must be sure that installation DVD of CentOS has been inserted or installation DVD image of CentOS mounted to the system. You can check it by running this code:

oracle_install28

3. After installation completes, change the following Environment Variables and alias name into proper names which you’ve used during installation in the .bashrc file

ORACLE_HOME – If it is different folder, change it to correct value
ORACLE_SID – If it is different SID, change it to correct SID
As an alias, you can assign whatever you want

If everything is OK as mentioned above, we change directory to /tmp/install folder and run install.sh file. By running this shell script, all configurations needed for installation will be automatically changed and only thing asked will be oracle user’s password. After that we’ll see Oracle Database installation page. By clicking Next buttons we’ll be able to install Oracle Software and Database very easily

Now, let’s install Oracle Database 10g using this Shell Script

First of all, we need to create install folder in the /tmp directory and copy zipped installation file of Oracle Database 10g to /tmp/install directory with install.sh script and check their existence. After that we need to mount Centos DVD once more, because we’re going to install some packages that were not installed with CentOS. After getting below screen, you can start installation

oracle_install29

Here we see that

We have zipped installation file of Oracle Database 10g in the /tmp/install directory
We mounted CentOS DVD

Now, switch to /tmp/install folder and run install.sh script

oracle_install30

oracle_install31

oracle_install32

Here, enter oracle user’s password. Then click ok. After this step, zipped file will be unzipped

oracle_install33

After it finishes unzipping, we’ll get Installation Window

oracle_install34

That’s all! After getting this page, you should follow above mentioned installation steps in which we installed Oracle Database manually.

Using automatic install script we’ve avoided of all configuration settings and got Oracle 10gR2 installer page opened successfully

The automatic installation script for Oracle Database on Linux is as follows:



#########———— Installing Rpm files —–########



#Change directory to /tmp/install

cd /tmp/install

#Install all packages that are not installed during OS installation and that are required packages for Oracle Database 10gR2

echo “Installing rpm packages …”



rpm -Uvh “$(find /media/ -name compat-db*)”

rpm -Uvh “$(find /media/ -name sysstat*)”

rpm -Uvh “$(find /media/ -name libaio-devel*)”

rpm -Uvh “$(find /media/ -name libXp-1*)”



echo “Rpm packages installed





#Add lines to limits.conf file

echo “Changing limits.conf file”

cat >> /etc/security/limits.conf <
oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

EOF

echo “limits.conf file changed successfully





#Add lines to profile to give maximum limit for Oracle user

echo “Changing /etc/profile file ….”

cat >> /etc/profile <
if [ \$USER = "oracle" ]; then

if [ \$SHELL = "bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022

fi

EOF

echo “/etc/profile file changed successfully





#Add line to /etc/pam.d/login file

echo “Changing /etc/pam.d/login file …”

cat >> /etc/pam.d/login <
session required /lib/security/pam_limits.so

EOF

echo “/etc/pam.d/login file changed successfuly





#Add some kernel parameters to /etc/sysctl.conf file

echo “Changing kernel parameters … “



cat >> /etc/sysctl.conf <
kernel.shmmax = 2147483648

kernel.shmall = 2097152

kernel.shmmni=4096

kernel.sem=250 32000 100 128

fs.file-max=65536

net.ipv4.ip_local_port_range=1024 65000

net.core.rmem_default=1048576

net.core.rmem_max=1048576

net.core.wmem_default=262144

net.core.wmem_max=262144

EOF



echo “Kernel parameters changed successfully



#Save all new kernel parameters



/sbin/sysctl -p



#Add “redhat-4″ line to /etc/redhat-release file



echo “Changing /etc/redhat-release file …”

cp /etc/redhat-release /etc/redhat-release.original

echo “redhat-4″ > /etc/redhat-release

echo “/etc/redhat-release file changed successfully





#Create new groups and “oracle” user and add this user to group

echo “Creating new groups and ‘oracle’ user …”

groupadd oinstall

groupadd dba

useradd -m -g oinstall -G dba -d /home/oracle -s /bin/bash -c “Oracle Software Owner” oracle

passwd oracle

echo “Groups and user created successfully



#Adding Environment Variables

#Adding Environment Variables

cat >> /home/oracle/.bashrc <
export ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

export PATH=$ORACLE_HOME/bin:$PATH

alias mydb=’export ORACLE_SID=mydb;sqlplus “/ as sysdba”‘

export ORACLE_SID=mydb

EOF

EOF





#Unzip setup of Oracle

echo “Unzipping setup of Oracle 10g Release 2…. “

unzip 10201_database_linux32.zip

echo “Setup file successfully unzipped



#Enter to installation directory and run the installation …

echo “Installation begins …”

cd /tmp/install/database

chmod 755 runInstaller

chmod 755 install/.oui

chmod 755 install/unzip

xhost +

sudo -u oracle /tmp/install/database/runInstaller

Monday, February 20, 2012

Steps to install Nagios Monitoring Tool in RHEL|Centos|Fedora.


I First step  :
Let   me  show  you  how to install   nagios monitoring tool .
This  installation has been  tested  by  unixmen team  in  Fedora/Cenots/RHEL/ . 
1- First   install some  tools : httpd, gcc, glib, glibc-common, gd and gd-devel
 yum install httpd php
yum install gcc
yum install glibc glibc-common
yum install gd gd-devel

2- Create  nagios  user :
#/usr/sbin/useradd -m nagios
#passwd nagios
3- Add  nagcmd  group
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd apache
4- Now go   to http://www.nagios.org   download  files  .
nagios-3.1.0.tar.gz  nagios-plugins-1.4.13.tar.gz  nrpe-2.12.tar.gz


These commands will download version 3.2.0 of the Core Nagios files and version 1.4.13 of the Nagios plugins.
From command line:
-> wget http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios-3.2.0/nagios-3.2.0.tar.gz?use_mirror=softlayer
-> wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.13/nagios-plugins-1.4.13.tar.gz?use_mirror=softlayer

> tar -xzvf nagios-3.0.6.tar.gz
-> cd nagios-3.0.6
-> ./configure --with-command-group=nagcmd
-> make all
-> make install
-> make install-init
-> make install-config
-> make install-commandmode
    make install-webconf

5-  Edit  your  email  admin address :
Go to
vi /usr/local/nagios/etc/objects/contacts.cfg

6- Create a nagiosadminaccount for logging into the Nagios web interfaceassign to this youll need it later.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
enter   the  password.
7- Restart  the  httpd  server :
#Service  httpd   restart
The  second  step  : Extract   and  install  plugins
1- Go  to you  downloaded  nagios  tools
 tar  -zxvf   nagios-plugins-1.4.13.tar.gz
2- cd  nagios-plugins
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make; make   install
3- Now  you  have  to  add nagios  to  Chkconfig 
chkconfig --add nagios
chkconfig nagios on
4- Verify  if  you  have  a  good config of nagios with the command
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
5- Check if  there  are  no errors  displayed;  then start   nagios with command : 
service  nagios  start

To  simplify  the   procesure  please  disable  the selinux  and  iptables  and  ip6tables
now  open   your  browser   and http://localhost/nagios orr http://ip/nagios
 
http://www.unixmen.com/images/stories/screenshot004.gif
http://www.unixmen.com/images/stories/screenshot005.gif

N.B : Please   if  you  have  questions  about   debian or ubuntu or othe  unix system    . we  are    here  to help.
if  ou  have  more  questions  abouth  commands   nrpe ? , how  to add  new  client  to the  server   ?Feel free to ask Me.

**********************************************************************

I. Overview

II. 6 steps to install Nagios plugin and NRPE on remote host.

Download Nagios Plugins and NRPE Add-on
Create nagios account
Install Nagios Plugins
Install NRPE
Setup NRPE to run as daemon
Modify the /usr/local/nagios/etc/nrpe.cfg

III. 4 Configuration steps on the Nagios monitoring server to monitor remote host:

Download NRPE Add-on
Install check_nrpe
Create host and service definition for remote host
Restart the nagios service

I. Overview:
Following three steps will happen on a very high level when Nagios (installed on the nagios-servers) monitors a service (for e.g. disk space usage) on the remote Linux host.


Nagios will execute check_nrpe command on nagios-server and request it to monitor disk usage on remote host using check_disk command.
The check_nrpe on the nagios-server will contact the NRPE daemon on remote host and request it to execute the check_disk on remote host.
The results of the check_disk command will be returned back by NRPE daemon to the check_nrpe on nagios-server.


Following flow summarizes the above explanation:

Nagios Server (check_nrpe) —–> Remote host (NRPE deamon) —–> check_disk

Nagios Server (check_nrpe) <—– Remote host (NRPE deamon) <—– check_disk (returns disk space usage)

II. 7 steps to install Nagios Plugins and NRPE on the remote host

.
1. Download Nagios Plugins and NRPE Add-on

Download following files from Nagios.org and move to /home/downloads:

nagios-plugins-1.4.11.tar.gz
nrpe-2.12.tar.gz

2. Create nagios account

[remotehost]# useradd nagios
[remotehost]# passwd nagios

3. Install nagios-plugin

[remotehost]# cd /home/downloads
[remotehost]# tar xvfz nagios-plugins-1.4.11.tar.gz
[remotehost]# cd nagios-plugins-1.4.11
[remotehost]# export LDFLAGS=-ldl

[remotehost]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --enable-redhat-pthread-workaround
[remotehost]# make
[remotehost]# make install

[remotehost]# chown nagios.nagios /usr/local/nagios
[remotehost]# chown -R nagios.nagios /usr/local/nagios/libexec/


Note: On Red Hat, For me the ./configure command was hanging with the the message: “checking for redhat spopen problem…”. Add --enable-redhat-pthread-workaround to the ./configure command as a work-around for the above problem.
4. Install NRPE

[remotehost]# cd /home/downloads
[remotehost]# tar xvfz nrpe-2.12.tar.gz
[remotehost]# cd nrpe-2.12

[remotehost]# ./configure
[remotehost]# make all
[remotehost]# make install-plugin
[remotehost]# make install-daemon
[remotehost]# make install-daemon-config
[remotehost]# make install-xinetd

5. Setup NRPE to run as daemon (i.e as part of xinetd):

Modify the /etc/xinetd.d/nrpe to add the ip-address of the Nagios monitoring server to the only_from directive. Note that there is a space after the 127.0.0.1 and the nagios monitoring server ip-address (in this example, nagios monitoring server ip-address is: 192.168.1.2)

only_from = 127.0.0.1 192.168.1.2

Modify the /etc/services and add the following at the end of the file.

nrpe 5666/tcp # NRPE

Start the service

[remotehost]#service xinetd restart

Verify whether NRPE is listening

[remotehost]# netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN

Verify to make sure the NRPE is functioning properly

[remotehost]# /usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.12

6. Modify the /usr/local/nagios/etc/nrpe.cfg

The nrpe.cfg file located on the remote host contains the commands that are needed to check the services on the remote host. By default the nrpe.cfg comes with few standard check commands as samples. check_users and check_load are shown below as an example.

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20


In all the check commands, the “-w” stands for “Warning” and “-c” stands for “Critical”. for e.g. in the check_disk command below, if the available disk space gets to 20% of less, nagios will send warning message. If it gets to 10% or less, nagios will send critical message. Change the value of “-c” and “-w” parameter below depending on your environment.

command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1


Note: You can execute any of the commands shown in the nrpe.cfg on the command line on remote host and see the results for yourself. For e.g. When I executed the check_disk command on the command line, it displayed the following:

[remotehost]#/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
DISK CRITICAL - free space: / 6420 MB (10% inode=98%);| /=55032MB;51792;58266;0;64741


In the above example, since the free disk space on /dev/hda1 is only 10% , it is displaying the CRITICAL message, which will be returned to nagios server.
III. 4 Configuration steps on the Nagios monitoring server to monitor remote host:

.
1. Download NRPE Add-on

Download nrpe-2.12.tar.gz from Nagios.org and move to /home/downloads:
2. Install check_nrpe on the nagios monitoring server

[nagios-server]# tar xvfz nrpe-2.12.tar.gz
[nagios-server]# cd nrpe-2.1.2
[nagios-server]# ./configure
[nagios-server]# make all
[nagios-server]# make install-plugin

./configure will give a configuration summary as shown below:

*** Configuration summary for nrpe 2.12 05-31-2008 ***:

General Options:
————————-
NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios



Note: I got the “checking for SSL headers… configure: error: Cannot find ssl headers” error message while performing ./configure. Install openssl-devel as shown below and run the ./configure again to fix the problem.

[nagios-server]# rpm -ivh openssl-devel-0.9.7a-43.16.i386.rpm krb5-devel-1.3.4-47.i386.rpm zlib-devel-1.2.1.2-1.2.i386.rpm e2fsprogs-devel-1.35-12.5.
el4.i386.rpm
warning: openssl-devel-0.9.7a-43.16.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing… ########################################### [100%]
1:e2fsprogs-devel ########################################### [ 25%]
2:krb5-devel ########################################### [ 50%]
3:zlib-devel ########################################### [ 75%]
4:openssl-devel ########################################### [100%]

Verify whether nagios monitoring server can talk to the remotehost.

[nagios-server]#/usr/local/nagios/libexec/check_nrpe -H 192.168.1.3
NRPE v2.12


Note: 192.168.1.3 in the ip-address of the remotehost where the NRPE and nagios plugin was installed as explained in Section II above.
3. Create host and service definition for remotehost

Create a new configuration file /usr/local/nagios/etc/objects/remotehost.cfg to define the host and service definition for this particular remotehost. It is good to take the localhost.cfg and copy it as remotehost.cfg and start modifying it according to your needs.


host definition sample:

define host{
use linux-server
host_name remotehost
alias Remote Host
address 192.168.1.3
contact_groups admins
}


Service definition sample:

define service{
use generic-service
service_description Root Partition
contact_groups admins
check_command check_nrpe!check_disk
}

Note: In all the above examples, replace remotehost with the corresponding hostname of your remotehost.
4. Restart the nagios service

Restart the nagios as shown below and login to the nagios web (http://nagios-server/nagios/) to verify the status of the remotehost linux sever that was added to nagios for monitoring.

[nagios-server]# service nagios reload

*********************************************************************************

I First step :

Let me show you how to install nagios monitoring tool .

This installation has been tested by unixmen team in Fedora/Cenots/RHEL/ .

1- First install some tools : httpd, gcc, glib, glibc-common, gd and gd-devel

yum install httpd php

yum install gcc*

yum install glibc* glibc-common*

yum install gd gd-devel



2- Create nagios user :

#/usr/sbin/useradd -m nagios

#passwd nagios

3- Add nagcmd group

/usr/sbin/groupadd nagcmd

/usr/sbin/usermod -a -G nagcmd nagios

/usr/sbin/usermod -a -G nagcmd apache

4- Now go to http://www.nagios.org download files .

nagios-3.1.0.tar.gz nagios-plugins-1.4.13.tar.gz nrpe-2.12.tar.gz

tar -zxvf nagios-3.1.0.tar.gz

cd nagios-3.1.0

./configure --with-command-group=nagcmd

#make all; make install; make install-init; make install-config; make install-commandmode; make install-webconf

5- Edit your email admin address :

Go to

vi /usr/local/nagios/etc/objects/contacts.cfg



6- Create a nagiosadmin account for logging into the Nagios web interfaceassign to this you’ll need it later.

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

enter the password.

7- Restart the httpd server :

#Service httpd restart

The second step : Extract and install plugins

1- Go to you downloaded nagios tools

tar -zxvf nagios-plugins-1.4.13.tar.gz

2- cd nagios-plugins

./configure --with-nagios-user=nagios --with-nagios-group=nagios

make; make install

3- Now you have to add nagios to Chkconfig

chkconfig --add nagios

chkconfig nagios on

4- Verify if you have a good config of nagios with the command

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

5- Check if there are no errors displayed; then start nagios with command :

service nagios start

To simplify the procesure please disable the selinux and iptables and ip6tables

now open your browser and http://localhost/nagios orr http://ip/nagios

-----------------------------------------------------------------------------------------------

NSCLIENT++

[modules]
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
NRPEListener.dll
SysTray.dll
CheckEventLog.dll
CheckHelpers.dll
;CheckWMI.dll
CheckNSCP.dll
;
CheckExternalScripts.dll
;
NSCAAgent.dll
;
LUAScript.dll
;
;RemoteConfiguration.dll
;NRPEClient.dll
CheckTaskSched.dll

[crash]
; Archive crash dump files if a crash is detected
;archive=1

; Submit crash reports to a crash report server (this overrrides archive)
;submit=0

; Restart service if a crash is detected
restart=1

[Settings]
;obfuscated_password=Jw
;
;# PASSWORD
;password=secret-password
;
;# ALLOWED HOST ADDRESSES
;allowed_hosts=127.0.0.1/32
;
;# USE THIS FILE
use_file=1
allowed_hosts=77.170.218.63
;
; # USE SHARED MEMORY CHANNELS
shared_session=1

[log]
;# LOG DEBUG
debug=1
;
;# LOG FILE
file=nsclient.log
;
;# LOG DATE MASK
date_mask=%Y-%m-%d %H:%M:%S
;
;# LOG ROOT FOLDER
root_folder=exe

[NSClient]
;# ALLOWED HOST ADDRESSES
;allowed_hosts=
;
;# NSCLIENT PORT NUMBER
port=12489
;
;# BIND TO ADDRESS
;bind_to_address=
;
;# SOCKET TIMEOUT
;socket_timeout=30

[NRPE]
;# NRPE PORT NUMBER
;port=5666
;
;# COMMAND TIMEOUT
;command_timeout=60
;
;# COMMAND ARGUMENT PROCESSING
;allow_arguments=0
;
;# COMMAND ALLOW NASTY META CHARS
;allow_nasty_meta_chars=0
;
;# USE SSL SOCKET
;use_ssl=1
;
;# BIND TO ADDRESS
; bind_to_address=
;
;# ALLOWED HOST ADDRESSES
;allowed_hosts=
;
;# SCRIPT DIRECTORY
;script_dir=scripts\
;
;# SOCKET TIMEOUT
;socket_timeout=30

[Check System]
;# CPU BUFFER SIZE
;CPUBufferSize=1h
;
;# CHECK RESOLUTION
;CheckResolution=10
;
;# CHECK ALL SERVICES
; Configure how to check services when a CheckAll is performed.
; ...=started means services in that class *has* to be running.
; ...=stopped means services in that class has to be stopped.
; ...=ignored means services in this class will be ignored.
;check_all_services[SERVICE_BOOT_START]=ignored
;check_all_services[SERVICE_SYSTEM_START]=ignored
;check_all_services[SERVICE_AUTO_START]=started
;check_all_services[SERVICE_DEMAND_START]=ignored
;check_all_services[SERVICE_DISABLED]=stopped

[External Script]
;# COMMAND TIMEOUT
;command_timeout=60
;
;# COMMAND ARGUMENT PROCESSING
;allow_arguments=0
;
;# COMMAND ALLOW NASTY META CHARS
;allow_nasty_meta_chars=0
;
;# SCRIPT DIRECTORY
;script_dir=c:\my\script\dir

[Script Wrappings]
vbs=cscript.exe //T:30 //NoLogo scripts\lib\wrapper.vbs %SCRIPT% %ARGS%
ps1=cmd /c echo scripts\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
bat=scripts\%SCRIPT% %ARGS%

[External Scripts]
;check_es_long=scripts\long.bat
;check_es_ok=scripts\ok.bat
;check_es_nok=scripts\nok.bat
;check_vbs_sample=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs
;check_powershell_warn=cmd /c echo scripts\powershell.ps1 | powershell.exe -command -

[External Alias]
alias_cpu=checkCPU warn=80 crit=90 time=5m time=1m time=30s
alias_cpu_ex=checkCPU warn=$ARG1$ crit=$ARG2$ time=5m time=1m time=30s
alias_mem=checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged type=page
alias_up=checkUpTime MinWarn=1d MinWarn=1h

alias_disk=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED
alias_disk_loose=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED ignore-unreadable
alias_volumes=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll=volumes FilterType=FIXED
alias_volumes_loose=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll=volumes FilterType=FIXED ignore-unreadable

alias_service=checkServiceState CheckAll
alias_service_ex=checkServiceState CheckAll "exclude=Net Driver HPZ12" "exclude=Pml Driver HPZ12" exclude=stisvc
alias_process=checkProcState "$ARG1$=started"
alias_process_stopped=checkProcState "$ARG1$=stopped"
alias_process_count=checkProcState MaxWarnCount=$ARG2$ MaxCritCount=$ARG3$ "$ARG1$=started"
alias_process_hung=checkProcState MaxWarnCount=1 MaxCritCount=1 "$ARG1$=hung"

alias_event_log=CheckEventLog file=application file=system MaxWarn=1 MaxCrit=1 "filter=generated gt -2d AND severity NOT IN ('success', 'informational') AND source != 'SideBySide'" truncate=800 unique descriptions "syntax=%severity%: %source%: %message% (%count%)"

alias_file_size=CheckFiles "filter=size > $ARG2$" "path=$ARG1$" MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" max-dir-depth=10
alias_file_age=checkFile2 filter=out "file=$ARG1$" filter-written=>1d MaxWarn=1 MaxCrit=1 "syntax=%filename% %write%"

alias_sched_all=CheckTaskSched "filter=exit_code ne 0" "syntax=%title%: %exit_code%" warn=>0
alias_sched_long=CheckTaskSched "filter=status = 'running' AND most_recent_run_time < -$ARG1$" "syntax=%title% (%most_recent_run_time%)" warn=>0
alias_sched_task=CheckTaskSched "filter=title eq '$ARG1$' AND exit_code ne 0" "syntax=%title% (%most_recent_run_time%)" warn=>0

alias_updates=check_updates -warning 0 -critical 0

check_ok=CheckOK Everything is fine!

[Wrapped Scripts]
;check_test_vbs=check_test.vbs /arg1:1 /arg2:1 /variable:1
;check_test_ps1=check_test.ps1 arg1 arg2
;check_test_bat=check_test.bat arg1 arg2
;check_battery=check_battery.vbs
;check_printer=check_printer.vbs
;check_updates=check_updates.vbs

; [includes]
;
; myotherfile.ini
; real.ini

[NSCA Agent]
;# CHECK INTERVALL (in seconds)
;interval=5
;
;# ENCRYPTION METHOD
;
; Note: The encryption method you specify here must match the decryption method the nsca daemon uses
; (as specified in the nsca.cfg file)!!
; Values:
; 0 = None (Do NOT use this option)
; 1 = Simple XOR (No security, just obfuscation, but very fast)
; 2 = DES
; 3 = 3DES (Triple DES)
; 4 = CAST-128
; 6 = xTEA
; 8 = BLOWFISH
; 9 = TWOFISH
; 11 = RC2
; 14 = RIJNDAEL-128 (AES)
; 20 = SERPENT
;encryption_method=14
;
;# ENCRYPTION PASSWORD
;password=
;
;# BIND TO ADDRESS
; -- not supported as of now --
;bind_to_address=
;
;# LOCAL HOST NAME
;hostname=
;
;# NAGIOS SERVER ADDRESS
;nsca_host=192.168.0.1
;
;# NAGIOS SERVER PORT
;nsca_port=5667
;
;# CHECK COMMAND LIST
;
[NSCA Commands]
;my_cpu_check=checkCPU warn=80 crit=90 time=20m time=10s time=4
;my_mem_check=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=page
;my_svc_check=checkServiceState CheckAll exclude=wampmysqld exclude=MpfService
;host_check=check_ok

;# REMOTE NRPE PROXY COMMANDS
; A list of commands that check other hosts.
; Used by the NRPECLient module
[NRPE Client Handlers]
check_other=-H 192.168.0.1 -p 5666 -c remote_command -a arguments

;# LUA SCRIPT SECTION
; A list of all Lua scripts to load.
;[LUA Scripts]
;scripts\test.lua

Thursday, September 22, 2011

Creating your first virtual machine

Creating your first virtual machine

Click on the "New" button at the top of the VirtualBox Manager window. A wizard will pop up to guide you through setting up a new virtual machine (VM):




On the following pages, the wizard will ask you for the bare minimum of information that is needed to create a VM, in particular:

1. The VM name will later be shown in the VM list of the VirtualBox Manager window, and it will be used for the VM's files on disk. Even though any name could be used, keep in mind that once you have created a few VMs, you will appreciate if you have given your VMs rather informative names; "My VM" would thus be less useful than "Windows XP SP2 with OpenOffice".
2. For "Operating System Type", select the operating system that you want to install later. The supported operating systems are grouped; if you want to install something very unusual that is not listed, select "Other". Depending on your selection, VirtualBox will enable or disable certain VM settings that your guest operating system may require. This is particularly important for 64-bit guests (see the section called “64-bit guests”). It is therefore recommended to always set it to the correct value.
3. On the next page, select the memory (RAM) that VirtualBox should allocate every time the virtual machine is started. The amount of memory given here will be taken away from your host machine and presented to the guest operating system, which will report this size as the (virtual) computer's installed RAM.
Note: Choose this setting carefully! The memory you give to the VM will not be available to your host OS while the VM is running, so do not specify more than you can spare. For example, if your host machine has 1 GB of RAM and you enter 512 MB as the amount of RAM for a particular virtual machine, while that VM is running, you will only have 512 MB left for all the other software on your host. If you run two VMs at the same time, even more memory will be allocated for the second VM (which may not even be able to start if that memory is not available). On the other hand, you should specify as much as your guest OS (and your applications) will require to run properly.

A Windows XP guest will require at least a few hundred MB RAM to run properly, and Windows Vista will even refuse to install with less than 512 MB. Of course, if you want to run graphics-intensive applications in your VM, you may require even more RAM.

So, as a rule of thumb, if you have 1 GB of RAM or more in your host computer, it is usually safe to allocate 512 MB to each VM. But, in any case, make sure you always have at least 256 to 512 MB of RAM left on your host operating system. Otherwise you may cause your host OS to excessively swap out memory to your hard disk, effectively bringing your host system to a standstill.

As with the other settings, you can change this setting later, after you have created the VM.
4. Next, you must specify a virtual hard disk for your VM.
There are many and potentially complicated ways in which VirtualBox can provide hard disk space to a VM (see Chapter 5, Virtual storage for details), but the most common way is to use a large image file on your "real" hard disk, whose contents VirtualBox presents to your VM as if it were a complete hard disk. This file represents an entire hard disk then, so you can even copy it to another host and use it with another VirtualBox installation.

The wizard shows you the following window:


Here you have the following options:
* To create a new, empty virtual hard disk, press the "New" button.
* You can pick an existing disk image file.

The drop-down list presented in the window contains all disk images which are currently remembered by VirtualBox, probably because they are currently attached to a virtual machine (or have been in the past).
Alternatively, you can click on the small folder button next to the drop-down list to bring up a standard file dialog, which allows you to pick any disk image file on your host disk.
Most probably, if you are using VirtualBox for the first time, you will want to create a new disk image. Hence, press the "New" button.
This brings up another window, the "Create New Virtual Disk Wizard", which helps you create a new disk image file in the new virtual machine's folder.
VirtualBox supports two types of image files:
* A dynamically allocated file will only grow in size when the guest actually stores data on its virtual hard disk. It will therefore initially be small on the host hard drive and only later grow to the size specified as it is filled with data.
* A fixed-size file will immediately occupy the file specified, even if only a fraction of the virtual hard disk space is actually in use. While occupying much more space, a fixed-size file incurs less overhead and is therefore slightly faster than a dynamically allocated file.
For details about the differences, please refer to the section called “Disk image files (VDI, VMDK, VHD, HDD)”.
To prevent your physical hard disk from running full, VirtualBox limits the size of the image file. Still, it needs to be large enough to hold the contents of your operating system and the applications you want to install -- for a modern Windows or Linux guest, you will probably need several gigabytes for any serious use:
After having selected or created your image file, again press "Next" to go to the next page.
5. After clicking on "Finish", your new virtual machine will be created. You will then see it in the list on the left side of the Manager window, with the name you entered initially.



Running your virtual machine
To start a virtual machine, you have several options:
* Double-click on its entry in the list within the Manager window or
* select its entry in the list in the Manager window it and press the "Start" button at the top or
* for virtual machines created with VirtualBox 4.0 or later, navigate to the "VirtualBox VMs" folder in your system user's home directory, find the subdirectory of the machine you want to start and double-click on the machine settings file (with a .vbox file extension).
This opens up a new window, and the virtual machine which you selected will boot up. Everything which would normally be seen on the virtual system's monitor is shown in the window, as can be seen with the image in the section called “Some terminology”.

In general, you can use the virtual machine much like you would use a real computer. There are couple of points worth mentioning however.
Starting a new VM for the first time
When a VM gets started for the first time, another wizard -- the "First Start Wizard" -- will pop up to help you select an installation medium. Since the VM is created empty, it would otherwise behave just like a real computer with no operating system installed: it will do nothing and display an error message that no bootable operating system was found.
For this reason, the wizard helps you select a medium to install an operating system from.
* If you have physical CD or DVD media from which you want to install your guest operating system (e.g. in the case of a Windows installation CD or DVD), put the media into your host's CD or DVD drive.
Then, in the wizard's drop-down list of installation media, select "Host drive" with the correct drive letter (or, in the case of a Linux host, device file). This will allow your VM to access the media in your host drive, and you can proceed to install from there.
* If you have downloaded installation media from the Internet in the form of an ISO image file (most probably in the case of a Linux distribution), you would normally burn this file to an empty CD or DVD and proceed as just described. With VirtualBox however, you can skip this step and mount the ISO file directly. VirtualBox will then present this file as a CD or DVD-ROM drive to the virtual machine, much like it does with virtual hard disk images.
For this case, the wizard's drop-down list contains a list of installation media that were previously used with VirtualBox.
If your medium is not in the list (especially if you are using VirtualBox for the first time), select the small folder icon next to the drop-down list to bring up a standard file dialog, with which you can pick the image file on your host disks.
In both cases, after making the choices in the wizard, you will be able to install your operating system.
Capturing and releasing keyboard and mouse
As of version 3.2, VirtualBox provides a virtual USB tablet device to new virtual machines through which mouse events are communicated to the guest operating system. As a result, if you are running a modern guest operating system that can handle such devices, mouse support may work out of the box without the mouse being "captured" as described below; see the section called “"Motherboard" tab” for more information.
Otherwise, if the virtual machine only sees standard PS/2 mouse and keyboard devices, since the operating system in the virtual machine does not "know" that it is not running on a real computer, it expects to have exclusive control over your keyboard and mouse. This is, however, not the case since, unless you are running the VM in full-screen mode, your VM needs to share keyboard and mouse with other applications and possibly other VMs on your host.
As a result, initially after installing a guest operating system and before you install the Guest Additions (we will explain this in a minute), only one of the two -- your VM or the rest of your computer -- can "own" the keyboard and the mouse. You will see a second mouse pointer which will always be confined to the limits of the VM window. Basically, you activate the VM by clicking inside it.
To return ownership of keyboard and mouse to your host operating system, VirtualBox reserves a special key on your keyboard for itself: the "host key". By default, this is the right Control key on your keyboard; on a Mac host, the default host key is the left Command key. You can change this default in the VirtualBox Global Settings. In any case, the current setting for the host key is always displayed at the bottom right of your VM window, should you have forgotten about it:

Next

Wednesday, September 21, 2011

VirtualBox

VirtualBox is a cross-platform virtualization application. What does that mean? For one thing, it installs on your existing Intel or AMD-based computers, whether they are running Windows, Mac, Linux or Solaris operating systems. Secondly, it extends the capabilities of your existing computer so that it can run multiple operating systems (inside multiple virtual machines) at the same time. So, for example, you can run Windows and Linux on your Mac, run Windows Server 2008 on your Linux server, run Linux on your Windows PC, and so on, all alongside your existing applications. You can install and run as many virtual machines as you like -- the only practical limits are disk space and memory.

VirtualBox is deceptively simple yet also very powerful. It can run everywhere from small embedded systems or desktop class machines all the way up to datacenter deployments and even Cloud environments.

The following screenshot shows you how VirtualBox, installed on a Mac computer, is running Windows 7 in a virtual machine window:




In this User Manual, we'll begin simply with a quick introduction to virtualization and how to get your first virtual machine running with the easy-to-use VirtualBox graphical user interface. Subsequent chapters will go into much more detail covering more powerful tools and features, but fortunately, it is not necessary to read the entire User Manual before you can use VirtualBox.

You can find a summary of VirtualBox's capabilities in the section called “Features overview”. For existing VirtualBox users who just want to see what's new in this release, Why is virtualization useful?

The techniques and features that VirtualBox provides are useful for several scenarios:

* Running multiple operating systems simultaneously. VirtualBox allows you to run more than one operating system at a time. This way, you can run software written for one operating system on another (for example, Windows software on Linux or a Mac) without having to reboot to use it. Since you can configure what kinds of "virtual" hardware should be presented to each such operating system, you can install an old operating system such as DOS or OS/2 even if your real computer's hardware is no longer supported by that operating system.
* Easier software installations. Software vendors can use virtual machines to ship entire software configurations. For example, installing a complete mail server solution on a real machine can be a tedious task. With VirtualBox, such a complex setup (then often called an "appliance") can be packed into a virtual machine. Installing and running a mail server becomes as easy as importing such an appliance into VirtualBox.
* Testing and disaster recovery. Once installed, a virtual machine and its virtual hard disks can be considered a "container" that can be arbitrarily frozen, woken up, copied, backed up, and transported between hosts.

On top of that, with the use of another VirtualBox feature called "snapshots", one can save a particular state of a virtual machine and revert back to that state, if necessary. This way, one can freely experiment with a computing environment. If something goes wrong (e.g. after installing misbehaving software or infecting the guest with a virus), one can easily switch back to a previous snapshot and avoid the need of frequent backups and restores.

Any number of snapshots can be created, allowing you to travel back and forward in virtual machine time. You can delete snapshots while a VM is running to reclaim disk space.
* Infrastructure consolidation. Virtualization can significantly reduce hardware and electricity costs. Most of the time, computers today only use a fraction of their potential power and run with low average system loads. A lot of hardware resources as well as electricity is thereby wasted. So, instead of running many such physical computers that are only partially used, one can pack many virtual machines onto a few powerful hosts and balance the loads between them.

Some terminology

When dealing with virtualization (and also for understanding the following chapters of this documentation), it helps to acquaint oneself with a bit of crucial terminology, especially the following terms:

Host operating system (host OS).

This is the operating system of the physical computer on which VirtualBox was installed. There are versions of VirtualBox for Windows, Mac OS X, Linux and Solaris hosts; for details, please see the section called “Supported host operating systems”.

Most of the time, this User Manual discusses all VirtualBox versions together. There may be platform-specific differences which we will point out where appropriate.
Guest operating system (guest OS).

This is the operating system that is running inside the virtual machine. Theoretically, VirtualBox can run any x86 operating system (DOS, Windows, OS/2, FreeBSD, OpenBSD), but to achieve near-native performance of the guest code on your machine, we had to go through a lot of optimizations that are specific to certain operating systems. So while your favorite operating system may run as a guest, we officially support and optimize for a select few (which, however, include the most common ones).

See the section called “Supported guest operating systems” for details.
Virtual machine (VM).

This is the special environment that VirtualBox creates for your guest operating system while it is running. In other words, you run your guest operating system "in" a VM. Normally, a VM will be shown as a window on your computer's desktop, but depending on which of the various frontends of VirtualBox you use, it can be displayed in full-screen mode or remotely on another computer.

In a more abstract way, internally, VirtualBox thinks of a VM as a set of parameters that determine its behavior. They include hardware settings (how much memory the VM should have, what hard disks VirtualBox should virtualize through which container files, what CDs are mounted etc.) as well as state information (whether the VM is currently running, saved, its snapshots etc.). These settings are mirrored in the VirtualBox Manager window as well as the VBoxManage command line program; see Chapter 8, VBoxManage. In other words, a VM is also what you can see in its settings dialog.
Guest Additions.

This refers to special software packages which are shipped with VirtualBox but designed to be installed inside a VM to improve performance of the guest OS and to add extra features. This is described in detail in Chapter 4, Guest Additions.

Features overview

Here's a brief outline of VirtualBox's main features:

* Portability. VirtualBox runs on a large number of 32-bit and 64-bit host operating systems (again, see the section called “Supported host operating systems” for details).

VirtualBox is a so-called "hosted" hypervisor (sometimes referred to as a "type 2" hypervisor). Whereas a "bare-metal" or "type 1" hypervisor would run directly on the hardware, VirtualBox requires an existing operating system to be installed. It can thus run alongside existing applications on that host.

To a very large degree, VirtualBox is functionally identical on all of the host platforms, and the same file and image formats are used. This allows you to run virtual machines created on one host on another host with a different host operating system; for example, you can create a virtual machine on Windows and then run it under Linux.

In addition, virtual machines can easily be imported and exported using the Open Virtualization Format (OVF, see the section called “Importing and exporting virtual machines”), an industry standard created for this purpose. You can even import OVFs that were created with a different virtualization software.
* No hardware virtualization required. For many scenarios, VirtualBox does not require the processor features built into newer hardware like Intel VT-x or AMD-V. As opposed to many other virtualization solutions, you can therefore use VirtualBox even on older hardware where these features are not present. The technical details are explained in the section called “Hardware vs. software virtualization”.
* Guest Additions: shared folders, seamless windows, 3D virtualization. The VirtualBox Guest Additions are software packages which can be installed inside of supported guest systems to improve their performance and to provide additional integration and communication with the host system. After installing the Guest Additions, a virtual machine will support automatic adjustment of video resolutions, seamless windows, accelerated 3D graphics and more. The Guest Additions are described in detail in Chapter 4, Guest Additions.

In particular, Guest Additions provide for "shared folders", which let you access files from the host system from within a guest machine. Shared folders are described in the section called “Shared folders”.
* Great hardware support. Among others, VirtualBox supports:
oGuest multiprocessing (SMP). VirtualBox can present up to 32 virtual CPUs to each virtual machine, irrespective of how many CPU cores are physically present on your host.
oUSB device support. VirtualBox implements a virtual USB controller and allows you to connect arbitrary USB devices to your virtual machines without having to install device-specific drivers on the host. USB support is not limited to certain device categories. For details, see the section called “USB settings”.
oHardware compatibility. VirtualBox virtualizes a vast array of virtual devices, among them many devices that are typically provided by other virtualization platforms. That includes IDE, SCSI and SATA hard disk controllers, several virtual network cards and sound cards, virtual serial and parallel ports and an Input/Output Advanced Programmable Interrupt Controller (I/O APIC), which is found in many modern PC systems. This eases cloning of PC images from real machines and importing of third-party virtual machines into VirtualBox.
oFull ACPI support. The Advanced Configuration and Power Interface (ACPI) is fully supported by VirtualBox. This eases cloning of PC images from real machines or third-party virtual machines into VirtualBox. With its unique ACPI power status support, VirtualBox can even report to ACPI-aware guest operating systems the power status of the host. For mobile systems running on battery, the guest can thus enable energy saving and notify the user of the remaining power (e.g. in fullscreen modes).
oMultiscreen resolutions. VirtualBox virtual machines support screen resolutions many times that of a physical screen, allowing them to be spread over a large number of screens attached to the host system.
oBuilt-in iSCSI support. This unique feature allows you to connect a virtual machine directly to an iSCSI storage server without going through the host system. The VM accesses the iSCSI target directly without the extra overhead that is required for virtualizing hard disks in container files. For details, see the section called “iSCSI servers”.
oPXE Network boot. The integrated virtual network cards of VirtualBox fully support remote booting via the Preboot Execution Environment (PXE).
* Multigeneration branched snapshots. VirtualBox can save arbitrary snapshots of the state of the virtual machine. You can go back in time and revert the virtual machine to any such snapshot and start an alternative VM configuration from there, effectively creating a whole snapshot tree. For details, see the section called “Snapshots”. You can create and delete snapshots while the virtual machine is running.
* Clean architecture; unprecedented modularity. VirtualBox has an extremely modular design with well-defined internal programming interfaces and a clean separation of client and server code. This makes it easy to control it from several interfaces at once: for example, you can start a VM simply by clicking on a button in the VirtualBox graphical user interface and then control that machine from the command line, or even remotely. See the section called “Alternative front-ends” for details.

Due to its modular architecture, VirtualBox can also expose its full functionality and configurability through a comprehensive software development kit (SDK), which allows for integrating every aspect of VirtualBox with other software systems. Please see Chapter 11, VirtualBox programming interfaces for details.
* Remote machine display. The VirtualBox Remote Desktop Extension (VRDE) allows for high-performance remote access to any running virtual machine. This extension supports the Remote Desktop Protocol (RDP) originally built into Microsoft Windows, with special additions for full client USB support.

The VRDE does not rely on the RDP server that is built into Microsoft Windows; instead, it is plugged directly into the virtualization layer. As a result, it works with guest operating systems other than Windows (even in text mode) and does not require application support in the virtual machine either. The VRDE is described in detail in the section called “Remote display (VRDP support)”.

On top of this special capacity, VirtualBox offers you more unique features:
oExtensible RDP authentication. VirtualBox already supports Winlogon on Windows and PAM on Linux for RDP authentication. In addition, it includes an easy-to-use SDK which allows you to create arbitrary interfaces for other methods of authentication; see the section called “RDP authentication” for details.
oUSB over RDP. Via RDP virtual channel support, VirtualBox also allows you to connect arbitrary USB devices locally to a virtual machine which is running remotely on a VirtualBox RDP server; see the section called “Remote USB” for details.

Supported host operating systems

Currently, VirtualBox runs on the following host operating systems:

*Windows hosts:
o Windows XP, all service packs (32-bit)
o Windows Server 2003 (32-bit)
o Windows Vista (32-bit and 64-bit[1]).
o Windows Server 2008 (32-bit and 64-bit)
o Windows 7 (32-bit and 64-bit)
*Mac OS X hosts:[2]
o10.5 (Leopard, 32-bit)
o10.6 (Snow Leopard, 32-bit and 64-bit)
o10.7 (Lion, 32-bit and 64-bit)

*Linux hosts (32-bit and 64-bit[3]). Among others, this includes:
oUbuntu 6.06 ("Dapper Drake"), 6.10 ("Edgy Eft"), 7.04 ("Feisty Fawn"), 7.10 ("Gutsy Gibbon"), 8.04 ("Hardy Heron"), 8.10 ("Intrepid Ibex"), 9.04 ("Jaunty Jackalope"), 9.10 ("Karmic Koala"), 10.04 ("Lucid Lynx"), 10.10 ("Maverick Meerkat), 11.04 ("Natty Narwhal").
oDebian GNU/Linux 3.1 ("sarge"), 4.0 ("etch"), 5.0 ("lenny") and 6.0 ("squeeze")
oOracle Enterprise Linux 4 and 5, Oracle Linux 6
oRedhat Enterprise Linux 4, 5 and 6
oFedora Core 4 to 15
oGentoo Linux
oSUSE Linux 9, 10 and 11, openSUSE 10.3, 11.0, 11.1, 11.2, 11.3, 11.4
oMandriva 2007.1, 2008.0, 2009.1, 2010.0 and 2010.1

It should be possible to use VirtualBox on most systems based on Linux kernel 2.6 using either the VirtualBox installer or by doing a manual installation; see the section called “Installing on Linux hosts”. However, the formally tested and supported Linux distributions are those for which we offer a dedicated package.

Note that starting with VirtualBox 2.1, Linux 2.4-based host operating systems are no longer supported.
*Solaris hosts (32-bit and 64-bit) are supported with the restrictions listed in Chapter 14, Known limitations:
oSolaris 11 Express (Nevada build 86 and higher, OpenSolaris 2008.05 and higher)
oSolaris 10 (u8 and higher)

Installing VirtualBox and extension packs

VirtualBox comes in many different packages, and installation depends on your host operating system. If you have installed software before, installation should be straightforward: on each host platform, VirtualBox uses the installation method that is most common and easy to use. If you run into trouble or have special requirements, please refer to Chapter 2, Installation details for details about the various installation methods.

Starting with version 4.0, VirtualBox is split into several components.

1.The base package consists of all open-source components and is licensed under the GNU General Public License V2.
2.Additional extension packs can be downloaded which extend the functionality of the VirtualBox base package. Currently, Oracle provides the one extension pack, which can be found at http://www.virtualbox.org and provides the following added functionality:
1.The virtual USB 2.0 (EHCI) device; see the section called “USB settings”.
2.VirtualBox Remote Desktop Protocol (VRDP) support; see the section called “Remote display (VRDP support)”.
3.Intel PXE boot ROM with support for the E1000 network card.
4.Experimental support for PCI passthrough on Linux hosts; see the section called “PCI passthrough”.

VirtualBox extension packages have a .vbox-extpack file name extension. To install an extension, simply double-click on the package file, and the VirtualBox Manager will guide you through the required steps.

To view the extension packs that are currently installed, please start the VirtualBox Manager (see the next section). From the "File" menu, please select "Preferences". In the window that shows up, go to the "Extensions" category which shows you the extensions which are currently installed and allows you to remove a package or add a new one.

Alternatively you can use VBoxManage on the command line: see the section called “VBoxManage extpack” for details.

Starting VirtualBox

After installation, you can start VirtualBox as follows:

* On a Windows host, in the standard "Programs" menu, click on the item in the "VirtualBox" group. On Vista or Windows 7, you can also type "VirtualBox" in the search box of the "Start" menu.
* On a Mac OS X host, in the Finder, double-click on the "VirtualBox" item in the "Applications" folder. (You may want to drag this item onto your Dock.)
* On a Linux or Solaris host, depending on your desktop environment, a "VirtualBox" item may have been placed in either the "System" or "System Tools" group of your "Applications" menu. Alternatively, you can type VirtualBox in a terminal.

When you start VirtualBox for the first time, a window like the following should come up:



This window is called the "VirtualBox Manager". On the left, you can see a pane that will later list all your virtual machines. Since you have not created any, the list is empty. A row of buttons above it allows you to create new VMs and work on existing VMs, once you have some. The pane on the right displays the properties of the virtual machine currently selected, if any. Again, since you don't have any machines yet, the pane displays a welcome message.

To give you an idea what VirtualBox might look like later, after you have created many machines, here's another example:



NEXT

Installing VirtualBox Guest Additions For Linux in RHEL 5.0 Server

Installing VirtualBox Guest Additions for Linux in RHEl 5 Server 32-bit x86:

Step1. Preparing guest RHEL system for building external kernel modules.

Mount RHEL DVD under a directory in /mnt and install the packages listed below.
1. kernel-devel-2.6.18-8.el5.i686.rpm
2. libgomp-4.1.1-52.el5.i386.rpm
3. glibc-headers-2.5-12.i386.rpm
4. glibc-devel-2.5-12.i386.rpm
5. gcc-4.11-52.el5.i386.rpm

[root@localhost ~]# mkdir /mnt/rhrepo
[root@localhost ~]# mount -t iso9660 /dev/cdrom /mnt/rhrepo
[root@localhost ~]# cd /mnt/rhrepo/Server


Note: Package versions are for RHEL 5.0 release, those for current release of RHEL will have different version numbers.


Step2. Installing VirtualBox Guest Additions.

Mount VBoxGuestAdditions.iso :
Devices-> Mount CD/DVD-ROM->CD/DVD-ROM Image...->VBoxGuestAdditions.iso->Select

mount.JPG
[root@localhost ~]# ./VboxLinuxAdditions86.run
[root@localhost ~]# mkdir /mnt/vbadd
[root@localhost ~]# mount -t vboxsf  sharefolder_name(eg:dload) /mnt/vbadd
[root@localhost ~]# vi /etc/fstab
 and put under fstab for permanent mount
[root@localhost ~]# reboot