Installing KVM with yum… and compiling Libvirt and Virt-manager

I want my N40L server to host virtual machines,so KVM will be my solution. It’s so easy to install in CentOS 6 with yum:

yum install qemu-kvm qemu-kvm-tools uml_utilities

I’ll need some tools to manage my virtual machines: virt-manager, virtinst and virt-viewer offered by RedHat Emerging Technology. These tools need the libvirt API (also offered by RedHat Emerging Technology) to interact with KVM. You can install all these packages with yum:

yum install libvirt virt-manager

And you’re done! … but I have one problem. Thanks to this post at Binary Bit Me blog, I found that the bridge compatibility mode (brcompat) is not longer needed if you use libvirt >= 0.9.11 but CentOS 6.3 offers you 0.9.10 version 😦 so why not compiling libvirt and virtual manager tools as well (maybe I can test it later)? It’s quick and easy using the README and INSTALL files.

— Libvirt 0.10.1 —

Download libvirt from the libvirt web site or with git. You’ll need some CentOS packages.

yum install gnutls-devel device-mapper-devel python-devel libnl-devel yajl-devel libxml2-devel
./configure --prefix=/usr --with-yajl
make
make install
ldconfig

Update: 26/11/2012

One thing was missing.

I tried to use virt-manager as a non-root (e.g oneadmin user for OpenNebula) user and the following error appeared: “Unable to connect to libvirt: authentication failed: Authorization requires authentication but no agent is available.”. If you want any other user than root can use libvirt, you’ll have to:

  • create a libvirt group
  • add that user to the libvirt group
  • modify the libvirtd.conf so unix sockets are owned by libvirt group

You have all the information in the Antarktikos blog.

Updated: 29/12/2012.

libxml2-devel is also needed. Thank you Kolmis.

— Virtinst —

Download virtinst from Virt Manager web site, and use python to install them.

python setup.py install

— VirtManager 0.9.4 —

yum install intltool PackageKit-gtk-module
wget http://virt-manager.org/download/sources/virt-manager/virt-manager-0.9.4.tar.gz
tar xvfz virt-manager-0.9.4.tar.gz
cd virt-manager-0.9.4
./configure --prefix=/usr
make
make install

— Virt Viewer —

yum install spice-gtk-devel gtk-vnc-devel
wget http://virt-manager.org/download/sources/virt-viewer/virt-viewer-0.5.4.tar.gz
tar xvfz virt-viewer-0.5.4.tar.gz
cd virt-viewer-0.5.4
./configure --prefix=/usr
make
make install

I’ll try to generate rpm packages but I’ve no more time today 😉

And here’s my virt-manager running!.
In a few days… OpenNebula will run in my N40 Lab.

Advertisements

3 thoughts on “Installing KVM with yum… and compiling Libvirt and Virt-manager

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s