Running fwupd from within a container on Balena OS

This might be quite a specific usecase, but we have a fleet of devices in the field which need a firmware update on their Network-card.
We received a .cab file from the manufacturer that can be flashed using fwupdmgr.
fwupdmgr is not available in Balena OS of course, so we’re trying to install and run it from within a privileged container with host dbus access.

This however seems to fail. fwupdmgr need its daemon to be running, but starting the daemon in the container throws an error:
another service has claimed the dbus name org.freedesktop.fwupd
Which seems invalid as there are no other fwupd instances running…

Hence we’re wondering if anyone has done something similar before or can help us out getting this to work.

Many thanks in advance!

Hi, thanks for reporting. Can you share a simple setup to generate this error? We can try to reproduce.

Yes, a very easy way to reproduce this is to deploy a standard ubuntu image to a Generic x86_64 device with dbus support:

services:
  ubuntu:
    image: ubuntu:noble
    labels:
      io.resin.features.dbus: '1'
    environment:
      DBUS_SYSTEM_BUS_ADDRESS: unix:path=/host/run/dbus/system_bus_socket
    privileged: true

Then, inside the container, install fwupd:

apt update && apt install -qqy fwupd

Finally, running fwupdmgr --version it will tell you that it failed to connect to it’s daemon:

Error registering authentication agent: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PolicyKit1 was not provided by any .service files (g-dbus-error-quark, 2)
Failed to connect to daemon: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.fwupd was not provided by any .service files

Hence, when trying to start the daemon:

/usr/libexec/fwupd/fwupd

It will try to start but respond with a name collision:

07:21:52.876 FuPluginUefiCapsule  cannot find default ESP: No valid 'EspLocation' specified in /etc/fwupd/fwupd.conf
07:21:53.597 FuPluginIntelMe      failed to get public key using /fpf/OemCred: generic failure [0xb]
07:21:53.640 FuMain               fwupd 1.9.31 ready for requests (locale C.UTF-8)
07:21:53.643 FuMain               another service has claimed the dbus name org.freedesktop.fwupd

And then I’m stuck…

Thanks for the setup. I am able to reproduce the error but don’t know how to proceed. Let me ask for more eyes on the problem.

FWIW I also installed the policykit-1 package, but that did not help substantially.

Thanks for your feedback! If you find out anything we’ll be glad to hear from you!

Okay, so far it seems that runnig fwupdtool instead does work without systemd or other daemon dependencies. It comes in the same package, so I guess this more or less solves my issue.

I have some other issues at the moment which hinder me from fully testing my usecase, I’ll confirm once I successfully updated the firmware!

I can confirm this approach works for me!

Using fwupdtool instead does not rely on daemons running. With this I was able to update the needed firmwares!