1

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 <gpiccoli@canonical.com> 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!

  • Could you track "journalctl -f" while issuing a "systemctl restart libvirtd" that way more what is going on can be captured. Add that output to your question please. – Christian Ehrhardt Apr 8 '20 at 8:41
  • Thanks! I add this information in the question! – Susan Apr 8 '20 at 12:45
  • Please provide version of Ubuntu and is this some hosted computer or VPS (which sometimes have similar issues)? You seem to be missing iptables, which provides ebtables. – Doug Smythies Apr 8 '20 at 14:51
  • Hi, "group=kvm" would need to be "group = kvm" I think, but also this is really odd you clearly should not need to set this - it might even fail due to that. In 99.9% of the cases you are fine with all of qemu.conf being commented out and keeping the defaults. Otherwise I agree to Doug, which version of Ubuntu does this run on and which *tables do you have installed - maybe report dpkg -l '*iptables*' '*ebtables*' as well? – Christian Ehrhardt Apr 9 '20 at 4:40
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.