qemu guest agent shutdown

Having issues with your DietPi installation or found a bug? Post it here.
Posts: 3
Joined: Wed Nov 10, 2021 1:15 pm

Re: qemu guest agent shutdown

Post by rpopken »

Just installed Debian Bullseye from latest net install.
Only installed system utilities and ssh server.
Shutdown and reboot work straight out of the box.

>> apt install -t buster-backports qemu-guest-agent
  • apt update
  • apt install -t buster-backports qemu-guest-agent
Got the message the agent is already the latest version ( (1:5.2+dfsg-11+deb11u1). VM does still not shut down.

>> dbus missing?
  • systemctl unmask systemd-logind -- Removed /etc/systemd/system/systemd-logind.service.
  • apt install dbus
  • systemctl start systemd-logind -- VM shuts down immediately when stopped from host.

I wondered if the dbus package is installed by default at the newly installed Debian Bullseye

Code: Select all

x@debian200:~$ dpkg -s dbus
Package: dbus
Status: install ok installed
Priority: standard
Section: admin
Installed-Size: 199
Maintainer: Utopia Maintenance Team <pkg-utopia-maintainers@lists.alioth.debian.org>
Architecture: amd64
Multi-Arch: foreign
Version: 1.12.20-3
Provides: dbus-system-bus (= 1.12.20-3), default-dbus-system-bus
Depends: dbus-bin (= 1.12.20-3), dbus-daemon (= 1.12.20-3), dbus-system-bus-common (>= 1.12.20-3), libc6 (>= 2.14), libdbus-1-3 (= 1.12.20-3), libexpat1 (>= 2.1~beta3), libsystemd0
Pre-Depends: init-system-helpers (>= 1.54~)
Suggests: default-dbus-session-bus | dbus-session-bus
 /etc/default/dbus 0d0f25a2f993509c857eb262f6e22015
 /etc/init.d/dbus d78b20b35de983cf6f1475dcf8cb21a1
Description: simple interprocess messaging system (system message bus)
 D-Bus is a message bus, used for sending messages between applications.
 Conceptually, it fits somewhere in between raw sockets and CORBA in
 terms of complexity.
 D-Bus supports broadcast messages, asynchronous messages (thus
 decreasing latency), authentication, and more. It is designed to be
 low-overhead; messages are sent using a binary protocol, not using
 XML. D-Bus also supports a method call mapping for its messages, but
 it is not required; this makes using the system quite simple.
 It comes with several bindings, including GLib, Python, Qt and Java.
 This package provides a fully-functional D-Bus system bus with activation
 support, used for communication between system services, and depends on
 most of the other components of the reference implementation of D-Bus.
 To provide a complete D-Bus session bus, install one of the packages
 that implement the dbus-session-bus virtual package, such as
 dbus-user-session. The recommended implementation is indicated by
 the default-dbus-session-bus virtual package.
Homepage: https://dbus.freedesktop.org/

Seems like the dbus package is missing in the standard install of DietPi?
User avatar
Posts: 6525
Joined: Sat Nov 16, 2019 12:49 am

Re: qemu guest agent shutdown

Post by Joulinar »

Seems like the dbus package is missing in the standard install of DietPi?
Yes the package is not available by design/default.

On new installation, it could set as required using dietpi.txt

Code: Select all

 ​# Unmask (enable) systemd-logind service (including dbus), which is masked by default on DietPi 
On running systems, dbus would need to be installed manually.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
Site Admin
Posts: 3534
Joined: Sat Nov 18, 2017 6:21 pm

Re: qemu guest agent shutdown

Post by MichaIng »

I still wonder why this agent started to rely on systemd-logind while not adding any dependency package and while there are of course many systems out there without systemd but a different init system, like SysV. There must be a way to tell the agent to not use systemd-logind. The question is also how it invokes the shutdown. E.g. calling shutdown without arguments on a systemd driven system will invoke it as schedule to shutdown in X seconds, which requires systemd-logind, and fails without it running of dbus installed (systemd-logind requires dbus). The correct invocations to shutdown "now" is shutdown now or simply poweroff. So probably they changed something about that without thinking about the implicit dependency on systemd-logind :?.
Post Reply