Crash course: Virtualization with KVM on Ubuntu Server

Learn how to get KVM running on Ubuntu Server, install multiple guests, manage storage, and migrate guests to new hosts

By Carla Schroder, ITworld |  Virtualization, crash course, KVM 2 comments

KVM, the Linux kernel hypervisor, is the up-and-coming enterprise virtualization contender. It's lean, mean, fast, and runs unmodified guest operating systems with ease. In this crash course we'll quickly get KVM up and running on Ubuntu Server, install multiple guests, manage storage, and migrate guests to new hosts.

KVM and Ubuntu Server

KVM, which stands for "kernel-based virtual machine", was first developed by Qumranet. Red Hat bought Qumranet in 2008 and made KVM the core of Red Hat Enterprise Virtualization for Servers. KVM is licensed under the GPL and is part of the mainline kernel, so any Linux distribution can support it. KVM is a Type 2 hypervisor, which means it runs inside an operating system. Some popular Type 2 hypervisors are Xen and VirtualBox. Type 1 hypervisors, such as IBM's z/VM and VMWare ESXi, run on the bare metal and don't need operating systems. KVM supports pretty much any guest operating systems: Linux, Mac OS X, Unix, Windows, and whatever else you have lying around.

Ubuntu Server, like KVM, is growing into an enterprise powerhouse. Ubuntu supports KVM on x86 and x86_64. Unlike Red Hat and Novell, the big two enterprise Linux vendors, you can download and test Ubuntu without having to register or wade through sales pitches. If you want training, commercial support, or online services like the Landscape systems manager or Ubuntu cloud services, they're there when you want them.

System requirements

For this crash course you'll need an Ubuntu computer with an Intel VT or AMD-V CPU, because these include special extensions for native support of virtual machines.(See KVM's CPU support page for more information.) I'm using 11.04, Natty Narwhal 64-bit for this article. I recommend using Ubuntu Server for your production KVM server, but for testing, any Ubuntu will do. Use this command to see if your x86 CPU has virtualization extensions:


$ egrep -o '(vmx|svm)' /proc/cpuinfo
vmx
vmx

This example shows a dual-core Intel CPU with virtualization support. You'll probably have to enable the virtualization extensions in your system BIOS. Make sure this is enabled or KVM will not work.

You can run 32- or 64-bit guests on a 64-bit system, but you can run only 32-bit guests on a 32-bit system. Lots of memory is good, and so are multi-core CPUs. Ubuntu Server is frugal of system resources, which leaves more for your virtual guests. The minimum Ubuntu Server system requirements are a 300 MHz processor, 128 MB RAM, and 1 GB hard drive space. That is very minimal. For testing KVM, I recommend a minimum 2 GHz CPU, 2 GB RAM, and enough disk space for your guest operating systems plus data storage. Provisioning a production server is a bit imprecise. If you just add up the system requirements of all your guests, you'll have an over-provisioned machine, unless your guests run at full-speed all the time. One of the benefits of virtual machines is using hardware more efficiently, because when one guest is idle another one is busy. If you under-provision and your server becomes overloaded, then you can move guests to different hosts. So you have a lot of wiggle room, and don't need to make it perfect from the start.

ITworld LIVE

VirtualizationWhite Papers & Webcasts

White Paper

vRanger Helps Cut Replication Time by Almost 70%

There's a reason why more than 38,000 customers trust vRanger to protect their critical virtual data! In this Quest Software case study, see how vRanger helped Cornerstone Bancshares, Inc. cut replication time from days to minutes - and how this translated to real time and money savings.

White Paper

ESG: Product Brief: Quest vRanger 5.3 brings enterprise-class VMware protection to SMB's

Free paper: how virtualization impacts SMBs, and strategies for enterprise-class VMware protection

White Paper

Converged Storage: Utility Storage - The Ideal Platform for Virtual and Cloud Computing

Server virtualization has transformed corporate IT -- companies have enjoyed major cost savings and have gained flexibility and efficiency. But this has also led to a proliferation of virtual machines and servers that threaten to overwhelm data movement and storage technologies. In this IDG Tech Dossier, learn how utility storage makes for massive consolidation, flexibility and scalability, so IT departments can reduce storage infrastructure and lower costs while improving their ability to respond to fast-changing needs of business units.Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.

White Paper

Virtualizing the Client - The HP Way

HP VirtualSystem delivers best-in-class virtualization, with integrated software, services, infrastructure, and management - all delivered as one proven solution.Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.

Webcast On Demand

Making Information Matter

Join us in the upcoming Hitachi virtual Forum on Wednesday, June 6th, at 8:30am PT / 11:30am ET and gain meaningful insights on how to maximize efficiency and reduce expenses. At the virtual forum you will learn about key solution strategies in our featured live video sessions from top leaders at Hitachi, like Miki Sandorfi, Chief Strategy Officer and industry experts, such as Ben Woo, VP WW Storage Systems at IDC.

Sponsor: Hitachi

See more White Papers | Webcasts

Ask a question

Ask a Question