Shashikant shah

Wednesday 5 September 2012

KVM Installation on RHEL-5.4 (64bit)

1. Configuration Step.

2. Create the Yum Server.

3. Now check the virtualization flag
[root@shashi ~]# egrep '(vmx|svm)' --color=always /proc/cpuinfo

4. To install KVM and virtinst (a tool to create virtual machines), we run
[root@shashi ~]# yum install kvm* qemu* libvirt* python-virtinst*

5. Then start the libvirt daemon:
[root@shashi ~]# /etc/init.d/libvirtd start

6. To check if KVM has successfully been installed, run
[root@shashi ~]# virsh -c qemu:///system list
It should display something like this:
Id Name
State
----------------------------------

7. To do this, we install the package bridge-utils...
[root@shashi ~]# yum install bridge-utils*

8. I disable NetworkManager and enable "normal" networking. NetworkManager is good for desktops where network connections can change (e.g. LAN vs. WLAN), but on a server you usually don't change network connections:

[root@shashi ~]# /etc/init.d/NetworkManager stop

[root@shashi ~]# chkconfig NetworkManager off

[root@shashi ~]# /etc/init.d/network restart

9. To configure the bridge, create the file /etc/sysconfig/network-script/ifcfg-br0 (please use the BOOTPROTO, DNS1 (plus any other DNS settings,if any), GATEWAY, IPADDR,NETMASK and SEARCH values from the /etc/sysconfig/network-scripts/ifcfg-eth0 file):

[root@shashi ~]# vim /etc/sysconfig/network-scripts/ifcfg-br0
##############################################
DEVICE=br0
TYPE=Bridge
 
BOOTPROTO=static
GATEWAY=192.168.0.1
IPADDR=192.168.0.100
NETMASK=255.255.255.0
ONBOOT=yes
##############################################

10. Modify /etc/sysconfig/network-scripts/ifcfg-eth0 as follows (comment out
BOOTPROTO, DNS1 (and all other DNS servers, if any), GATEWAY, IPADDR,
NETMASK, and SEARCH and add BRIDGE=br0):

[root@shashi ~]# vim /etc/sysconfig/network-script/ifcfg-eth0
##############################################
DEVICE=eth0
#BOOTPROTO=none
#DNS1=145.253.2.75
#GATEWAY=192.168.0.1
HWADDR=00:1e:90:f3:f0:02
#IPADDR=192.168.0.100
#NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
BRIDGE=br0
##############################################

11. Then reboot the system:

[root@shashi ~]# init 6

12. Now install the “virt-manager”

[root@shashi ~]# yum install virt-manager*

13. Now run the following command to start virtual machine.

[root@shashi ~]# virt-manager

And Install Your KVM VIRTUAL MACHINE

No comments:

Post a Comment