Vagrant error with libvirt

1

I'm trying to set up vagrant for the first time in my life while following a tutorial. I'm using the VVCW box because I want to work with WordPress with it. So I downloaded the zip file and unzip it on a folder at my /home and didn't change the default.yml file.

That is the result: (I'm on a Xubuntu 18.04)

fabio@thinkpad:~/Vagrant/vccw$ vagrant up

Bringing machine 'vccw.test' up with 'libvirt' provider... #<Thread:0x000055ef7b1cc6c0@/usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/batch_action.rb:71 run> terminated with exception (report_on_exception is true): Traceback (most recent call last): 25: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/batch_action.rb:82:inblock (2 levels) in run' 24: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:in action' 23: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:incall' 22: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/environment.rb:592:in lock' 21: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/machine.rb:202:inblock in action' 20: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/machine.rb:227:in action_raw' 19: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:inrun' 18: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in busy' 17: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:inblock in run' 16: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in call' 15: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:incall' 14: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/builtin/config_validate.rb:25:in call' 13: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:incall' 12: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/builtin/box_check_outdated.rb:31:in call' 11: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:incall' 10: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/builtin/call.rb:52:in call' 9: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:170:into_app' 8: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:170:in new' 7: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:20:ininitialize' 6: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:20:in map' 5: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:20:inblock in initialize' 4: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:90:in finalize_action' 3: from /usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:90:innew' 2: from /usr/share/rubygems-integration/all/gems/vagrant-libvirt-0.0.43/lib/vagrant-libvirt/action/create_networks.rb:26:in initialize' 1: from /usr/share/rubygems-integration/all/gems/vagrant-libvirt-0.0.43/lib/vagrant-libvirt/driver.rb:40:inconnection' /usr/share/rubygems-integration/all/gems/vagrant-libvirt-0.0.43/lib/vagrant-libvirt/driver.rb:43:in rescue in connection': Error while connecting to libvirt: Error making a connection to libvirt URI qemu:///system?no_verify=1&keyfile=/home/fabio/.ssh/id_rsa: (VagrantPlugins::ProviderLibvirt::Errors::FogLibvirtConnectionError) Call to virConnectOpen failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory Error while connecting to libvirt: Error making a connection to libvirt URI qemu:///system?no_verify=1&keyfile=/home/fabio/.ssh/id_rsa: Call to virConnectOpen failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory

I just tried with another box and the same error happened.

Someone can help me? Thanks a lot!

Edit-1: looking for the error elsewhere, I just installed vagrant-libvirt plugin.

fabio@thinkpad:~/Vagrant/teste$ vagrant plugin install vagrant-libvirt Installing the 'vagrant-libvirt' plugin. This can take a few minutes... Installed the plugin 'vagrant-libvirt (0.0.43)'!

But when I did vagrant up, the same error was shown. :(

Edit-2: I followed instructions and did that:

$ vagrant plugin install vagrant-libvirt $ sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager $ sudo adduser fabio libvirt $ sudo adduser fabio libvirt-qemu $ sudo /etc/init.d/libvirtd restart

The error persists the same... :(

FabioB

Posted 2019-06-18T22:53:41.957

Reputation: 33

Answers

1

I just discovered the issue

I'm using VirtualBox version 6.0 from the repositories and the Vagrant version of the repositories isn't the latest version so the conflict.

So first I removed vagrant with

sudo apt --purge remove vagrant

sudo apt autoremove

After that I downloaded the final release of Vagrant from here and installed:

sudo dpkg -i vagrant_x.x.x_x86_64.deb

The installation was pretty fast and so I call for the Vagrant version to be sure it was installed:

vagrant version

I got this output:

Vagrant failed to initialize at a very early stage:

The plugins failed to initialize correctly. This may be due to manual modifications made within the Vagrant home directory. Vagrant can attempt to automatically correct this issue by running:

vagrant plugin repair

If Vagrant was recently updated, this error may be due to incompatible versions of dependencies. To fix this problem please remove and re-install all plugins. Vagrant can attempt to do this automatically by running:

vagrant plugin expunge --reinstall

Or you may want to try updating the installed plugins to their latest versions:

vagrant plugin update

Error message given during initialization: Unable to resolve dependency: user requested 'vagrant-libvirt (= 0.0.43)'

So I decided (actually remembered) to uninstall vagrant-libvirt:

sudo apt --purge remove vagrant-libvirt

Did a sudo apt update - just in case...

and vagrant up again.

And It works!!!!!!! :)

FabioB

Posted 2019-06-18T22:53:41.957

Reputation: 33

1Worked like a charm running Ubuntu 18.04, VirtualBox 6.0.10. Upgraded to Vagrant 2.2.5 and the problems disappeared. Many thanks FabioB! – dougB – 2019-07-20T01:32:42.797