Quantcast
Channel: web-manual.net » Virtualization
Viewing all articles
Browse latest Browse all 4

How to install kvm Virtualization on RHEL 6/CentOS 6

$
0
0

kvm-Virtualization-linuxThe KVM (Kernel Virtual Machine) is a Virtualization environment for the Linux Kernel. We will see here how to install KVM Virtualization on RHEL 6. The same methodology can be applied to install KVM on CentOS 6 also.

Pre-requisites

You will need following System Specifications:-

1. A processor which supports Virtualization.
2. 64-bit hardware architecture.
3. A 64-bit version of the Operating-System (RHEL 6/CentOS 6).
4. VT (Virtualization) enabled in BIOS.

Preliminary Checks

Before jumping into installation part; first of all check the mandatory requirements for installing KVM.

Check whether your CPU supports Virtualization

CPU (processor) has many flags that tell us about the functionality and capability of the processor. The flag to consider is “vmx” or “smx”

Run the following command in Intel processors.

# grep vmx /proc/cpuinfo

or if you have AMD processor, try this

# grep svm /proc/cpuinfo

If you see the results; it means that your processor supports Virtualization. You may get multiple lines as output which will be equal to the number of CPU cores available in your system.

Check whether the Machine has 64-bit capable hardware

You have to look for the flag lm in the output of file /proc/cpuinfo

# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU X5650 @ 2.67GHz
stepping : 2
cpu MHz : 2666.848
cache size : 12288 KB
physical id : 1
siblings : 12
core id : 0
cpu cores : 6
apicid : 32
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx pdpe1gb rdtscp lm constant_tsc ida nonstop_tsc arat pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm
….

Look at the flags, if you could see “lm” somewhere in the flags then the machine has 64-bit capable hardware architecture. If lm is not present, it means that your machine is 32-bit.

Check whether my Operating System is 32-bit or 64-bit

You can do this by the command uname -a and look for your machine architecture. Alternatively you can also check the output of uname -m command.

# uname -a
Linux aclaxiom1 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
#
# uname -m
x86_64

For a 64-bit architecture the output will show something like above. Notice the “x86_64”

Finally you need to enable Virtualization in your BIOS. After having performed the checks you can now proceed to install KVM.

How to install KVM into RHEL 6 or CentOS 6

In order to effectively install KVM virtualization and configure Guest OS, you need to install multiple packages. All such packages are provided under certain package groups in RHEL 6 standard installation DVD.

The groups are

Virtualization
Provides an environment for hosting virtualized guests.

Packages:
qemu-kvm
qemu-kvm-tools

Virtualization Platform
Provides an interface for accessing and controlling virtualized guests and containers.

Mandatory Packages:
libvirt
libvirt-client
Optional Packages:
fence-virtd-libvirt
fence-virtd-multicast
fence-virtd-serial
libvirt-cim
libvirt-java
libvirt-qpid
perl-Sys-Virt

Virtualization Client
Clients for installing and managing virtualization instances.

Mandatory Packages:
python-virtinst
virt-manager
virt-viewer
Default Packages:
virt-top

Virtualization Tools
Tools for offline virtual image management

Default Packages:
libguestfs
Optional Packages:
libguestfs-java
libguestfs-mount
libguestfs-tools
virt-v2v

You can install all these packages by using yum as follows.

# yum groupinstall Virtualization
# yum groupinstall “Virtualization Platform”
# yum groupinstall “Virtualization Client”
# yum groupinstall “Virtualization Tools”

You can verify your successful KVM installation by the following command

# lsmod | grep kvm
kvm_intel 45674 0
kvm 291811 1 kvm_intel

Now that you have verified successfully, you may check/start the libvirtd daemon process as follows

# service libvirtd status
libvirtd (pid 6914) is running…

Do not forget to run the following command if you want to run the libvirtd daemon at boot time on runlevels 3 and 5.

# chkconfig –level 35 libvirtd on

After you have installed the packages you’ll find a new menu option to launch the VM Manager
under
Application -> System Tools -> Virtual Machine Manager

KVM Virtual Machine gui

The post How to install kvm Virtualization on RHEL 6/CentOS 6 appeared first on web-manual.net.


Viewing all articles
Browse latest Browse all 4

Trending Articles