Cannot start VM on 18.04, "Error making a connection to libvirt URI"

Bug #1771430 reported by Joseph Long
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
vagrant-libvirt (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I installed Vagrant (=2.0.2+dfsg-2ubuntu8) from apt on 18.04, and it appears the default provider is libvirt (vagrant-libvirt=0.0.43-2). I made a new Vagrantfile with "vagrant init" and changed the box in the Vagrantfile to "config.vm.box = "ubuntu/bionic64"" before running "vagrant up". This is what I got:

$ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
#<Thread:0x0000559b4b374628@/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:in `block (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:in `call'
        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:in `block 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:in `run'
        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:in `block 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:in `call'
        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:in `call'
        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:in `call'
        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:in `to_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:in `initialize'
         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:in `block 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:in `new'
         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:in `connection'
/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/jdl/.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/jdl/.ssh/id_rsa:
Call to virConnectOpen failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in vagrant-libvirt (Ubuntu):
status: New → Confirmed
Revision history for this message
ugmoe2000 (ericpulvino) wrote :

Have you installed the vagrant-libvirt plugin from the same user?
i.e. vagrant plugin install vagrant-libvirt

It's only when you do this that you'll be able to drive libvirt VMs AFAIK.

Revision history for this message
Pavel P (pavel-mushroom) wrote :

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

Revision history for this message
Edie Zhang (ezhang) wrote :

Which version of virtualbox do you use? I found only virtualbox-5.2 works. I got the same problem with virtualbox-6.0

Revision history for this message
Abelardo (abelardolg) wrote :

Hi there,
When I run the following command:

vagrant plugin install vagrant-libvirt

I got the error which is shown at the attached screenshot.

Using:
Distributor ID: Ubuntu
Description: Ubuntu 19.10
Release: 19.10
Codename: eoan

What's wrong?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.