libvirtd: failed to connect to socket after installation

Carlos Bilbao carlos.bilbao at amd.com
Wed Sep 7 15:28:17 UTC 2022


On 9/6/22 12:50, Carlos Bilbao wrote:

> On 8/30/22 15:34, Peter Krempa wrote:
>
>> On Tue, Aug 30, 2022 at 14:13:36 -0500, Carlos Bilbao wrote:
>>> Hello,
>>>
>>> I am trying to test some changes made to libvirt. I tried compiling and
>>> installing, following the available documentation, with:
>>>
>>> ninja -C build clean
>>> meson build --prefix=$HOME/usr
>>> ninja -C build -Dsystem=true
>> note that the '-Dsystem=true' argument is supposed to be used with
>> 'meson' as it sets up configure time options. This way it probably did
>> nothing.
> Noted, thanks!
>>> sudo ninja -C build install
>>>
>>> After doing this, I try to run virt-install and get the following 
>>> error on
>>> the active libvirtd daemon:
>>>
>>> Failed to connect socket to '/var/local/run/libvirt/virtqemud-sock': No
>>> such file or directory
>>>
>>> Indeed, that file does not exist:
>>>
>>> $ ls /var/local/run/libvirt/
>>> common  hostdevmgr  lockd  lxc  network  nwfilter nwfilter-binding  
>>> secrets
>>> storage
>> So the directory really looks like libvirtd/virtqemud or any other of
>> the libvirt daemons never ran.
>>
>> How did you start the daemons, did they log something?
>
> So, what I did this time was:
>
> $ ninja -C build clean
> $ meson build --reconfigure --prefix=$HOME/usr -Dsystem=true
> $ ninja -C build
> $ sudo ninja -C build install
> $ systemctl stop libvirtd
> $ systemctl start libvirtd
>
> but I still get:
>
> $ virt-install --name ubuntu-sev --boot 
> loader=/usr/share/OVMF/OVMF_CODE.fd,loader.readonly=yes,loader.type=pflash,nvram.template=/usr/share/OVMF/OVMF_VARS.fd,loader_secure=no 
> --vcpus 8 --memory 4096 --memtune hard_limit=16777216 --disk 
> pool=default,device=disk,size=32,format=raw --controller 
> type=scsi,model=virtio-scsi  --network bridge=virbr0,model=virtio 
> --controller type=virtio-serial --machine q35 --cpu host-passthrough 
> --cdrom /var/lib/libvirt/images/ubuntu.iso --osinfo 
> detect=on,require=on --launchSecurity sev,policy=0x00 --graphics none 
> --tpm none
> ERROR    Failed to connect socket to 
> '/var/local/run/libvirt/virtqemud-sock': No such file or directory
>
> and the daemon shows the same error:
>
> $ systemctl status libvirtd
> ○ libvirtd.service - Virtualization daemon
>      Loaded: loaded (/usr/local/lib/systemd/system/libvirtd.service; 
> enabled; vendor preset: enabled)
>      Active: inactive (dead) since Tue 2022-09-06 17:43:53 UTC; 1min 
> 57s ago
> TriggeredBy: ● libvirtd-admin.socket
>              ● libvirtd-ro.socket
>              ● libvirtd.socket
>        Docs: man:libvirtd(8)
>              https://libvirt.org
>     Process: 2272757 ExecStart=/usr/local/sbin/libvirtd $LIBVIRTD_ARGS 
> (code=exited, status=0/SUCCESS)
>    Main PID: 2272757 (code=exited, status=0/SUCCESS)
>       Tasks: 2 (limit: 32768)
>      Memory: 60.5M
>         CPU: 49ms
>      CGroup: /system.slice/libvirtd.service
>              ├─2760 /usr/sbin/dnsmasq 
> --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro 
> --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
>              └─2761 /usr/sbin/dnsmasq 
> --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro 
> --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
>
> Sep 06 17:41:04 host systemd[1]: Starting Virtualization daemon...
> Sep 06 17:41:04 host systemd[1]: Started Virtualization daemon.
> Sep 06 17:41:53 host libvirtd[2272757]: libvirt version: 8.7.0
> Sep 06 17:41:53 host libvirtd[2272757]: hostname: host
> Sep 06 17:41:53 host libvirtd[2272757]: Failed to connect socket to 
> '/var/local/run/libvirt/virtqemud-sock': No such file or directory
> Sep 06 17:41:53 host libvirtd[2272757]: End of file while reading 
> data: Input/output error
>
>>
>>> virt-install was working fine before started changing libvirt's 
>>> source code.
>>> I'm working with Ubuntu 22.04 LTS, virsh v8.7.0.
>> Generally the most straightforward way is to build distribution packages
>> from the tree and install them directly in your system because then you
>> avoid issues such as possibly having two libvirtd instances running and
>> such.
>
> Does libvirt have any script or tool to ease such process?
>
Answering to myself here, because I have made some progress but still have
to fix some blockings. Decided to use debhelper to build Debian packages
and test libvirt. Did:

$ sudo apt-get install debhelper dh-make
$ sudo dh_make --createorig -p libvirt-snp_1
$ dh_auto_configure --buildsystem=meson
$ dpkg-buildpackage -rfakeroot -us -uc -b

Notice that the option -b for dpkg-buildpackage is to avoid the Debian
package bureaucracy. But still, some checks fail for the package (see below
). I don't think this errors have anything to do with the code I modified,
but I will be happy to share a patch for reproduction.

Summary of Failures:

  76/255 libvirt / domaincapstest FAIL            1.65s   exit status 1
  97/255 libvirt / vircgrouptest FAIL            1.53s   exit status 1
105/255 libvirt / virhostcputest FAIL            1.50s   exit status 1
106/255 libvirt / virhostdevtest FAIL            1.50s   exit status 1
107/255 libvirt / viridentitytest FAIL            1.50s   exit status 1
108/255 libvirt / viriscsitest FAIL            1.49s   exit status 1
113/255 libvirt / virnetdevtest FAIL            1.47s   exit status 1
116/255 libvirt / virpcitest FAIL            1.46s   exit status 1
128/255 libvirt / fchosttest FAIL            1.37s   exit status 1
130/255 libvirt / vircaps2xmltest FAIL            1.36s   exit status 1
151/255 libvirt / virnetserverclienttest FAIL            1.28s   exit 
status 1
169/255 libvirt:syntax-check / 
TAB_in_indentation                             FAIL 0.88s   exit status 2
239/255 libvirt:syntax-check / 
prohibit_obj_free_apis_in_virsh                FAIL 0.39s   exit status 2
249/255 libvirt:syntax-check / 
trailing_blank                                 FAIL 0.28s   exit status 2


Ok:                 236
Expected Fail:      0
Fail:               14
Unexpected Pass:    0
Skipped:            5
Timeout:            0
dh_auto_test: error: cd obj-x86_64-linux-gnu && LC_ALL=C.UTF-8 
MESON_TESTTHREADS=192 meson test returned exit code 14
make: *** [debian/rules:18: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit 
status 2

Thanks!
Carlos


>
> Thanks in advance,
>
> Carlos
>



More information about the libvir-list mailing list