Tip

Creating KVM virtual machines in Red Hat Enterprise Linux 5.4

Red Hat Enterprise Linux (RHEL) 5.4 is the first enterprise Linux distribution that natively supports Kernel-based Virtual Machine (KVM) virtual machines (VMs). Previously, I covered how to set up RHEL as a KVM host.

    Requires Free Membership to View

Here I explain how to create KVM VMs in a host.

The easiest way to create a KVM virtual machine is through the virt-manager interface. Start this utility from a console window, and type the virt-manager command from an administrative account.

Figure 1
This interface appears after entering the virt-manager command from an administrative account.(Click image for an enlarged view.)

If the KVM host is live, virt-manager will show the qemu virtualization solution is active on the current host (which should be localhost). To create a VM, select the field. Then, click New. This opens the Create Virtual Machine installation program, and it provides a summary of the required information.

Next, provide a name for the VM. Although it doesn't have to be the same as the VM hostname, it's a good idea for both to share the same title. After entering a name and clicking Forward, virt-manager displays two virtualization methods: paravirtualization and full virtualization. (Note: paravirtualization is not supported in KVM virtualization. Virt-manager shows this option because it is available in the Xen hypervisor). Select full virtualization, and choose KVM as the hypervisor. Then, pick the appropriate hardware platform -- 32-bit or 64-bit -- and click Forward.

Figure 2
Select KVM as the hypervisor. (Click image for an enlarged view.)

Now specify an installation method: either through a network installation server or from a local CD/DVD-drive (the much simpler approach). Then select an operating system. While this is not necessary, this makes it easier to set the configuration parameters later.

Next, configure the VM's storage method. For a storage back end, there are two choices: a physical storage device or the default option of creating a file. For simplicity's sake on this trial run, create a file as the storage back end. When creating the virtual disk, the default of 4 GB is a bit small, so I recommend at least 10 GB.

Figure 3
For an easy installation, choose a file as the storage back end. (Click image for an enlarged view.)

Figure 4
Follow the VM operating system installation procedure to create your first KVM virtual machine in RHEL 5.4. (Click image for an enlarged view.)

In the next three windows, accept the default options. After clicking Finish in the last window, the installation will start automatically. From here, complete the guest operating system installation. Soon after, your first KVM virtual machine will be up and running in RHEL 5.4!

Sander 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.


This was first published in November 2009

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.