DBUS access in Container


I am trying to install HP printer using hplip in Torizon.
I am using torizon/arm32v7-debian-qt5-wayland-examples:buster image.

While running hp-setup to add printer queue, I am getting following error:
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /host/run/dbus/system_bus_socket: No such file or directory

How to expose/export DBUS to container?

Pradeep Pol

Greetings @eklavya19,

I guess what you can start out by trying is mounting the host dbus into the container. This can simply be done by adding -v /var/run/dbus:/var/run/dbus to your docker run command. Depending on what kind of permissions are required you may need to add --privileged to the command as well. Do note that in the end you shouldn’t be running containers with full privileges as it’s insecure, but it’s helpful to eliminate permissions as an issue when testing.

I can’t say we’ve ever tried printers with Torizon so I can’t comment on any future possible problems. Though please keep me informed with any updates/further issues.

Best Regards,

Hi @jeremias.tx ,

Thanks for the reply.

Now I am able to Print the files on HP LaserJet 1020 model using HPLIP and Debian container successfully.

Pradeep pol

Hi @eklavya19

Perfect that it works. Thanks for the feedback.

Best regards,