Using CentOS Live to build virtual machines

My current favorite virtualization environment on Red Hat is KVM, so I wind up building a lot of RHEL clone images in my spare time. Here’s some brief notes on using the CentOS Live DVD for that purpose.

The latest CentOS 6.4 Live DVD has a install to disk option that makes it great for spinning up new images for later cloning. It was possible to install from early Live CDs as far back as CentOS 5, but as one article put it, with “some assembly required”.

After doing a fresh install from the Live DVD I usually remove any package groups (using “yum groupremove groupname groupname groupname” — get a full listing with “yum grouplist”) that I won’t need in order to save disk space.

Here’s a list:

"Additional Development" "Debugging Tools" "Dial-up Networking Support" "Directory Client" "E-mail server" "FCoE Storage Client" "Graphics Creation Tools" "Java Platform" "KDE Desktop" "NFS file server" "Office Suite and Productivity" "Print Server" "Printing client" "Scientific support" "Storage Availability Tools"

In some cases the list may be different, depending upon what features will be needed for the specific task set for the machine. For the most part my current testing on RHEL 6 only involves server software so I try to trim down the desktop apps to a minimum.

Although I hate to admit it NetworkManager is being used on most of my laboratory machines, so I often find myself re-installing the NetworkManager-gnome package after stripping out the groups listed above. I’m still not sure which of the groups have that as a dependency, but for now it’s easy enough just to add NetworkManager back in than to waste time finding out.

When creating KVM images I usually make a blank qcow2 disk file with qemu-img before firing up the Virtual Machine Manager.

qemu-img create -f qcow2 newimage.img 12G

During machine setup I’ll choose that image and make sure the device type is virtio (the current default for VMM).

Cloning of machines is done with virt-clone. Occasionally I’ll use virt-viewer installed on a client (like my Windows laptop from work) to manage running machines, but I usually stick to ssh consoles for that kind of work.

This entry was posted in System Administration, Systems Analysis on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).