dbus and Linux Containers

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Sep 16 02:52:07 PDT 2013

On 14/09/13 12:30, Alessandro Moscatelli wrote:
> is it possibile for an application running inside a Linux Container to
> connect to DBus ?
> I am getting an error with :
> *DBusConnection.getConnection(DBusConnection.SYSTEM);*

If you're using containers/chroots, you (or your OS vendor) will have to
define your own security/isolation policy.

The system bus uses a socket in /var/run/dbus/system_bus_socket
(usually; path may vary by OS).

If you want the container to have its own independent system bus, run a
separate system dbus-daemon instance in the container (via an
appropriate init script, systemd unit, Upstart job etc., depending on OS).

If you want the container to share the "outer" system bus, make its
socket available inside the container, e.g. via a bind mount. Be aware
that this will allow processes inside the container to communicate with
processes outside the container, and might be a security vulnerability,
depending what system services you have and what your security model is.


More information about the dbus mailing list