Failed to acquire pid file : /var/local/run/libvirt/qemu/driver.pid

ziomario

Member
Joined
Apr 24, 2020
Messages
79
Reaction score
5
Credits
670
Hello.

I'm running Debian bookworm on my ARM Chromebook,model "xe303c12" and I've recompiled the kernel to enable KVM,so now my system sounds like this :

Code:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm

$ uname -a
Linux chromarietto 5.4.244-stb-cbe
#8 SMP PREEMPT Sat Aug 19 22:19:32 UTC 2023 armv7l GNU/Linux

$ uname -r
5.4.244-stb-cbe

$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

$ qemu-system-arm --version
QEMU emulator version 5.1.0 (v5.1.0-dirty)
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers

$ python3 --version
Python 3.11.2

I have installed libvirt 9.7.0,qemu 5.1 and virt-manager from source code with the final goal to be able to connect qemu,kvm and libvirt together to virtualize FreeBSD 13.2 for arm 32 bit. If you ask me why I've recompiled everything from source code,my answer will be complicated,but in short terms,for some unknown reason, it reports an error like this :

Code:
"Warning : Failed to set up UEFI /
The Libvirt version does not support UEFI /
Install options are limited"

So,I went for the most complicated route : compiling everything from scratch.
Below I pasted the whole procedure that I've followed,so you can understand well what's wrong.

Code:
$ apt build-dep libvirt

$ git clone https://github.com/libvirt/libvirt.git
Cloning into 'libvirt'...

$ cd libvirt
$ meson setup build
$ ninja -C build
$ ninja -C build install

$ which virsh
/usr/local/bin/virsh

$ which libvirtd
/usr/local/sbin/libvirtd

$ apt install libgtk-3-dev libpulse-dev libgbm-dev libspice-protocol-dev \
libspice-server-dev libusb-1.0-0-dev libepoxy-dev libfdt-dev

$ git clone -b v5.1.0 http://git.qemu.org/qemu.git

$ cd qemu-v5.1.0

$ git submodule add -f https://git.kernel.org/pub/scm/utils/dtc/dtc.git dtc

$ ./configure --disable-werror --target-list=arm-softmmu \
--enable-opengl --enable-gtk --enable-kvm --enable-guest-agent \
--enable-spice --audio-drv-list="oss pa" --enable-libusb \
--enable-trace-backend=simple --enable-debug

$ make

$ make install

$ git clone https://github.com/virt-manager/virt-manager.git

$ apt install gobject-introspection libosinfo-1.0-0 libosinfo-1.0-dev \
gir1.2-libosinfo-1.0 libvirt-glib-1.0-dev

$ cd virt-manager
$ ./setup.py configure --prefix=/usr/local
$ sudo ./setup.py install

$ sudo usermod -a -G libvirt root
$ sudo usermod -a -G libvirtd root
$ sudo usermod -a -G libvirt-qemu libvirt-qemu
$ sudo usermod -a -G libvirt marietto
$ sudo adduser libvirt-qemu
$ sudo groupadd --system libvirt
$ sudo groupadd --system libvirt-qemu
$ sudo newgrp libvirt-qemu
$ newgrp libvirt

$ /usr/local/sbin# libvirtd &
[1] 2875

$ /usr/local/sbin# virtqemud &

info : libvirt version: 9.7.0 info :
hostname: chromarietto error : virPidFileAcquirePathFull:409
Failed to acquire pid file : /var/local/run/libvirt/qemu/driver.pid
Resource temporarily unavailable error : virStateInitialize:672 :
Initialization of QEMU state driver failed
Failed to acquire pid file : /var/local/run/libvirt/qemu/driver.pid
Resource temporarily unavailable error : daemonRunStateInit:617 :
Driver state initialization failed

$ /usr/local/sbin# ps ax | grep libvirt
2875 pts/0    Sl     0:00 libvirtd

$ /usr/local/sbin# ps ax | grep virtqemu
nothing


If I do the opposite way :


$ /usr/local/sbin# virtqemud &

$ /usr/local/sbin# ps ax | grep virtqemu
3041 pts/0    Sl     0:00 virtqemud

$ /usr/local/sbin# libvirtd &

info : libvirt version: 9.7.0 info :
hostname: chromarietto
error : virPidFileAcquirePathFull:409
Failed to acquire pid file : /var/local/run/libvirt/qemu/driver.pid
Resource temporarily unavailable
virStateInitialize:672 : Initialization of QEMU state driver failed
Failed to acquire pid file : /var/local/run/libvirt/qemu/driver.pid
Resource temporarily unavailable daemon
RunStateInit:617 : Driver state initialization failed

$ /usr/local/sbin# ps ax | grep virtqemu
3041 pts/0    Sl     0:00 virtqemud

$ /usr/local/sbin# ps ax | grep libvirt
nothing

In short terms : when I launch libvirt and then virtqemu,the first one does not close itself,but the second one does it ; when I launch virtqemud and then libvirt,the first one does not close itself,but the second one does it ; so,these two processes are not compatible with each other,but they should run both,otherwise virt-manager will not work at all and I will not be able to run any virtual machine.
 
Last edited:


can you say what virtqemud is used for? is it specific to the arm or maybe debian 12 version? from: https://www.libvirt.org/manpages/virtqemud.html
The virtqemud program is a server side daemon component of the libvirt virtualization management system.

It is one of a collection of modular daemons that replace functionality previously provided by the monolithic libvirtd daemon.
that makes it sound like it should be one or the other.

i ask in part because i have used virt-manager with just libvirt successfully on mx linux 21 x86_64 which is based on debian 11.
 
ok. I didn't launch virtqemud. This is what I did :

Code:
marietto@chromarietto:~$ libvirtd &

[1] 2083

marietto@chromarietto:~$ virt-manager

The error is :

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

error from service: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed:
Action org.libvirt.unix.manage is not registered

Libvirt URI is: qemu:///system

Traceback (most recent call last):
File "/usr/local/share/virt-manager/virtManager/connection.py", line 923, in _do_open
self._backend.open(cb, data)
File "/usr/local/share/virt-manager/virtinst/connection.py", line 171, in open
conn = libvirt.openAuth(self._open_uri,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/libvirt.py", line 147, in openAuth
raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: error from service: GDBus.Error:org.freedesktop.PolicyKit1.
Error.Failed: Action org.libvirt.unix.manage is not registered
 
I'm on the libvirt group :

Code:
# cat /etc/group | grep libvirt

libvirt:x:995:marietto,linux,root
 
Code:
error from service: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Action org.libvirt.unix.manage is not registered
i'll look around on my system to see if i can figure out what that refers to, but in the meantime have you run a web search for the error?
 
yes,I'm (gl)ooking for the cause and a resolution. It seems that the fixes found in various websites is to add my user account to the libvirt group,but I have already did that.
 
Last edited:
Action org.libvirt.unix.manage is not registered
on my system that looks like it might refer to the file
/usr/share/polkit-1/actions/org.libvirt.unix.policy
which has a section like this:
Code:
    <action id="org.libvirt.unix.manage">
      <description>Manage local virtualized systems</description>
      <message>System policy prevents management of local virtualized systems</message>
      <defaults>
        <!-- Any program can use libvirt in read/write mode if they
             provide the root password -->
        <allow_any>auth_admin_keep</allow_any>
        <allow_inactive>auth_admin_keep</allow_inactive>
        <allow_active>auth_admin_keep</allow_active>
      </defaults>
    </action>
do you see something similar on yours?
 
I'm going to check. In the meantime,give a look at this :

Code:
marietto@chromarietto:~$ virsh --connect qemu+ssh://chromarietto/system


The authenticity of host 'chromarietto (192.168.1.6)' can't be established.

ED25519 key fingerprint is SHA256:
This key is not known by any other names.

Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

marietto@chromarietto's password: 


error: failed to connect to the hypervisor

error: error from service: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Action org.libvirt.unix.manage is not registered
 
yes,I have that file and the section you mentioned, here :

/usr/local/share/polkit-1/actions/org.libvirt.unix.policy

it is on /usr/local because I have installed libvirt from the source code on /usr/local.
 
maybe here:
Code:
marietto@chromarietto:~$ libvirtd &
when i check ps aux, i get:
Code:
ps aux | grep virt
root        2581  0.0  0.2 1616116 37028 ?       Sl   Aug26   0:17 /usr/sbin/libvirtd -d
user        56533  2.6  0.6 964108 100064 ?       Ssl  11:28   0:00 /usr/bin/python3 /usr/bin/virt-manager
so it looks like it probably needs that -d option to run as daemon. from man libvirtd:
Code:
       -d, --daemon

       Run as a daemon & write PID file.
 
Code:
marietto@chromarietto:~$ libvirtd -d &

[1] 2690


marietto@chromarietto:~$ virsh --connect qemu+ssh://chromarietto/system

marietto@chromarietto's password: 


error: failed to connect to the hypervisor

error: error from service: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Action org.libvirt.unix.manage
is not registered
 
i forgot to additionally point out that libvirtd is running as root in case that might make a difference.
 
Code:
marietto@chromarietto:~$ sudo libvirtd -d &
[1] 2850

marietto@chromarietto:~$ ps aux | grep virt
 
root      2858  1.8  2.7 320812 28444 ?        Sl   16:54   0:00 libvirtd -d
marietto  2903 50.0  0.1   6844  1604 pts/0    S+   16:55   0:00 grep virt

marietto@chromarietto:~$ virsh --connect qemu+ssh://chromarietto/system

marietto@chromarietto's password:
error: failed to connect to the hypervisor
error: End of file while reading data: virt-ssh-helper: could not proxy traffic: 
Cannot recv data: Connection reset by peer: Input/output error

new error,even more intriguing ?
 
Last edited:
i understand from the commands that you probably want to use that virsh ssh connect, but i have no experience with that to be able to help. does virt-manager work?
 
virt-manager gives this error :

Code:
error from service: GDBus.Errorrg.freedesktop.PolicyKit1.Error.Failed: Action org.libvirt.unix.manage is not registered

even if I run libvirtd -d as root
 
Code:
marietto@chromarietto:~$ busctl | grep virt

:1.92                                              2858 libvirtd        root             :1.92         sessi
on-c2.scope          c2      -
 

Members online


Top