hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.24k stars 4.43k forks source link

Vagrant fails to start due to missing /var/run/libvirt/virtnetworkd-sock-ro #12664

Open fabstao opened 2 years ago

fabstao commented 2 years ago

Vagrant version

vagrant -v
Vagrant 2.2.16

Host operating system

$ uname -a
Linux fabsfedpm1.yunefo.tech 5.15.16-200.fc35.x86_64 #1 SMP Thu Jan 20 15:38:18 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/os-release 
NAME="Fedora Linux"
VERSION="35 (Workstation Edition)"
ID=fedora
VERSION_ID=35
VERSION_CODENAME=""
PLATFORM_ID="platform:f35"
PRETTY_NAME="Fedora Linux 35 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:35"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f35/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=35
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=35
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation

Guest operating system

Can't boot the guests OSes

Vagrantfile

# Copy-paste your Vagrantfile here (but don't include sensitive information such as passwords, authentication tokens, or email addresses)
# -*- mode: ruby -*-
# vi: set ft=ruby :

ENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt'

Vagrant.configure("2") do |config|

  ##### DEFINE VM #####
  config.vm.define "debvm1" do |config|
  config.vm.hostname = "debvm1"
  config.vm.box = "debian/bullseye64"
  config.vm.box_check_update = false
  #config.vm.network "private_network", ip: "172.16.131.11"
  config.vm.provider :libvirt do |v|
    v.memory = 8192
    v.cpus = 3
    #v.qemu_use_session = false
    end
  end
end

Vagrant.configure("2") do |config|

  ##### DEFINE VM #####
  config.vm.define "debvm2" do |config|
  config.vm.hostname = "debvm2"
  config.vm.box = "debian/bullseye64"
  config.vm.box_check_update = false
  #config.vm.network "private_network", ip: "172.16.131.12"
  config.vm.provider :libvirt do |v|
    v.memory = 8192
    v.cpus = 3
    #v.qemu_use_session = false
    end
  end
end

Debug output

Debug: https://gist.github.com/fabstao/2b2fa5420180dcaf9996e83e0f250a0b

Expected behavior

What should have happened? Having two domains (VMs) running

Actual behavior

What actually happened?

Got error:

Call to virConnectListAllNetworks failed: Failed to connect socket to '/var/run/libvirt/virtnetworkd-sock-ro': No such file or directory

Steps to reproduce

  1. Create Vagrantfile as included
  2. run: vagrant up as regular user

References

No

surajssd commented 2 years ago

I was also facing this very issue and I am not sure what changed in recent updates.

I saw that this daemon was in an "inactive" state:

$ sudo systemctl status virtnetworkd
○ virtnetworkd.service - Virtualization network daemon
     Loaded: loaded (/usr/lib/systemd/system/virtnetworkd.service; disabled; vendor preset: disabled)
     Active: inactive (dead)
TriggeredBy: ● virtnetworkd.socket
             ○ virtnetworkd-ro.socket
             ○ virtnetworkd-admin.socket
       Docs: man:libvirtd(8)
             https://libvirt.org

So started and enabled it:

sudo systemctl enable --now virtnetworkd

Now it is working fine:

$ sudo systemctl status virtnetworkd
● virtnetworkd.service - Virtualization network daemon
     Loaded: loaded (/usr/lib/systemd/system/virtnetworkd.service; enabled; vendor preset: disabled)
     Active: active (running) since Mon 2022-01-31 12:09:16 IST; 9s ago
TriggeredBy: ● virtnetworkd-admin.socket
             ● virtnetworkd-ro.socket
             ● virtnetworkd.socket
       Docs: man:libvirtd(8)
             https://libvirt.org
   Main PID: 56078 (virtnetworkd)
      Tasks: 18 (limit: 18855)
     Memory: 3.7M
        CPU: 197ms
     CGroup: /system.slice/virtnetworkd.service
             └─56078 /usr/sbin/virtnetworkd --timeout 120

Jan 31 12:09:16 user systemd[1]: Starting Virtualization network daemon...
Jan 31 12:09:16 user systemd[1]: Started Virtualization network daemon.

Now vagrant up works for me.

fabstao commented 2 years ago

Thanks! Didn't work for me, now it is complaining about trying to use libvirt at all

christianbueno1 commented 2 years ago
[chris@fedora f36-vagrant]$ uname -a
Linux fedora 5.18.17-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 11 14:36:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[chris@fedora f36-vagrant]$ 

The same problem. Thanks @surajssd , that fix the problem.

sudo systemctl start virtnetworkd

or

sudo systemctl enable --now virtnetworkd
jonasbjork commented 1 year ago
[chris@fedora f36-vagrant]$ uname -a
Linux fedora 5.18.17-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 11 14:36:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[chris@fedora f36-vagrant]$ 

The same problem. Thanks @surajssd , that fix the problem.

sudo systemctl start virtnetworkd

or

sudo systemctl enable --now virtnetworkd

This also worked for me (Fedora36 Workstation)