I guess I’m a glutton for punishment, because after successfully compiling libvirt 0.10.1 on CentOS 6.3, I came back to try it again on Ubuntu (my first attempt was not successful). Here is the process I followed to get libvirt 0.10.1 compiled and running on Ubuntu 12.04.
I started with a clean install of Ubuntu 12.04, then installed KVM and Open vSwitch per these instructions. At the end of those instructions, I had an Ubuntu Server 12.04.1 system running KVM and libvirt 0.9.8.
Once I verified the system was working as expected (I ran a few
virsh commands to check for errors), I followed these steps:
As with the CentOS effort, I first downloaded the tarball for libvirt 0.10.1 from the libvirt.org HTTP server.
Next, I extracted the files using this command:
apt-get, I installed the following packages: libxml2-dev, libgnutls-dev, libyajl-dev, libnl-dev, pkg-config, libdevmapper-dev, libcurl4-gnutls-dev, and python-dev. (Note that you can omit the libcurl4-gnutls-dev package if you don’t want ESX support in libvirt.) Just like with the CentOS procedure, I determined the necessary list of packages by repeatedly running the
With all the dependencies now satisfied, I ran the
configurecommand from the extracted libvirt-0.10.1 directory. I specified particular directories because that matched where the existing binaries were on the system (there’s probably an easier way). I’ve line-wrapped the command here for readability:
The above command results in a libvirt that supports KVM, OpenVZ, LXC, etc., including ESX. You’d have to add the
--with-xenparameter to the
configurecommand to include support for Xen; that might also change the list of dependencies that need to be installed first.
configurecommand completed successfully, it was very straightforward:
Finally, I restarted libvirtd with
initctl stop libvirt-binand
initctl start libvirt-bin. I probably could have used
initctl restart, but I wanted to see the shutdown and startup separately. In this case, the libvirt daemon shutdown and started back up cleanly and without any errors.
gunzip -c libvirt-0.10.1.tar.gz | tar xvf -
./configure --prefix=/usr --localstatedir=/var \ --sysconfdir=/etc --with-esx=yes
make make install
From there, I was able to run
libvirtd --version or
virsh --version to verify that the system was, in fact, running libvirt 0.10.1.
The one big difference between this effort and the CentOS effort earlier was that Open vSwitch was installed and working on this system, so I ran
ovs-vsctl show to double-check the OVS configuration and operation. I noted that the system had re-created the default bridge, so I got rid of that with these two commands:
virsh net-destroy default virsh net-autostart --disable default
virbr0 from the OVS configuration, leaving only the OVS bridge that I created during the KVM+Open vSwitch installation earlier.
Now that my test system has both OVS and a version of libvirt that supports OVS, the next steps will be to conduct some more in-depth libvirt+OVS tests and document the results. Stay tuned!