Make sure to have
libvirt-dev package (or the development files otherwise somewhere in your include path)
The minimum supported version of libvirt is 1.2.2. Due to the API/ABI compatibility promise of libvirt, more recent versions of libvirt should work too.
Some features require a more recent version of libvirt. They are disabled by default. If you want to enable them, build using one of those additional tags (you need to use only the most recent one you are interested in):
go build -tags libvirt.1.2.14
OS Compatibility Matrix
To quickly see what version of libvirt your OS can easily support (may be outdated). Obviously, nothing below 1.2.2 is usable with these bindings.
|OS Release||libvirt Version|
|FC19||1.2.9 from libvirt.org/sources|
|Debian 8||1.2.9 from jessie|
|Debian 7||1.2.9 from wheezy-backports|
|Ubuntu 14.04||1.2.2 from trusty|
|Ubuntu 16.04||1.3.1 from xenial|
Previously there was support for libvirt 0.9.8 and below, however this is no longer being updated. These releases were tagged
Please fork and write tests.
Integration tests are available where functionality isn't provided by the test driver, see
Vagrantfile is included to run the integration tests:
vagrant upto provision the virtual machine
vagrant sshto login to the virtual machine
sudo su - and
go test -tags integration libvirt.