20131011 using centos live to build virtual machines - plembo/onemoretech GitHub Wiki

title: Using CentOS Live to build virtual machines link: https://onemoretech.wordpress.com/2013/10/11/using-centos-live-to-build-virtual-machines/ author: phil2nc description: post_id: 6515 created: 2013/10/11 10:35:37 created_gmt: 2013/10/11 14:35:37 comment_status: closed post_name: using-centos-live-to-build-virtual-machines status: publish post_type: post

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.

Copyright 2004-2019 Phil Lembo