Failing to start libvirtd.service

Hello,

I’m following the Manjaro Virt-manager wiki page.
My project with this is to use KVM to make a windows virtual machine for firmware updates and so on.

However, at the ‘Install virt-manager, qemu and all dependencies’ section, I have the following message :

    ~  sudo systemctl enable libvirtd.service                                                                                                                                                                                                                                 1 ✘ 
    ~  sudo systemctl start libvirtd.service                                                                                                                                                                                                                                    ✔ 
Job for libvirtd.service failed because the control process exited with error code.
See "systemctl status libvirtd.service" and "journalctl -xeu libvirtd.service" for details.
    ~  systemctl status libvirtd.service                                                                                                                                                                                                                                      1 ✘ 
× libvirtd.service - Virtualization daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Sat 2022-10-15 02:32:04 WEST; 15s ago
TriggeredBy: × libvirtd.socket
             × libvirtd-ro.socket
             × libvirtd-admin.socket
       Docs: man:libvirtd(8)
             https://libvirt.org
    Process: 5421 ExecStart=/usr/bin/libvirtd $LIBVIRTD_ARGS (code=exited, status=1/FAILURE)
   Main PID: 5421 (code=exited, status=1/FAILURE)
        CPU: 8ms

out 15 02:32:04 jorge-ms7c35 systemd[1]: libvirtd.service: Scheduled restart job, restart counter is at 5.
out 15 02:32:04 jorge-ms7c35 systemd[1]: Stopped Virtualization daemon.
out 15 02:32:04 jorge-ms7c35 systemd[1]: libvirtd.service: Start request repeated too quickly.
out 15 02:32:04 jorge-ms7c35 systemd[1]: libvirtd.service: Failed with result 'exit-code'.
out 15 02:32:04 jorge-ms7c35 systemd[1]: Failed to start Virtualization daemon.
    ~  journalctl -xeu libvirtd.service                                                                                                                                                                                                                                       3 ✘ 
░░ A stop job for unit libvirtd.service has finished.
░░ 
░░ The job identifier is 3232 and the job result is done.
out 15 02:32:04 jorge-ms7c35 systemd[1]: Starting Virtualization daemon...
░░ Subject: A start job for unit libvirtd.service has begun execution
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ A start job for unit libvirtd.service has begun execution.
░░ 
░░ The job identifier is 3232.
out 15 02:32:04 jorge-ms7c35 libvirtd[5421]: 2022-10-15 01:32:04.643+0000: 5421: info : libvirt version: 8.8.0
out 15 02:32:04 jorge-ms7c35 libvirtd[5421]: 2022-10-15 01:32:04.643+0000: 5421: info : hostname: jorge-ms7c35
out 15 02:32:04 jorge-ms7c35 libvirtd[5421]: 2022-10-15 01:32:04.643+0000: 5421: error : main:918 : Can't load config file: configuration file syntax error: /etc/libvirt/libvirtd.conf:142: expecting an assignment: /etc/libvirt/libvirtd.conf
out 15 02:32:04 jorge-ms7c35 systemd[1]: libvirtd.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ An ExecStart= process belonging to unit libvirtd.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
out 15 02:32:04 jorge-ms7c35 systemd[1]: libvirtd.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ The unit libvirtd.service has entered the 'failed' state with result 'exit-code'.
out 15 02:32:04 jorge-ms7c35 systemd[1]: Failed to start Virtualization daemon.
░░ Subject: A start job for unit libvirtd.service has failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ A start job for unit libvirtd.service has finished with a failure.
░░ 
░░ The job identifier is 3232 and the job result is failed.
out 15 02:32:04 jorge-ms7c35 systemd[1]: libvirtd.service: Scheduled restart job, restart counter is at 5.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ Automatic restarting of the unit libvirtd.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
out 15 02:32:04 jorge-ms7c35 systemd[1]: Stopped Virtualization daemon.
░░ Subject: A stop job for unit libvirtd.service has finished
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ A stop job for unit libvirtd.service has finished.
░░ 
░░ The job identifier is 3321 and the job result is done.
out 15 02:32:04 jorge-ms7c35 systemd[1]: libvirtd.service: Start request repeated too quickly.
out 15 02:32:04 jorge-ms7c35 systemd[1]: libvirtd.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ The unit libvirtd.service has entered the 'failed' state with result 'exit-code'.
out 15 02:32:04 jorge-ms7c35 systemd[1]: Failed to start Virtualization daemon.
░░ Subject: A start job for unit libvirtd.service has failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ A start job for unit libvirtd.service has finished with a failure.
░░ 
░░ The job identifier is 3321 and the job result is failed.

``

Mentioned in your output is one command to begin to troubleshoot
why the service will not start or why it fails.

journalctl -xeu libvirtd.service 

Clues might be in there.

Also: the wiki might not be entirely correct in that it tells you to run the commands:

systemctl enable libvirtd.service
systemctl start libvirtd.service

with sudo

Run them without sudo - you will get prompted for the password to give permission.

he did that as the output states.

I’d rather go over libvirt - ArchWiki and Virt-manager - ArchWiki and double-check if everything is installed.

Also check virtualization is enabled in bios.

don’t know what happened but there were major changes in the qemu-package in the past. i would recommend to install qemu-full and kvm from the package-manager. this works better.
it’s always a problem that some tutorials in the internet get outdated and the maintainer don’t bother for actuality.

@anon51566685 I tried to see if something was missing looking at the pages you proposed, but I can’t find any missing files. I double checked, and Virtualisation is enabled in the bios settings, as it was.
@Oli I tried, but it didn’t change the situation. It’s not missing files, I presume.

My suggestion : if this indeed is not a problem I created by mere incompetence, then the guide should be marked as outdated or not working or something else. I’ve spent quite a bit of time trying to get this to work, to no avail. I think future readers should be informed that there is a problem. [EDIT : I somehow managed to produce that error on my own, it turns out.]

If relevant for devs or others, you have here an Inxi output. In the same spirit, feel free to ask for more.

The only option I’m left with is to try Virtualbox instead of the legit, distro recommended, open source solution.

Did you even followed up on this error. Did you made changes to this file? The default file that is installed did not have this problem. Do you have pacnew files in this folder?

Nice catch. Didn’t even see that line. (Probably because there is so many useless lines with journalctl -x - stop using this.)

So this is yet another thread without full info what has been done…

Follow up on that error : no, I hadn’t saw it. Sorry for that, and thank you for pointing it out. After checking it, I have indeed made changes to the file.

After looking that up, I remember, following the Archlinux wiki page on virt-manager, that I uncommented the following lines in the configuration file :

unix_sock_group = 'libvirt'
...
unix_sock_rw_perms = '0770'

I’ve recommented the lines, will reboot, and check again. Oh, and no, no .pacnew files

Well, uncommenting these two lines shouldn’t cause that.

So, I recommented these lines, as stated, and after a reboot, I still got the same errors as before.

as @anon51566685 already suggested, these two lines can’t cause this error. There is a big syntax error in your file, that you need to fix it. Or replace the file with the original file from the package.

1 Like

What’s on the line 142? /etc/libvirt/libvirtd.conf:142

I have comments there.

@Slug
perhaps you inadvertently removed a # mark from the beginning of a line with no config option, but just text behind it …?

I had no comment on that line. I tried to comment it, reboot : same issues, alas.

If you don’t have a commend on line 142, you are not using the default /etc/libvirt/libvirtd.conf for the package libvirt.

The default libvirtd.conf has no uncommented lines and has from line 128 to 150 some information about authentication and nothing that should be uncommented.

So what config files are you using? Why are you not using the default?

1 Like

i would uninstall and reinstall it. from here it sound as a broken installation and it’s just digging what might or might not be the issue.

I removed and reinstalled following packages :

[2022-10-15T18:17:52+0100] [ALPM] installed libvirt (1:8.8.0-1)
[2022-10-15T18:17:52+0100] [ALPM] installed radvd (2.19-1)
[2022-10-15T18:17:52+0100] [ALPM] upgraded manjaro-pulse (20221002-1 -> 20221015-2)
[2022-10-15T18:09:50+0100] [ALPM] removed libvirt (1:8.8.0-1)
[2022-10-15T18:09:50+0100] [ALPM] removed libvirt-glib (4.0.0-2)
[2022-10-15T18:09:50+0100] [ALPM] removed libvirt-python (1:8.8.0-1)
[2022-10-15T18:09:50+0100] [ALPM] removed virt-install (4.1.0-1)
[2022-10-15T18:09:50+0100] [ALPM] removed virt-manager (4.1.0-1)

Now, systemctl status libvirtd.service outputs the folowing :

● libvirtd.service - Virtualization daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled)
     Active: active (running) since Sat 2022-10-15 18:20:53 WEST; 12s ago
TriggeredBy: ● libvirtd-ro.socket
             ● libvirtd.socket
             ● libvirtd-admin.socket
       Docs: man:libvirtd(8)
             https://libvirt.org
   Main PID: 5291 (libvirtd)
      Tasks: 19 (limit: 32768)
     Memory: 22.6M
        CPU: 126ms
     CGroup: /system.slice/libvirtd.service
             └─5291 /usr/bin/libvirtd --timeout 120

out 15 18:20:53 jorge-ms7c35 systemd[1]: Starting Virtualization daemon...
out 15 18:20:53 jorge-ms7c35 systemd[1]: Started Virtualization daemon.

Thank you all for your patience and your efforts. Keep up the good work!

1 Like

every single line in that file is either empty
or starts with a # (hash mark)
In other words: everything is commented - there can not even be a syntax error
If there is a syntax error, you introduced it.

… but now it’s fixed by reinstalling that file …

I suppose you are right! However, I do not remember having changed anything else than the lines I mentioned. Should be me and my fat fingers, or something else. Either way, I’m glad reinstalling the files solved the problem.