Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] QEMU/KVM and Libvirt (virtqemud not found) [s6] (Read 9419 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

[SOLVED] QEMU/KVM and Libvirt (virtqemud not found) [s6]

[SOLVED]

Hi everyone,

I've been trying to create a virtual machine recently, but keep getting the same error when trying to connect to QEMU/KVM.

Code: [Select]
Unable to connect to libvirt qemu:///system.

Failed to connect socket to '/var/run/libvirt/virtqemud-sock': No such file or directory

Libvirt URI is: qemu:///system

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 922, in _do_open
    self._backend.open(cb, data)
  File "/usr/share/virt-manager/virtinst/connection.py", line 153, in open
    conn = libvirt.openAuth(self._open_uri,
  File "/usr/lib/python3.9/site-packages/libvirt.py", line 148, in openAuth
    raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: Failed to connect socket to '/var/run/libvirt/virtqemud-sock': No such file or directory

I've nstalled the libvirt and libvirt-s6 packages.

I also added the bundle with
Code: [Select]
sudo s6-rc-bundle-update add default libvirtd
So it should be enabling itself on boot, right?

I'm honestly pretty stumped at this, has anyone been able to fix this issue?


EDIT: I was able to fix this issue by running the command:
Code: [Select]
sudo s6-rc-bundle-update change default libvirtd-srv

and by starting it with:
Code: [Select]
sudo s6-rc -u change libvirtd-srv

Re: QEMU/KVM and Libvirt (virtqemud not found) [s6]

Reply #1
I can't recall that error, but know for a fact KVM runs like a charm on Artix; I've used it with s6 and runit, but the init system should not be relevant.

What you can try:

1. Add your user to groups libvirt and kvm:
Code: [Select]
sudo usermod -a -G kvm artist
sudo usermod -a -G libvirt artist

2. Update the following 4 lines in /etc/libvirt/libvirtd.conf
Code: [Select]
unix_sock_group = "libvirt"
unix_sock_ro_perms = "0777"
unix_sock_rw_perms = "0770"
unix_sock_admin_perms = "0700"

3. Then reboot.

artist

Re: QEMU/KVM and Libvirt (virtqemud not found) [s6]

Reply #2
Well like the error says, "/var/run/libvirt/virtqemud-sock" doesn't exist. I'm not sure what exactly is supposed to create that though. There's also virtlockd and virtlogd services. I can't remember if they're needed. I know I've used libvirt in the past fine so unless they changed something the scripts should work.

Re: QEMU/KVM and Libvirt (virtqemud not found) [s6]

Reply #3
Quote
1. Add your user to groups libvirt and kvm
I already added myself to kvm andlibvirt beforehand, so I didn't need to do this.

Quote
2. Update the following 4 lines in /etc/libvirt/libvirtd.conf
I didn't do this before, so I edited the config and rebooted, but saw no change.

Maybe something could be stopping it from running? I'm not really too sure, is there any way to verify that it's running?

Re: QEMU/KVM and Libvirt (virtqemud not found) [s6]

Reply #4
You can run:
sudo s6-svstat /run/s6-rc/servicedirs/libvirtd-srv
sudo s6-svstat /run/s6-rc/servicedirs/virtlogd-srv

What exact actions did you perform to install and run kvm?

What command do you run when you get the error?

What output do you get from:
ls -l /var/run/libvirt/*virt*sock*

This is what I get:
Code: [Select]
srwx------ 1 root libvirt 0 Nov 26 18:52 /var/run/libvirt/libvirt-admin-sock
srwxrwx--- 1 root libvirt 0 Nov 26 18:52 /var/run/libvirt/libvirt-sock
srwxrwxrwx 1 root libvirt 0 Nov 26 18:52 /var/run/libvirt/libvirt-sock-ro
srwx------ 1 root root    0 Nov 26 18:52 /var/run/libvirt/virtlogd-admin-sock
srwx------ 1 root root    0 Nov 26 18:52 /var/run/libvirt/virtlogd-sock

Re: QEMU/KVM and Libvirt (virtqemud not found) [s6]

Reply #5
The output of sudo s6-svstat /run/s6-rc/servicedirs/libvirtd-srv is:
Code: [Select]
down (exitcode 0) 17268 seconds, ready 17268 seconds

And the output of sudo s6-svstat /run/s6-rc/servicedirs/virtlogd-srv is:
Code: [Select]
up (pid 729) 17275 seconds

I installed Qemu + virt-manager and all of their dependencies with
Code: [Select]
sudo pacman -S virt-manager qemu vde2 iptables-nft dnsmasq bridge-utils openbsd-netcat edk2-ovmf swtpm
I'm using virt-manager to run kvm.

the output of ls -l /var/run/libvirt/*virt*sock* is
Code: [Select]
srwx------ 1 root root 0 Nov 26 17:24 /var/run/libvirt/virtlogd-admin-sock
srwx------ 1 root root 0 Nov 26 17:24 /var/run/libvirt/virtlogd-sock

So, it seems that the libvirt service is down for some reason, and some things are missing from /var/run/libvirt.

Re: QEMU/KVM and Libvirt (virtqemud not found) [s6]

Reply #6
As root run: libvirtd --verbose
The output should show what the underlying error/problem is of the libvirtd service not starting.

Re: QEMU/KVM and Libvirt (virtqemud not found) [s6]

Reply #7
Thanks for the help, but it seems that this issue was happening because I didn't add the libvirtd-srv bundle and start it, only the libvirtd bundle.

Thank you very much for helping me realise this, I probably wouldn't have realised without your help.

Re: QEMU/KVM and Libvirt (virtqemud not found) [s6]

Reply #8
Good to hear it works.
Never give up ;-)
artist

Re: [SOLVED] QEMU/KVM and Libvirt (virtqemud not found) [s6]

Reply #9
Thanks for the help, but it seems that this issue was happening because I didn't add the libvirtd-srv bundle and start it, only the libvirtd bundle.

Thank you very much for helping me realise this, I probably wouldn't have realised without your help.

Adding the libvirtd bundle and starting it surely should have worked. libvirtd is a pipeline that starts both libvirtd-srv and libvirtd-log.