Centos Downloads & installation STEPS Quick Search Engine :

Custom Search

NB:

You can Find ALL (Downloads,translations,meaning,more posts)Quickly and easily With This Search engine. *For Meaning Use : Meaning of 'WORD' . *For Translate Somthing Use : Translate ' WORD' *For Download use : DOWNLOADS 'name' or 'reference' *For More Posts About A Subjet Use : Posts About 'WORD/SENTENSE')

Sunday, April 26, 2009

Installing Xen On CentOS 5.0 (i386)

Version 1.0
Author: Falko Timme
Last edited 06/08/2007

This tutorial provides step-by-step instructions on how to install Xen (version 3.0.3) on a CentOS 5.0 system (i386).

Xen lets you create guest operating systems (*nix operating systems like Linux and FreeBSD), so called "virtual machines" or domUs, under a host operating system (dom0). Using Xen you can separate your applications into different virtual machines that are totally independent from each other (e.g. a virtual machine for a mail server, a virtual machine for a high-traffic web site, another virtual machine that serves your customers' web sites, a virtual machine for DNS, etc.), but still use the same hardware. This saves money, and what is even more important, it's more secure. If the virtual machine of your DNS server gets hacked, it has no effect on your other virtual machines. Plus, you can move virtual machines from one Xen server to the next one.

I will use CentOS 5.0 (i386) for both the host OS (dom0) and the guest OS (domU).

This howto is meant as a practical guide; it does not cover the theoretical backgrounds. They are treated in a lot of other documents in the web.

This document comes without warranty of any kind! I want to say that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!


1 Preliminary Note

I use the following partitions on my CentOS 5.0 host system (dom0):

* /boot 150 MB (ext3)
* swap 1GB
* / 3GB (ext3)
* /vm the rest (ext3)

I will create the virtual machines in the /vm directory; of course, you can use any other directory that has enough space left, and you don't have to create a partition of its own for it. If you use another directory, replace /vm with your own directory in this tutorial.

If you want to save your virtual machines in /vm, too, but haven't created a partition for it of if the directory /vm doesn't exist on your system, you can create it like this:

mkdir /vm

(Please note: You don't need a /boot partition, but then you have to keep in mind that the Grub stanzas I describe in this howto are slightly different. For example, when I write that I add

[...]
title CentOS (2.6.18-8.1.4.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-8.1.4.el5
module /vmlinuz-2.6.18-8.1.4.el5xen ro root=/dev/VolGroup00/LogVol00
module /initrd-2.6.18-8.1.4.el5xen.img
[...]

to /boot/grub/menu.lst then you should probably use

[...]
title CentOS (2.6.18-8.1.4.el5xen)
root (hd0,0)
kernel /boot/xen.gz-2.6.18-8.1.4.el5
module /boot/vmlinuz-2.6.18-8.1.4.el5xen ro root=/dev/VolGroup00/LogVol00
module /boot/initrd-2.6.18-8.1.4.el5xen.img
[...]

in that file instead...)


2 Installing Xen

To install Xen, we simply run

yum install kernel-xen xen

This installs Xen and a Xen kernel on our CentOS system. Afterwards, we can find our new Xen kernel (vmlinuz-2.6.18-8.1.4.el5xen) and its ramdisk (initrd-2.6.18-8.1.4.el5xen.img) in the /boot directory:
ls -l /boot/

[root@server1 ~]# ls -l /boot/
total 16327
-rw-r--r-- 1 root root 62154 Apr 9 16:30 config-2.6.18-8.1.1.el5
-rw-r--r-- 1 root root 61057 May 17 12:12 config-2.6.18-8.1.4.el5xen
-rw-r--r-- 1 root root 62150 Mar 16 01:19 config-2.6.18-8.el5
drwxr-xr-x 2 root root 1024 Jun 8 00:14 grub
-rw------- 1 root root 2318110 Apr 13 17:10 initrd-2.6.18-8.1.1.el5.img
-rw------- 1 root root 2320081 Jun 8 00:14 initrd-2.6.18-8.1.4.el5xen.img
-rw------- 1 root root 2318126 Apr 13 16:18 initrd-2.6.18-8.el5.img
drwx------ 2 root root 12288 Apr 13 16:05 lost+found
-rw-r--r-- 1 root root 80032 Apr 1 16:49 message
-rw-r--r-- 1 root root 83542 Apr 9 16:31 symvers-2.6.18-8.1.1.el5.gz
-rw-r--r-- 1 root root 84906 May 17 12:13 symvers-2.6.18-8.1.4.el5xen.gz
-rw-r--r-- 1 root root 83542 Mar 16 01:20 symvers-2.6.18-8.el5.gz
-rw-r--r-- 1 root root 884787 Apr 9 16:30 System.map-2.6.18-8.1.1.el5
-rw-r--r-- 1 root root 868062 May 17 12:12 System.map-2.6.18-8.1.4.el5xen
-rw-r--r-- 1 root root 884787 Mar 16 01:19 System.map-2.6.18-8.el5
-rw-r--r-- 1 root root 1765460 Apr 9 16:30 vmlinuz-2.6.18-8.1.1.el5
-rw-r--r-- 1 root root 2075341 May 17 12:12 vmlinuz-2.6.18-8.1.4.el5xen
-rw-r--r-- 1 root root 1765428 Mar 16 01:19 vmlinuz-2.6.18-8.el5
-rw-r--r-- 1 root root 274228 May 17 09:13 xen.gz-2.6.18-8.1.4.el5
-rwxr-xr-x 1 root root 608568 May 17 12:28 xen-syms-2.6.18-8.1.4.el5
[root@server1 ~]#

Before we can boot the system with the Xen kernel, we must tell the bootloader GRUB about it. We open /boot/grub/menu.lst:

vi /boot/grub/menu.lst

and add the following stanza above all other kernel stanzas:

[...]
title CentOS (2.6.18-8.1.4.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-8.1.4.el5
module /vmlinuz-2.6.18-8.1.4.el5xen ro root=/dev/VolGroup00/LogVol00
module /initrd-2.6.18-8.1.4.el5xen.img
[...]

Then change the value of default to 0:

[...]
default=0
[...]

The complete /boot/grub/menu.lst should look something like this:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-8.1.4.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-8.1.4.el5
module /vmlinuz-2.6.18-8.1.4.el5xen ro root=/dev/VolGroup00/LogVol00
module /initrd-2.6.18-8.1.4.el5xen.img
title CentOS (2.6.18-8.1.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.1.1.el5 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-8.1.1.el5.img
title CentOS (2.6.18-8.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-8.el5.img

Afterwards, we reboot the system:

shutdown -r now

The system should now automatically boot the new Xen kernel. After the system has booted, we can check that by running

uname -r

[root@server1 ~]# uname -r
2.6.18-8.1.4.el5xen
[root@server1 ~]#

So it's really using the new Xen kernel!

We can now run

xm list

to check if Xen has started. It should list Domain-0 (dom0):

[root@server1 ~]# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 350 1 r----- 94.4
[root@server1 ~]#


3 Creating A Virtual Machine

CentOS comes with a nice tool called virt-install with which we can create virtual machines for Xen. To start it, we simply run

virt-install

The tools asks a few questions before it creates a virtual machine. I want to call my first virtual machine vm01, with 256MB RAM and a disk size of 4GB. I want to store it in the file /vm/vm01.img:

What is the name of your virtual machine? <-- vm01
How much RAM should be allocated (in megabytes)? <-- 256
What would you like to use as the disk (path)? <-- /vm/vm01.img
How large would you like the disk (/vm/vm01.img) to be (in gigabytes)? <-- 4
Would you like to enable graphics support? (yes or no) <-- no
What is the install location? <-- http://wftp.tu-chemnitz.de/pub/linux/centos/5.0/os/i386

The question about the graphics support refers to the installer, not the virtual machine itself! It is possible to start a graphical installer, but you'd have to connect to it via VNC. It's easier to use the text installer - it offers the same options, so I choose the text installer.

As install location, you should specify a mirror close to you where the installer can download all files needed for the installation of CentOS 5.0 in our virtual machine. You can find a list of CentOS mirrors here: http://www.centos.org/modules/tinycontent/index.php?id=13

After we have answered all questions, virt-install starts the normal CentOS 5.0 installer (in text mode) in our vm01 virtual machine. You already know the CentOS installer, so it should be no problem for you to finish the CentOS installation in vm01.

After the installation, we stay at the vm01 console. To leave it, type CTRL+] if you are at the console, or CTRL+5 if you're using PuTTY. You will then be back at the dom0 console.

virt-install has created the vm01 configuration file /etc/xen/vm01 for us (in dom0). It should look like this:

cat /etc/xen/vm01

# Automatically generated xen config file
name = "vm01"
memory = "256"
disk = [ 'tap:aio:/vm/vm01.img,xvda,w', ]
vif = [ 'mac=00:16:3e:13:e4:81, bridge=xenbr0', ]

uuid = "5aafecf1-dd66-401d-69cc-151c1cb8ac9e"
bootloader="/usr/bin/pygrub"
vcpus=1
on_reboot = 'restart'
on_crash = 'restart'

Run

xm console vm01

to log in on that virtual machine again (type CTRL+] if you are at the console, or CTRL+5 if you're using PuTTY to go back to dom0), or use an SSH client to connect to it.

To get a list of running virtual machines, type

xm list

The output should look like this:

[root@server1 xen]# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 259 1 r----- 1906.6
vm01 3 255 1 ------ 137.9
[root@server1 xen]#

To shut down vm01, do this:

xm shutdown vm01

To start vm01 again, run

xm create /etc/xen/vm01

If you want vm01 to start automatically at the next boot of the system, then do this:

ln -s /etc/xen/vm01 /etc/xen/auto

Here are the most important Xen commands:

xm create -c /path/to/config - Start a virtual machine.
xm shutdown - Stop a virtual machine.
xm destroy - Stop a virtual machine immediately without shutting it down. It's as if you switch off the power button.
xm list - List all running systems.
xm console - Log in on a virtual machine.
xm help - List of all commands.


4 Links

* Xen: http://www.xensource.com/xen
* CentOS: http://www.centos.org

Installation Guide: CentOS 5.1 Desktop

This document describes how to set up a CentOS 5.1 desktop. The result is a fast, secure and extendable system that provides all you need for daily work and entertainment.

This howto is a practical guide without any warranty - it doesn't cover the theoretical backgrounds. There are many ways to set up such a system - this is the way I chose.

1 Install Media

The install media(s) are available at http://isoredirect.centos.org/centos/5/isos/i386/. I used the DVD-image for this howto.

2 Installation

Hit "Enter" to start the installation.

Test your install media if you want.

The installation wizard is starting.

Select your language and proceed.

Choose your keyboard-layout and proceed.

Here you can select/edit the partitioning layout.



If you chose the manual setup, you'll see the following two windows.

Here you can adjust the network settings.

Select the location nearest to yours and configure the clock. Unmark the checkbox if there are other operating systems installed, that expects the clock to be set to local time - e.g. Windows.

Choose a password for the root-account and confirm it.


Here you can select predefined collections of software. You can also make a custom selection if you mark the corresponding radio button.

Select "Packages from CentOS Extras" - a window will pop up, asking for your network configuration. If you have already configured your network settings simply commit it - otherwise configure the settings now.

If you chose the custom selection you'll see this and a few following windows. Select a main group on the left and afterwards one of its subgroups on the right. Now click on "Optional Packages" - you'll see...

...this window with a detailed package list. Select or deselect packages as you like.

Click "Next" if your selection is complete. Dependencies are being checked.

The system is ready to install - click on "Next".

The partition(s)/disk(s) are being formatted etc.

The system is being installed.

The installation is complete. Remove the install media and reboot the system.



3 First Start

If there's no reason to do something special wait a few seconds to start with the standard settings.

The system is starting up.

This is the first start - the firstboot-wizard appears.

Here you can edit the firewall settings if you want. If you're not planning to connect to this computer via ssh/scp/sftp etc you can close the corresponding port.

I recommend to deactivate SELinux - it can cause many problems, especially if you're using software from additional repositories.

A reboot is required to make the changes effective.

Set the actual time and date.

If you enable the network time protocol, the time will be synchronized with a remote time server.

Time to add the first user-account to the system.

The system will test your soundcard (there was no soundcard added to this vm).

Here you can add software from additional CDs. Afterwards click on "Finish".

The system has to reboot now.

When the system is up again, you'll see the login window. Log in to the system with the userdata you chose in the firstboot-wizard.

Welcome to your desktop.

4 Basic Configuration

In various parts of this howto you have to switch to the root-account (within a terminal). The terminal is available in the gnome applications menu.

Enter the following to switch to the root-account:

su -
%rootpassword%

You can switch back to your user-account with:

exit

4.1 Yum Plugins & Yumex

Install some recommended packages to prevent problems with packages (broken/3rd party) and kernel-modules (root privileges needed):

yum install yumex yum-fastestmirror yum-skip-broken yum-kmod yum-kernel-module yum-priorities

Note: How to manage packages with yumex is described later at step 5.

After that we add priorities to the default repositories.

vi /etc/yum.repos.d/CentOS-Base.repo

Add a priority to each repository-entry - the content should look like this:

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# 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.
#
#
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

4.2 RPMforge

The RPMforge-repository provides many packages like multimedia applications and drivers.

4.2.1 Installation

Install the repository:

rpm -ivh http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

4.2.2 Priority

Now let's set a low priority (high number > 10) for this repository.

vi /etc/yum.repos.d/rpmforge.repo

Change the content that it looks like this:

# Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag # URL: http://rpmforge.net/ [rpmforge] name = Red Hat Enterprise $releasever - RPMforge.net - dag #baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge enabled = 1 protect = 0 gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag gpgcheck = 1 priority=11

4.3 Remove Software

Before you are going to update the system for the first time you should check if there is software installed that you don't need, or rather that you want to replace with another software. The goal should be a clean system with only the programs installed that you really need.

Which programs you should deinstall or replace with others is up to you - you'll find a summary of already installed software at step 6 and a little assortment of additional software (including possible replacements for already installed software) at step 7.

You can simply deinstall software with the Yum Extender (yumex) - have a look at step 5.

4.4 Services

Some services are enabled by default on your system - maybe some of them are needless (depending on your hardware and your needs). The deactivation of needless services will save system resources, so it's worth to take a look on the service settings - they are available in the gnome system menu.

Enter the root password.

Select "Runlevel All".


4.4.1 Enable Services

  • Network Manager
  • Network Manager Dispatcher

4.4.2 Disable Services

  • bluetooth (disable this service if there is no bluetooth device connected to your system)
  • firstboot (this service is not longer needed)
  • mdmonitor (disable this service if you haven't set up a RAID-system)
  • pcscd (disbale this service if there is no smart-card device connected to your system)
  • restorecond (disable this service if you deactivated SELinux)
  • sshd (disable this service if you're not planning to connect to this computer via ssh/scp/sftp etc)

If you have a computer with a wlan-card I recommend to disable "network" in all runlevels - otherwise you'll have a long boot-time cause the system tries to allocate a dhcp-ip to this device (regardless of the configuration). The network manager will enable the network automatically after you've logged in.

4.5 Nautilus

Nautilus opens a window for every single folder by default - to change this open any folder and edit the settings. It's also a good idea to enable the delete command that bypasses the trash - because if you delete something from external storages with the standard delete command, the things will not really be deleted but moved to a trash on the device (.trash). This trash will not be affected when you delete the trash on your desktop.

Now it's user-friendly.

4.6 Fonts

In this step we'll make the fonts eye-friendly and change the resolution to a value that is used by most operating systems. The font settings are available in the gnome system menu.

Choose 9px as font-size for all fonts. Select "Subpixel smoothing" if you're using a LCD-monitor. Afterwards click on "Details".

The resolution should be 96dpi.

4.7 System Update

The system will check for updates automatically and notify you if updates are available. Click on "View Updates".

Enter the root-password.

The update information are being retrieved.

href=

You'll see a summary of available updates and their details. Click on "Apply updates" to install the updates.

The dependencies are being resolved.

The updates are being downloaded ...

... and installed.

Sometimes, e.g. when a new kernel was installed, it's recommended to reboot the system.


5 Yum Extender

The yum extender (a.k.a. yumex) is an easy to use gui for the yum package manager. With yumex you can install, deinstall or update packages - it's available in the gnome applications menu.

Enter the root-password.

Yumex appears - make yourself familiar with the gui.

5.1 Deinstall Packages

Select the radio-button "Installed" - now you'll see all installed packages. Browse the list or enter a search term in the corresponding field to find a package.

If you find a package that you want to remove simply unmark its checkbox.

Alternatively you can use the group view.

This is the package queue - here you can see all the packages that you selected for deinstallation. If you made a mistake you can remove one or more packages from this list. If you agree to your selection click on "Process Queue" in the bottom right corner.

If the packages that you want to deinstall have dependencies, they'll also be marked for deinstallation. Proceed if you agree.

The packages are being deinstalled.

Deinstallation finished. Quit yumex or proceed to reload yumex.

5.2 Install Packages

Select the radio-button "Available" - now you'll see all installed packages. Browse the list or enter a search term in the corresponding field to find a package. If you find a package that you want to install simply mark its checkbox.

Alternatively you can use the group view.

The package queue contains all packages that you selected for installation. If you made a mistake you can remove one or more packages from this list.

The dependencies are being resolved, they'll also be marked for installation.

Proceed if you agree.

The packages are being downloaded...

...checked...

...and installed.

Installation finished. Quit yumex or proceed to reload yumex.

6 By Default Installed Software

6.1 Multimedia

  • Rhythmbox (audio player)
  • Totem (video player)

6.2 Graphics

  • Gimp (edit images/photos)

6.3 Office

  • OpenOffice.org (office suite)

6.4 Internet

  • Firefox (web browser)
  • Evolution (email client)
  • Ekiga (internet telephony)
YOU CAN USE QUICK SEARCH ENGINE ON THE TOP FOR MORE DETAILS.