How to compile virt-manager on CentOS, Fedora or RHEL

Question: I would like to install the latest virt-manager which is available from its official website. How can I compile and install virt-manager from the source on [CentOS, Fedora or RHEL]?

virt-manager is a popular GUI-frontend for libvirt, allowing users to create and manage guest virtual machines on libvirt-supported hypervisors such as QEMU/KVM or Xen. virt-manager can control a host-local hypervisor as well as remote host's hypervisor (over SSH), giving users a location-transparent management interface for virtual machines. For remote desktop access on guest operating systems, virt-manager offers integrated remote desktop sessions via VNC and Spice.

While virt-manager is available in the base repositories of any Red Hat based distributions, the pre-built virt-manager tends to fall behind the latest release available from the official website. For example, CentOS 7 and Fedora 22 offer virt-manager version 1.2.1, while the latest virt-manager release is already version 1.3.2, as of this writing.

If you want to try out the latest features of virt-manager, you can download its source and build it yourself. Here is how to compile virt-manager on CentOS, Fedora or RHEL. If you want to build virt-manager on Debian based system, refer to this tutorial instead.

Note that since the latest virt-manager relies on GTK3, you cannot install it on CentOS/RHEL 6 or earlier.

Before you start, you need to uninstall the existing virt-manager if you have already installed it from your distro's repositories.

$ sudo yum remove virt-manager

Here we are going to build virt-manager's RPM packages from its latest source code, and install the RPMs.

First, set up the build environment, and generate virt-manager's RPM packages as follows. On Fedora, you can replace yum with dnf if you prefer.

$ sudo yum install rpm-build intltool
$ curl -O
$ tar -xf virt-manager-1.3.2.tar.gz
$ cd virt-manager-1.3.2
$ python rpm

After successful build, the RPM packages will be found in ~/rpmbuild/RPMS/noarch. Go to this directory.

$ cd ~/rpmbuild/RPMS/noarch

You will find two RPM packages for virt-manager: virt-manager-XXX.rpm and virt-manager-common-XXX.rpm.

Install virt-manager-common-XXX.rpm first, and then install virt-manager-XXX.rpm.

$ sudo yum install virt-manager-common-1.3.2-1.NNNNNNN.noarch.rpm
$ sudo yum install virt-manager-1.3.2-1.NNNNNNN.noarch.rpm

At this point you should be able to launch virt-manager.

$ virt-manager

Download this article as ad-free PDF (made possible by your kind donation): 
Download PDF

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

Leave a comment

Your email address will not be published. Required fields are marked *