Problem solve Get help with specific problems with your technologies, process and projects.

How to configure Red Hat Enterprise Linux 5.4 as a KVM host

Now that Red Hat Enterprise Linux 5.4 natively supports KVM, you can easily configure a KVM host in your virtual environment. Here we outline how to install KVM on an RHEL server.

Since its acquisition of Qumranet in 2008, commercial Linux provider Red Hat Inc. has integrated Kernel-based Virtual Machine (KVM) virtualization into Red Hat Enterprise Linux (RHEL). Finally, Red Hat Enterprise Linux 5.4 natively supports KVM out of the box, is the first enterprise Linux provider to offer this as the default virtualization option. This article outlines the hardware requirements for KVM and how to configure an RHEL server as a KVM host.

Do you have the proper hardware?

First, to install Red Hat you need the right hardware: Specifically, a CPU that supports virtualization. With Intel-based hardware, the CPU must support the Vanderpoolfeature (i.e., a feature enabling tighter coupling of virtualization and hardware) . If your server has an AMD processor, however, it must have Pacifica built in. In general, most server-grade hardware has these features, but older or cheaper hardware may not. Fortunately, this information is easy to uncover.

When booting the server, enter the cat /proc/cpuinfo command. For Vanderbilt-supported Intel processors, "vmx" should appear in the output's flag line. For AMD CPUs with Pacifica, a "vms" will appear. Even if your hardware supports virtualization, check the server BIOS, because some models have the feature switched off by default.

Next, devise a game plan for your virtualization environment. If you're intending to install RHEL on a single server, make sure there is sufficient RAM available (I recommend a minimum of 8 GB, depending on how many VMs will be running). Also, allocate enough storage on a fast hard drive. Don't forget, every VM requires a storage back end to a Virtual Hard Disk. For the best performance, it's a good idea to place the storage back end on a dedicated SCSI drive -- or, even better, a storage area network (SAN). A SAN is a better option because the storage back end won't suffer downtime if a KVM host fails.

Installing the KVM framework

Once the hardware is set up, it's time to install the Red Hat operating system. Insert the installation DVD, and start up the installer. When prompted to select which pattern to install, choose the virtualization pattern but don't click Next yet. By default, RHEL 5.4 installs Xen virtualization, but you want to install KVM. To change this, select Customize. Then, deselect Virtualization and check off KVM instead.

Figure 1
Make sure to select KVM instead of the normal Virtualization package. (Click image for an enlarged view.)

After you have installed the OS, there are a couple of caveats. First, RHEL comes with security features enabled by default. Unfortunately, these features may also interact negatively with the virtual machines (VMs)you are about to create. Therefore, it's best to switch off both the firewall a Security-Enhanced Linux initially (unless you are familiar with this process).

Finally, register the server with Red Hat Network to download the necessary patches and apply for support to complete the installation.

In part two of this series, we cover how to install a VM on top of KVM in your Red Hat server.

Sander van Vugt, ContributorSander van Vugt is an independent trainer and consultant based in the Netherlands. Van Vugt is an expert in Linux high availability, virtualization and performance and has completed several projects that implement all three. He is also the writer of various Linux-related books, such as Beginning the Linux Command Line, Beginning Ubuntu Server Administration and Pro Ubuntu Server Administration.

Dig Deeper on Open source virtualization

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.