Centos 5.x Installed as a Virtual Machine
See also Handling virtual machines
The Centos 5.x can be installed as a virtual machine on the Xen virtualisation framework. Follow the picture guide below:
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