Failed to connect socket to '/var/run/libvirt/libvirt-sock'

I have problem with libvirtd, the service is inactive even though I run systemctl start libvirtd.service.

I am member of libvirt and kvm

The output of systemctl status libvirtd is

libvirtd.service - Virtualization daemon
   Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Tue 2020-04-07 23:44:24 -04; 8s ago
     Docs: man:libvirtd(8)
           https://libvirt.org
  Process: 19508 ExecStart=/usr/sbin/libvirtd $libvirtd_opts (code=exited, status=0/SUCCESS)
 Main PID: 19508 (code=exited, status=0/SUCCESS)

And the error when I run others command like virsh list

error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock':  No such file or directory

The directory /var/run/libvirt/ does not contain the file libvirt-sock and I think that it is the principal problem, but i don't know the solution.

ls /var/run/libvirt
network  storage  virtlockd-sock  virtlogd-sock

I installed libvirt-daemon-system qemu-kvm libvirt-bin bridge-utils virt-manager qemu libvirt0.

I tried with systemctl enable libvirtd and systemctl enable libvirtd but is inactive.

Output of journalctl -f when i run systemctl restart libvirtd

abr 08 08:40:56 susan sudo[7195]: susan : TTY=pts/1 ; PWD=/home/susan ; USER=root ; COMMAND=/bin/systemctl restart libvirtd
abr 08 08:40:56 susan sudo[7195]: pam_unix(sudo:session): session opened for user root by (uid=0)
abr 08 08:40:56 susan systemd[1]: Starting Virtualization daemon...
abr 08 08:40:56 susan systemd[1]: Started Virtualization daemon.
abr 08 08:40:56 susan sudo[7195]: pam_unix(sudo:session): session closed for user root
abr 08 08:40:56 susan libvirtd[7198]: 2020-04-08 12:40:56.120+0000: 7225: info : libvirt version: 4.0.0, package: 1ubuntu8.15 (Guilherme G. Piccoli <[email protected]> Thu, 20 Feb 2020 13:07:33 -0300)
abr 08 08:40:56 susan libvirtd[7198]: 2020-04-08 12:40:56.120+0000: 7225: info : hostname: susan
abr 08 08:40:56 susan libvirtd[7198]: 2020-04-08 12:40:56.120+0000: 7225: error : virFirewallValidateBackend:193 : direct firewall backend requested, but /sbin/ebtables is not available: No existe el archivo o el directorio
abr 08 08:40:56 susan libvirtd[7198]: 2020-04-08 12:40:56.120+0000: 7225: error : virFirewallApply:916 : internal error: Failed to initialize a valid firewall backend
abr 08 08:40:56 susan libvirtd[7198]: 2020-04-08 12:40:56.128+0000: 7225: error : virConfParseValue:529 : configuration file syntax error: /etc/libvirt/qemu.conf:412: expecting a value
abr 08 08:40:56 susan libvirtd[7198]: 2020-04-08 12:40:56.128+0000: 7225: error : virStateInitialize:775 : Initialization of QEMU state driver failed: configuration file syntax error: /etc/libvirt/qemu.conf:412: expecting a value
abr 08 08:40:56 susan libvirtd[7198]: 2020-04-08 12:40:56.128+0000: 7225: error : daemonRunStateInit:849 : Driver state initialization failed

The line 412 in etc/libvirt/qemu.conf

group=kvm

Any solutions for this problem? Thanks!


Have you installed kvm? To install libivrt and kvm try running below

 sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system virtinst bridge-utils

 sudo systemctl enable libvirtd
 sudo systemctl start libvirtd

I noticed in your output missing ebtables. You can install them by running:

 sudo  apt-get install -y ebtables

Then restart the services. Hope this helps you.