libvirtd requires restart to function

  • Done
  • quality assurance status badge
Details
3 participants
  • Josselin Poiret
  • Ludovic Courtès
  • Christian Miller
Owner
unassigned
Submitted by
Christian Miller
Severity
normal
C
C
Christian Miller wrote on 15 Jun 2023 00:40
(name . bug-guix@gnu.org)(address . bug-guix@gnu.org)
4qRpCOZqo2dCWoe2W8nMf5XUDKSGU1z6Bzbk0o4V1AIE9buOePdVIXvQVbJD583fZMcSx_Tca37t-kuAG6todLdJAa5dLbayxVsnvebZSs0=@proton.me
Currently libvirtd does not work without running "sudo herd restart libvirtd". Upon starting virt-manager I can't connect to the socket but if I restart libvirtd it works fine.

I tested the 1.4.0 image in a VM and there is no issue. After that I did a guix pull and reconfigured the system and I have the same issue again in the VM.
Attachment: file
L
L
Ludovic Courtès wrote on 15 Jun 2023 14:37
(name . Christian Miller)(address . miller.christian@proton.me)(address . 64073@debbugs.gnu.org)
87ttv8x5ne.fsf@gnu.org
Hi,

Christian Miller <miller.christian@proton.me> skribis:

Toggle quote (8 lines)
> Currently libvirtd does not work without running "sudo herd restart
> libvirtd". Upon starting virt-manager I can't connect to the socket
> but if I restart libvirtd it works fine.
>
> I tested the 1.4.0 image in a VM and there is no issue. After that I
> did a guix pull and reconfigured the system and I have the same issue
> again in the VM.

Are there any hints in /var/log/messages as to what goes wrong with
libvirtd when it is first started?

I suspect it’s getting started “too early”.

Thanks,
Ludo’.
C
C
Christian Miller wrote on 16 Jun 2023 22:44
libvirtd requires restart to function
(name . 64073@debbugs.gnu.org)(address . 64073@debbugs.gnu.org)
UudC9AwPmARDdZ3cSUTcE7SlFGz2JQjAcTkviK04JjSBDcR5YcevXjEFX5bUDLwC41Wpi1BYVUBlsZ_aWgtI1AhhV6bJQaOk1B_2mFI-WBY=@proton.me
Hi,

there is not an error message upon starting it but by stopping it:
Jun 14 23:52:18 localhost shepherd[1]: Stopping service libvirtd...
Jun 14 23:52:18 localhost libvirtd: 157: error : virGDBusGetSystemBus:99 : internal error: Unable to get system bus connection: Could not connect: No such file or directory

I have added the command output of "grep -i libvirt /var/log/messages" as attachment.

NOTE: That permission denied error on the ISO is happening since I copied /etc/libvirt from my old system. I have 10+ VMs and thought this works as well as of re importing every vm.

PS:
I wanted to create a VM to not taint logs but since I upgraded the VM I just have a black screen. It was a Guix VM installed through the installer with GNOME. I ran guix pull and added spice, libvirt and virtlog to the config. After guix system reconfigure config.scm I know have a black screen upon logging in to the system. This was only after reconfiguring the system. Before it worked normally. I used the ISO that reports a permission denied error in the logs I attached. GDM works fine but after logging it is just a black screen. Also my mouse cursor changes from a arrow pointer to the default cross cursor from x11. I guess something is broken on latest?

Best Regards
Christian Miller
Attachment: log.txt
J
J
Josselin Poiret wrote on 17 Jun 2023 18:02
87352q5b7d.fsf@jpoiret.xyz
Hi Christian,

Christian Miller via Bug reports for GNU Guix <bug-guix@gnu.org> writes:

Toggle quote (6 lines)
> Hi,
>
> there is not an error message upon starting it but by stopping it:
> Jun 14 23:52:18 localhost shepherd[1]: Stopping service libvirtd...
> Jun 14 23:52:18 localhost libvirtd: 157: error : virGDBusGetSystemBus:99 : internal error: Unable to get system bus connection: Could not connect: No such file or directory

Seems that dbus is needed for libvirt, but it is not listed as a
requirement for the shepherd service. I don't use libvirt, but would
you be able to test the following patch?

Best,
--
Josselin Poiret
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCgAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmSN2QYQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5FhcaihPuC/oDR30qZacyWvFEUc9mToJ0m01d1OeuuIGH
2D4qwjxru5PHFRpwntOKhV2Eb2v4i8OVMD6IslifPQVXhQStmIfp+ouubN3HD8Yr
3al5qLbmSvK4Anog3Goe4bIhm9yKL4H3YQX9Z56r1j/5f4GkMa6/sXAaulsjzss2
Vc3fkGF+BCOmVq3taGaTX1qCjppN4J7vcDK0H4dccUHWZO8Dxvl4s1+G2JFnMOJ8
q68ACNvhTpDDlWI1TFYn9dbq10/dJDtneharRSurMcGwSWfAzxCHhBMVlhAbHPay
PhHO/q3TsoXuj79iEyeAJs+rk4Yy4epA9NumchGWTEfBFcZ3XIl5SC+MXD5ivgDl
KoxXCeLszToCFgZG0GH/Gzy2MiGfChOnH6oA1+UGDa2h7FBfNGlf3eoWCeG6Kea4
M32NcVwdak23M848y/L/VkDA6xmGTUUqkNbNwVlWQlTkBtOgSnoSdEzIDvwIzY4k
CwhqETtrUA84Nc2wojAlELzQ+dXQPSM=
=bIN3
-----END PGP SIGNATURE-----

J
J
Josselin Poiret wrote on 17 Jun 2023 18:03
[PATCH] services: libvirt: Add requirement on dbus.
d5192bda805d820536158fe306f635aac0e3cfa9.1687017783.git.dev@jpoiret.xyz
From: Josselin Poiret <dev@jpoiret.xyz>

* gnu/services/virtualization.scm (libvirt-shepherd-service): Add requirement
on dbus.
---
gnu/services/virtualization.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index 880557915c..506f5a7ab6 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -478,6 +478,7 @@ (define (libvirt-shepherd-service config)
(list (shepherd-service
(documentation "Run the libvirt daemon.")
(provision '(libvirtd))
+ (requirement '(dbus-system))
(start #~(make-forkexec-constructor
(list (string-append #$libvirt "/sbin/libvirtd")
"-f" #$config-file
--
2.40.1
C
C
Christian Miller wrote on 19 Jun 2023 21:29
libvirtd requires restart to function
(name . 64073@debbugs.gnu.org)(address . 64073@debbugs.gnu.org)
JdQy7-V_gSWNJoZgCkIbK0dGEtavs4nd0PrTAMSkvTAMAjaQ1B5epY94jpz0RXcq1I4VYmY73FWN9S4mBUgBcBTjjySKcg8nzMsFmhtsnSI=@proton.me
Hello,

I tested your patch and it works. With the patch virt-manager does instantly connect without any manual interference.

Since this is the first time I did this, just to be sure I did everything correctly, I list how I tested it.

I cloned the git repository
I created a file called libvirtd.patch with your contents
git apply libvirtd.patch
guix shell -D guix --pure
./bootstrap
./configure --localstatedir=/var
make
make check (had 2 errors, authenticate and something else)
after that I executed "sudo -E ./pre-inst-env guix system reconfigure ~/guix/system.cm"
I rebooted the system and launched virt-manager which directly connected.

Best Regards,
Christian Miller
J
J
Josselin Poiret wrote on 20 Jun 2023 14:21
87ttv2494l.fsf@jpoiret.xyz
Hi Christian,

Christian Miller via Bug reports for GNU Guix <bug-guix@gnu.org> writes:

Toggle quote (15 lines)
> I tested your patch and it works. With the patch virt-manager does instantly connect without any manual interference.
>
> Since this is the first time I did this, just to be sure I did everything correctly, I list how I tested it.
>
> I cloned the git repository
> I created a file called libvirtd.patch with your contents
> git apply libvirtd.patch
> guix shell -D guix --pure
> ./bootstrap
> ./configure --localstatedir=/var
> make
> make check (had 2 errors, authenticate and something else)
> after that I executed "sudo -E ./pre-inst-env guix system reconfigure ~/guix/system.cm"
> I rebooted the system and launched virt-manager which directly connected.

Great! Thanks for going the extra mile testing this, I didn't know how
familiar you were with the Guix development process. We could also
advertise the simpler `guix time-machine` with the branches from [1],
although processing the new patch is not instantaneous (and I don't
think bug reports are scanned for patches).

In any case, I'll try to push it ASAP with some other changes!


Best,
--
Josselin Poiret
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCgAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmSRmcoQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5Fhcaih6eC/9B+avOFq2S5YThBYpCgM57puEM4v/jYl39
a6HxfkwD1g5QLMU+ikPOpGwizCZSSaQHupK8lCGIAYINYWWwuwcu+Rk3oC99RE3F
gvG1W4LfdjXkmarbaNdROUYA6sXm+AsmdvLofsXRlkiui2Eo1Tq0DzVU4EagN7F3
IP0w4munoNf8eavGs3e2EAcwPfWa/4h1Mnc247QJFWdJLbpEzy222fGVw8SZI60Y
kPRLENEhXs+yOkqc2aAnc0HEdOSm7e5B6ztC4KuTa3CdCeLuQc/jKE7M+lQxyOzW
Jmf6HdqgCvxxZ60ArRXcGubugak5Cm8alqNFiZXLYjUpwwM9CcvGdCVaoTEbkter
22NL6n9fbGy7CplPoJ+kVDFpaMoltZXcYG9FF9xyKEz0XeAq1XJVi4qObxKjJ6Tm
WJMFg7A7ARro8IXFz5+13vWA9yHuzPGSFV/lrrd0ucKPT/sAp9YeVqE4wCgCUdrG
vjBsrn38KZLA6QVMNxQbc9TgrOZ1iOE=
=Os50
-----END PGP SIGNATURE-----

J
J
Josselin Poiret wrote on 7 Jul 2023 21:48
87fs5z7bb4.fsf@jpoiret.xyz
Hi Christian,

Josselin Poiret <dev@jpoiret.xyz> writes:

Toggle quote (8 lines)
> Great! Thanks for going the extra mile testing this, I didn't know how
> familiar you were with the Guix development process. We could also
> advertise the simpler `guix time-machine` with the branches from [1],
> although processing the new patch is not instantaneous (and I don't
> think bug reports are scanned for patches).
>
> In any case, I'll try to push it ASAP with some other changes!

Pushed as 612399df3edcbe4d1b1da784bd23440398d27454, closing.

Best,
--
Josselin Poiret
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCgAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmSoa/8QHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5FhcaijhEDACtkyqb94+MeF6/+EdcS/Ebu8Er9RLxT50E
TMeCItuzY7W2dZXlPqeVeurWU3u5AMQQZt7wA/rocszQuive54pHLwBsPh+aMzX3
skEkekNLPylOwW9HnQBQLnUTIovvYq+sl3b2AiOKHJNopuuD9iFwqKT21se4YOkj
i6Sq26Zik196jSBMRe19g7lW3JC3XIqZQBTlQFnNBmdgXerAqoGlpcJqCdRmckt2
yINQZmPlaUs3x6pOPeW1g6LghHY7XhHh0HpbtMSbsXqF3wLTwtxXVFYYYssejY4v
KMq9HdiNXCXA4P5fXHhFDkOABZjm0ZlXNNSY/9haa+ug5Qk1b5thrXomlPJZJ+GD
eXMpkS4qMAlY8ia8xFPRvk10N4MWX79fB8Zky25DqydmEeWF2CciYC2OMVRIkZB9
1WcKW9AwvynoaFPYM5chTPdtFb69YAdAvaFo+Cbdrmb0wzFrZ99pc12Y9XyrcDCC
9l4HVlJks6cE2i8HG3eJt2uGsyS97m4=
=ld6I
-----END PGP SIGNATURE-----

Closed
?