Installing KVM on Centos 6.2 Desktop

Set SELINUX=disabled  on  “/etc/selinux/config” file

# nano  “/etc/selinux/config”
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing – SELinux security policy is enforced.
#     permissive – SELinux prints warnings instead of enforcing.
#     disabled – No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted – Targeted processes are protected,
#     mls – Multi Level Security protection.
SELINUXTYPE=targeted

and reboot system

# reboot

import the GPG keys for software packages

# rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY*

install KVM and virtinst

# yum install kvm libvirt python-virtinst qemu-kvm

stop and set off on boot NetworkManger service

# service NetworkManager stop
# chkconfig NetworkManager off

install  “bridge-utils”  package

# yum install bridge-utils

configure a bridge creating “/etc/sysconfig/network-scripts/ifcfg-br0″ file

# nano /etc/sysconfig/network-scripts/ifcfg-br0

should modify IPADDR, PREFIX, GATEWAY, DNS1 and DNS2 values according to your network

DEVICE=”br0″
NM_CONTROLLED=”yes”
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.1.105
PREFIX=24
GATEWAY=192.168.1.1
DNS1=80.58.61.250
DNS2=80.58.61.254
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=”System br0″

edit “/etc/sysconfig/network-scripts/ifcfg-eth0 ” file

# nano /etc/sysconfig/network-scripts/ifcfg-eth0

and modify as follows (comment out BOOTPROTO, IPADDR, PREFIX, GATEWAY, DNS1, and DNS2 and add BRIDGE=br0)

DEVICE=”eth0″
NM_CONTROLLED=”yes”
ONBOOT=yes
HWADDR=00:16:0A:26:E6:D4
TYPE=Ethernet
#BOOTPROTO=none
#IPADDR=192.168.1.105
#PREFIX=24
#GATEWAY=192.168.1.1
#DNS1=192.168.1.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=”System eth0″
UUID=9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04
BRIDGE=br0

Restart the network

# service network restart

check the network bridge (br0)

# ifconfig
br0       Link encap:Ethernet  HWaddr 00:16:0A:26:E6:D4  
          inet addr:192.168.1.105  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::216:aff:fe26:e6d4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:28 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2002 (1.9 KiB)  TX bytes:7535 (7.3 KiB)eth0    Link encap:Ethernet  HWaddr 00:16:0A:26:E6:D4  
          inet6 addr: fe80::216:aff:fe26:e6d4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19247 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14826 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:25052924 (23.8 MiB)  TX bytes:1241868 (1.1 MiB)
          Interrupt:19 Base address:0x6c00 lo       Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2128 (2.0 KiB)  TX bytes:2128 (2.0 KiB)virbr0  Link encap:Ethernet  HWaddr 52:54:00:01:C5:58  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:3175 (3.1 KiB)

install virt-manager

# yum install virt-manager