retspen / webvirtcloud

WebVirtCloud is virtualization web interface for admins and users
1.63k stars 362 forks source link

local instance not connecting #575

Open stxrlite opened 1 year ago

stxrlite commented 1 year ago

image

nadermx commented 1 year ago

I am also running into this issue, Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied which seems to be connected to this issue, https://github.com/retspen/webvirtcloud/issues/504, which says to make sure libvirt is installed and running, which I also verified is up and running on my ubuntu20.04 instance

● libvirtd.service - Virtualization daemon
     Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2023-04-19 16:38:08 UTC; 23min ago
TriggeredBy: ● libvirtd-admin.socket
             ● libvirtd-ro.socket
             ● libvirtd.socket
       Docs: man:libvirtd(8)
             https://libvirt.org
   Main PID: 1879 (libvirtd)
      Tasks: 19 (limit: 32768)
     Memory: 47.5M
     CGroup: /system.slice/libvirtd.service
             ├─1879 /usr/sbin/libvirtd
             ├─2027 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvi>
             └─2028 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvi>

I also had an apparmor issue in the syslog when it came to libvirt,

libvirtd[29495]: Failed to read AppArmor profiles list '/sys/kernel/security/apparmor/profiles': Permission denied

And I was able to fix that by running

sudo aa-complain /etc/apparmor.d/usr.sbin.libvirtdsudo systemctl restart libvirtd

yet I also still get this when I create a local instance, so unsure what to try from here Edit:

Okay making more progress, seems this is also related to issue https://github.com/retspen/webvirtcloud/issues/240, and I messed up a few permission issues, so I will update if this solution works, but seems to be first testing to make sure you can run virsh list and get no error, if that still causes no error then try adding www-data user to libvirt group and reboot.