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

232 messages · Page 1 of 1 (latest)

brave coral
#

@brave coral mind helping here?

sleek whale
brave coral
upper meteor
#

I know qemu and virt manager but not gentoo lol

#

seems wrong placement of files

#

or permissions

sleek whale
upper meteor
#

did you install qemu and enable libvirtd.service?

#

actually idk if you have systemd because you're on gentoo, so do you have systemd? lol

#

you can test it with virsh -c qemu:///system

#

.aw libvirt

mild grailBOT
upper meteor
#

Sorry for delayed response, went to sleep

upper meteor
#

I use systemd so not sure what your issue is

sleek whale
#

I kinda wanna stick to the Gentoo wiki

upper meteor
#

good idea

sleek whale
upper meteor
#

try virsh -c qemu:///session to test user level

#

i think your libvert daemon is not working or not connected to qemu somehow

#

sorry, if you were on arch I could help more, but idk anything about gentoo

sleek whale
#

I found this:

  • Stopping libvirtd ...
  • start-stop-daemon: no matching processes found [ ok ]
  • Starting libvirtd ...
upper meteor
#

sorry idk what that means 😬 must be how openrc daemonizes things

sleek whale
gray bone
#

ok hold on

brave coral
#

I'm on gentoo using kvm qemu

brave coral
#

are you trying to use virt-manager?

gray bone
#

they are
also could you try it on normal qemu
just to see if it works or not

sleek whale
gray bone
#

error?

sleek whale
#

Someone on reddit told me it's a permissions error

sleek whale
gray bone
sleek whale
brave coral
#

have you done this:
usermod -aG libvirt <your username>
rc-service libvirtd restart
log out and back in to get the new permissions

sleek whale
#

These are my groups btw wheel video kvm libvirt input fluffy

brave coral
#

ok it works here as long as I start libvirtd.service

#

sorry not OpenRC though

sleek whale
brave coral
#

it's weird though it only shows one of my VMs

gray bone
#

@sleek whalecould you try changing auth_unix_rw = "none" toauth_unix_rw = "polkit"

brave coral
#

I have two

gray bone
#

and restart libvirtd

sleek whale
gray bone
#

also you need polkit to be installed

gray bone
sleek whale
#

Oh I do have one

brave coral
#

ok it's weird none of my gnome boxes vms show up in virt-manager

sleek whale
#

Still isn't working

gray bone
sleek whale
#

File: /run/libvirt
Size: 260 Blocks: 0 IO Block: 4096 directory
Device: 19h/25d Inode: 1317 Links: 11
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-08-13 21:40:28.389999985 -0500
Modify: 2022-08-13 21:40:28.863333302 -0500
Change: 2022-08-13 21:40:28.863333302 -0500
Birth: -

gray bone
#

has the right perms

sleek whale
#

File: /var/run/libvirt/
Size: 260 Blocks: 0 IO Block: 4096 directory
Device: 19h/25d Inode: 1317 Links: 11
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-08-13 21:40:28.389999985 -0500
Modify: 2022-08-13 21:40:28.863333302 -0500
Change: 2022-08-13 21:40:28.863333302 -0500
Birth: -
fluffy@gentoo ~ $

gray bone
sleek whale
#

And than restart libvirt?

gray bone
#

yeah

#

always restart the daemon when doing changes to its config

brave coral
#

ok it was working I was just looking at system vms not user level vms

sleek whale
#

I did find this

  • Stopping libvirtd ...
  • start-stop-daemon: no matching processes found [ok ]
  • Starting libvirtd ... [ ok ]
gray bone
#

did it work?

sleek whale
#

Nope

gray bone
#

did you compile libvirt with policykit?

sleek whale
#

In my use flags?

gray bone
#

yes

sleek whale
#

It's done compiling

#

Didn't work

brave coral
#

what did you compile?

gray bone
#

what's openrc's equivalent to systemctl status?

sleek whale
sleek whale
brave coral
#

why, did it not have policykit use flag before?

gray bone
#

could you show me the status?

sleek whale
brave coral
#

ok crashed

gray bone
#

yep

#

is there a more verbose log?

sleek whale
gray bone
sleek whale
gray bone
#

what's in /var/log

sleek whale
#

boot dmesg emerge.log lastlog portage/ wtmp Xorg.0.log.old
cups/ emerge-fetch.log .keep lightdm/ sandbox/ Xorg.0.log

gray bone
#

could you change log_level to log_level=4 in libvirtd

#

and check if the directory now exists

sleek whale
#

Done

brave coral
#

looks like it uses virtlogd

sleek whale
#

I'm gonna reboot

#

Brb

gray bone
#

is it running?

sleek whale
#

It shows libvirtd crashed

sleek whale
#

virtlogd [ started ]

gray bone
#

status?

sleek whale
#

Yep

brave coral
#

usually logging in openrc is defined in output_log, error_log, output_logger, error_logger variables in the init scripts, or conf.d, and in this case none of them are set

sleek whale
#

It shows this for libvirtd

virtlogd [ started ]

brave coral
#

what happens when you run virtlogd from the command line

#

I cant test this I am on systemd

sleek whale
#

No output

#

Nvm

gray bone
sleek whale
#

fluffy@gentoo ~ $ doas virtlogd
doas (fluffy@gentoo) password:
2022-08-14 14:48:11.508+0000: 4163: info : libvirt version: 8.2.0
2022-08-14 14:48:11.508+0000: 4163: info : hostname: gentoo
2022-08-14 14:48:11.508+0000: 4163: error : virPidFileAcquirePath:402 : Failed to acquire pid file '/run/virtlogd.pid': Resource temporarily unavailable
fluffy@gentoo ~ $

brave coral
#

I'm trying tom figure out how logging works here lol

#

on systemd it would be so easy

#

the service would just tell us

gray bone
#

just journalctl
or the service's status

sleek whale
gray bone
#

journalctl is systemd

sleek whale
#

Ohh

gray bone
#

wait

#

actually nvm

brave coral
#

not sure if you already have a system logger setup

brave coral
#

what branch are you tracking ~amd64?

sleek whale
#

Ofc

gray bone
sleek whale
gray bone
gray bone
sleek whale
#

What do I add?

gray bone
#

uncomment rc_logger="YES"

sleek whale
#

alr

#

Do I need to reboot?

gray bone
#

idk
i would reboot tho if i were you

sleek whale
#

Alr lemme finish this episode of rick and morty

brave coral
#

first is rc_log_path set

sleek whale
brave coral
#

nevermind
wiki says

The log will be saved at /var/log/rc.log by default.

sleek whale
#

This is the log

brave coral
#

whats the status now

gray bone
#

f, not enough info

brave coral
#

still crashed?

sleek whale
gray bone
#

@sleek whale could you show me your qemu.conf btw
in /etc/libvirt

brave coral
#

stop the service and try starting it with this command /usr/sbin/libvirtd

#

as root

#

shawn@gentoo /etc $ sudo /usr/sbin/libvirtd
2022-08-14 16:49:34.062+0000: 16754: info : libvirt version: 8.2.0
2022-08-14 16:49:34.062+0000: 16754: info : hostname: gentoo
2022-08-14 16:49:34.062+0000: 16754: warning : virStorageBackendVolOpen:1656 : ignoring dangling symlink '/home/shawn/.steampath'

#

it just starts right up for me

#

maybe that will show why it crashes

sleek whale
gray bone
#

hmm

#

does qemu group exist?

sleek whale
#

Nope

brave coral
#

._cfg0000 means you need to run dispatch-conf

sleek whale
#

--- /etc/libvirt/libvirt.conf 2022-08-12 13:33:43.086642900 -0500
+++ /etc/libvirt/._cfg0000_libvirt.conf 2022-04-01 05:23:38.000000000 -0500
@@ -15,4 +15,4 @@

These can be used in cases when no URI is supplied by the application

(@uri_default also prevents probing of the hypervisor driver).

-uri_default = "qemu:///system"
+#uri_default = "qemu:///system"

(1 of 28) -- /etc/libvirt/libvirt.conf
q quit, h help, n next, e edit-new, z zap-new, u use-new
m merge, t toggle-merge, l look-merge:

brave coral
#

gentoo has packages that install those groups, you might need qemu use flag

brave coral
#

use

#

all of the libvirt ones, hit 'u' for use

sleek whale
#

--- /etc/libvirt/libvirtd.conf 2022-08-14 09:42:21.208390293 -0500
+++ /etc/libvirt/._cfg0000_libvirtd.conf 2022-08-14 09:33:11.958410753 -0500
@@ -78,7 +78,7 @@

activation.

This is restricted to 'root' by default.

-unix_sock_group = "libvirt"
+#unix_sock_group = "libvirt"

Set the UNIX socket permissions for the R/O socket. This is used

for monitoring VM status only

@@ -88,7 +88,7 @@

Default allows any user. If setting group ownership, you may want to

restrict this too.

-unix_sock_ro_perms = "0777"
+#unix_sock_ro_perms = "0777"

Set the UNIX socket permissions for the R/W socket. This is used

for full management of VMs

@@ -101,7 +101,7 @@

If not using PolicyKit and setting group ownership for access

control, then you may want to relax this too.

-unix_sock_rw_perms = "0770"
+#unix_sock_rw_perms = "0770"

Set the UNIX socket permissions for the admin interface socket.

@@ -117,7 +117,7 @@

This setting is not required or honoured if using systemd socket

activation.

-unix_sock_dir = "/run/libvirt"
+#unix_sock_dir = "/run/libvirt"

@@ -160,7 +160,7 @@

To restrict monitoring of domains you may wish to either

enable 'sasl' here, or change the polkit policy definition.

-auth_unix_ro = "none"
+#auth_unix_ro = "polkit"

Set an authentication scheme for UNIX read-write sockets.

@@ -176,7 +176,7 @@

is essential to change the systemd SocketMode parameter

back to 0600, to avoid an insecure configuration.

-auth_unix_rw = "polkit"
+#auth_unix_rw = "polkit"

Change the authentication scheme for TCP sockets.

@@ -392,7 +392,7 @@

WARNING: journald is the current output.

WARNING: USE OF THIS IS STRONGLY DISCOURAGED.

-log_level=4
+#log_level = 3

Logging filters:

A filter allows to select a different logging level for a given category

(2 of 28) -- /etc/libvirt/libvirtd.conf
q quit, h help, n next, e edit-new, z zap-new, u use-new
m merge, t toggle-merge, l look-merge:

brave coral
#

'u'

sleek whale
#

--- /etc/libvirt/qemu.conf 2022-08-13 21:34:58.313045399 -0500
+++ /etc/libvirt/._cfg0000_qemu.conf 2022-04-01 05:23:38.000000000 -0500
@@ -516,11 +516,11 @@

user = "+0" # Super user (uid=0)

user = "100" # A user named "100" or a user with uid=100

-user = "fluffy"
+#user = "root"

The group for QEMU processes run by the system instance. It can be

specified in a similar way to user.

-group = "kvm"
+#group = "root"

Whether libvirt should dynamically change file ownership

to match the configured user/group above. Defaults to 1.

(3 of 28) -- /etc/libvirt/qemu.conf
q quit, h help, n next, e edit-new, z zap-new, u use-new
m merge, t toggle-merge, l look-merge:

brave coral
#

'u'

#

oh

#

why did you edit that?

gray bone
#

theyre showing diff in patches

gray bone
#

and user

brave coral
#

just try it with the defaults first

#

I have not needed to change any of that

sleek whale
#

Still isn't working

gray bone
#

f

sleek whale
#

2022-08-14 15:21:48.063+0000: 4560: info : libvirt version: 8.2.0
2022-08-14 15:21:48.063+0000: 4560: info : hostname: gentoo
2022-08-14 15:21:48.063+0000: 4560: error : virNetworkObjAssignDefLocked:576 : operation failed: network 'default' already exists with uuid 6eec83e2-4dbd-40b5-808e-9afb37239fe5
2022-08-14 15:21:48.126+0000: 4560: error : virGetGroupID:842 : invalid argument: Failed to parse group 'qemu'
2022-08-14 15:21:48.126+0000: 4560: error : virStateInitialize:664 : Initialization of QEMU state driver failed: invalid
argument: Failed to parse group 'qemu'
2022-08-14 15:21:48.126+0000: 4560: error : daemonRunStateInit:604 : Driver state initialization failed

gray bone
#

does qemu group and user exist?

sleek whale
#

Nope

#

Lemme emerge that

brave coral
#

hold on a sec

#

acct-group/qemu-0-r1 pulled in by:
acct-user/qemu-0-r1 requires acct-group/qemu

acct-user/qemu-0-r1 pulled in by:
app-emulation/libvirt-8.2.0 requires acct-user/qemu

#

[ebuild R ] app-emulation/libvirt-8.2.0:0/8.2.0::gentoo USE="caps libvirtd nls policykit qemu udev virt-network -apparmor -audit -bash-completion -dtrace -firewalld -fuse -glusterfs -iscsi -iscsi-direct -libssh -libssh2 -lvm -lxc -nfs -numa (-openvz) -parted -pcap -rbd -sasl (-selinux) -verify-sig -virtualbox -wireshark-plugins -xen -zfs" 0 KiB

#

must be qemu flag?

#

so weird,

gray bone
#

very

brave coral
#

libvirt hard depends on acct-user/qemu

gray bone
#

you should see how many tabs i have opened rn

brave coral
#

emerge -1 acct-user/qemu acct-group/qemu

#

that should add those

#

but they should have been there already

sleek whale
#

I installed the acct-group/qemu package

gray bone
#

did it work?

sleek whale
#

Lemme add myself to it

brave coral
#

i wasnt in the qemu group but it wont hurt anything to add you

#

I am in the kvm and libvirt groups for some reason

gray bone
#

im only in libvirt group

brave coral
#

one thing you can do to reset all config files is use emerge option --oneshot and --noconfmem

#

--oneshot just allows you to re-emerge dependencies without adding it to your world file , and --noconfmem makes it ignore rules about preserving config files

#

you will still need to apply them with dispatch-conf afterwards though

gray bone
#

wait
was the failed to parse error b4 we changed qemu.conf back or after

brave coral
#

this is why I use FEATURES=buildpkg
because if I need to reemerge something without any use flag changes it's already a binary package on my disk

gray bone
#

did it work?

brave coral
#

still watching rick and morty

#

oh this might explain why those config files got changed

#

-Dqemu_user=$(usex caps qemu root)
-Dqemu_group=$(usex caps qemu root)

#

usex flag [true output] [false output] [true suffix] [false suffix]

#

if caps is enabled qemu, else root

#

caps is enabled by default though (IUSE=+caps)

#

oh no, nevermind you edited that config... fluffy

gray bone
#

yeah they edited qemu.conf

brave coral
#

fluffy is the name of my car

gray bone
#

im still kinda confused tho
cus if that error was b4 we switched back to default
why did it ask for qemu group instead of the group specified in their qemu.conf

sleek whale
#

I finished the last episode of season 5

gray bone
#

did it work?

sleek whale
gray bone
#

F

sleek whale
#

I got this error though

#

error: failed to connect to the hypervisorerror: Operation not supported: Cannot use direct socket mode if no URI is set

gray bone
gray bone
#

libvirt.conf

#

also shouldnt it be 2 slashes

#

nvm it's 3

sleek whale
#

I might've fixed it
libvirtd [ started ]

sleek whale
#

Unable to connect to libvirt qemu:///system.

internal error: Unable to get system bus connection: Could not connect: No such file or directory

Libvirt URI is: qemu:///system

#

Fixed it