Difference between revisions of "Centos 5.x Installed as a Virtual Machine"

From Klaus' wiki
Jump to: navigation, search
Line 73: Line 73:
 
</source>
 
</source>
 
'''''NOTICE''''': '''Do not change the HWADDR!'''
 
'''''NOTICE''''': '''Do not change the HWADDR!'''
 +
 +
 +
A note about setting up the [[Tftp]]

Revision as of 09:59, 28 June 2010

The Centos 5.x can be installed as a virtual machine on the Xen virtualisation framework. Follow the picture guide below:

Create virtual1.png Create virtual2.png Create virtual3.png Create virtual9.png Create virtual5.png Create virtual6.png Create virtual7.png Create virtual8.png Create virtual10.png Create virtual11.png Create virtual12.png Create virtual13.png Create virtual14.png Create virtual15.png Create virtual16.png Create virtual17.png Create virtual18.png Create virtual19.png Create virtual21.png Create virtual22.png Create virtual25.png Create virtual24.png Create virtual26.png Create virtual27.png


Reboot the newly created machine.

SSH to the machine.

Execute the following commands:

scp 10.1.18.101:~/.bashrc .
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
rpm -Uvh http://download1.rpmfusion.org/free/el/updates/testing/5/i386/rpmfusion-free-release-5-0.1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/rpmfusion-nonfree-release-5-0.1.noarch.rpm
vi /etc/yum.repos.d/*
yum update
init 6

The first line gets the modified .bashrc (if you got the particular machine up running and know the root password), that among other things, paints the prompt red for root logins - nice warning!

The second line installs the epel repository and the third line the rpmfusion repository.

Fourth line opens all the repository files enabling to enable or disable selected repositories. Enable at least in Centos Base repo: centorplus and contrib by changing the line enabled=0 to enabled=1 respectively.

Fifth line updates the machine (answer y(es) to everything asked) and finally the sixth line reboots with the newly installed software and patches.

You can from here install what ever is needed by using yum.

You can clone the newly installe machine issuing this command:

[klausk@bren virtuals]$  sudo virt-clone --original centos_32_base --name centos_32 --file `pwd`/centos_32

provided that current directory is the location of the virtual machines.

Boot the newly created clone and as the first thing fix the ip-address of the machine - it's set to DHCP. The clone will have a unique MAC address.

Fix in /etc/sysconfig/network the hostname to match the new name of the machine.

In /etc/sysconfig/network-scripts/ifcfg-eth0 put in these lines:

DEVICE=eth0
BOOTPROTO=none
HWADDR=00:16:36:2b:59:d3 #DO NOT ADD THIS LINE - KEEP THE ORIGINAL
IPADDR=10.1.18.101
NETMASK=255.255.255.0
ONBOOT=yes
GATEWAY=10.1.18.1
TYPE=Ethernet

NOTICE: Do not change the HWADDR!


A note about setting up the Tftp