virt-manager is a GUI-based virtual machine manager which allows you to create and manage (local or remote) virtual machines and containers via libvirt APIs. It supports multiple hypervisors such as KVM, QEMU, Xen, as well as LXC containers. While virt-manager is available in most distros' base repositories, the pre-built virt-manager package always falls behind the latest releases available from the official website. For example, Ubuntu 15.10 and Debian 8 come with virt-manager 1.1, while the latest virt-manager is version 1.3.2.
If you want to try the latest and greatest features of virt-manager, you need to build and install it from the source. In this post, I show how to compile virt-manager on Debian, Ubuntu or Linux Mint. If you want to build virt-manager on Red Hat based distribution, refer to this tutorial instead.
Before you start, you need to uninstall the existing virt-manager if you have already installed it from your distro's repositories.
Next, set up the build environment for virt-manager and install any necessary prerequisites.
$ sudo apt-get install python-libvirt libgtk-3-dev libvirt-glib-1.0 gir1.2-gtk-vnc-2.0 gir1.2-spice-client-gtk-3.0 libosinfo-1.0 python-ipaddr gir1.2-vte-2.90 python-libxml2 python-requests
Finally, download the latest source and install it as follows.
$ tar -xf virt-manager-1.3.2.tar.gz
$ cd virt-manager-1.3.2
$ sudo python setup.py install
To launch virt-manager from the command line:
Here are solutions to various errors that you may encounter while building virt-manager from the source on a Debian-based distro.
1. ImportError: No module named libvirt
2. ImportError: No module named libxml2
3. ImportError: No module named requests
4. Error launching details: Namespace GtkVnc not available
5. Error launching details: Namespace SpiceClientGtk not available
6. ValueError: Namespace LibvirtGLib not available
7. ValueError: Namespace Libosinfo not available
8. ImportError: No module named ipaddr
9. Namespace Gtk not available: Could not open display: localhost:10.0
10. ImportError: cannot import name Vte
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.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!