How to Setup and Use KVM: Part 2

This guide will describe how to install and setup KVM on a Red Hat/CentOS server. The end result will be a system capable of hosting multiple virtual machines, all of which operate on a bridge network, meaning they are equally accessible within the same LAN and would appear to a remote user as though they were each separate machines.

Before you begin, there are a few system requirements that you need to meet to use KVM:

  1. Hardware virtualization support on your processor, either Intel-VT or AMD-V. Your server specs should include this information. You may also need to enable it in your bios. All server-quality processors will have it. If you are using a laptop to create a test server, you will need to check.
  2. Enough RAM to dedicate portions of it to each guest OS. Remember, you will be running entire instances of servers side-by-side.
  3. Enough disk space for each instance of a complete OS.

You can check for hardware virtualization capabilities on your system by running this command:

$ egrep ‘vmx|svm’ /proc/cpuinfo

The output will look like this for each processor/core:

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 pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt xsave avx lahf_lm arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid

I have highlighted the “vmx” to show you the example of my system, which has support for Intel hardware virtualization. If it were an AMD system, you would see “svm” if it had hardware support.

If your system is cleared for launch, you can go ahead and install kvm:

# yum install kvm

In the next part of this guide, we will install some more features and learn how to setup KVM for virtual machines.