Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to setup a box with vagrant and libvirt with the following Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.define :test_vm do |test_vm|
    test_vm.vm.box = "test"
    test_vm.vm.network :private_network, :ip => '10.20.30.40'
  end

  config.vm.provider :libvirt do |libvirt|
    libvirt.driver = "qemu"
    libvirt.host = "localhost"
    libvirt.connect_via_ssh = false
    libvirt.username = "root"
    libvirt.storage_pool_name = "data"
  end
end

On RHEL 6.4 I get the following error

Error while connecting to libvirt: Error making a connection to libvirt URI qemu://localhost/system?no_verify=1:
Call to virConnectOpen failed: Unable to import client certificate /etc/pki/CA/cacert.pem

I tried to setup the cert like described here http://libvirt.org/remote.html#Remote_TLS_CA but this didnt change anything.

If i try to connect via ssh vagrant is able to slowly upload the box but afterwards I get the next failure

Call to virDomainCreateWithFlags failed: internal error Process exited while reading console log output: char device redirected to /dev/pts/20
qemu-kvm: -drive file=/local/data/virtualbox/root_1372773363.img,if=none,id=drive-virtio-disk0,format=qcow2: could not open disk image /local/data/virtualbox/root_1372773363.img: Invalid argument

On Fedora 17 or Arch Linux I cannot even install the vagrant-libvirt plugin, because it cannot find the libvirt library (lying under /usr/lib).

Does someone somehow manage to get vagrant working with libvirt or is the libvirt plugin still to alpha?

TIA && have a nice day!

Basti

share|improve this question

I too had this same issue. To fix it I had to essentially follow this guide : http://wiki.libvirt.org/page/TLSSetup

Note that the guide has multiple steps and it is LONG. Its not an "easy" fix though once you have the CAcert/key HostCert/key and ClientCert/key all in place, with the correct permissions and the correct ownership, everything works as expected.

thanks for reporting this and I hope this helps.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .