systemctl from inside docker container fails with D-Bus connection error
<p>I have setup a docker container based on OpenSuse 12, installed some additional files and copied some installer binaries into the container. So far everything fine. </p>

<p>From inside a running image of the container I now need to run the aforementioned  setup program but this needs to have uuid.socket up and running - uuid.socket in turn needs systemctl to work correctly and this causes an error like this:</p>

<pre><code>hxehost:/usr/sap/SRCFiles # systemctl
Failed to get D-Bus connection: Unknown error -1
</code></pre>

<p>I started the docker container like this:</p>

<pre><code>docker run -h hxehost -i -t f3096b0aa964 /bin/bash
</code></pre>

<p>Which, according to some postings should start a machine container as opposed to an application container.</p>

<p>Can anyone tell me what I'm doing wrong here??? How do I get systemctl to work inside a docker container?</p>

<p>I tried to starte the container with this command, which according to linked hints should do, but to no avail</p>

<pre><code>docker run --privileged --rm -ti -e 'container=docker' -h hxehost --network="bridge" --tmpfs /run --tmpfs /tmp -v /sys/fs/cgroup:/sys/fs/cgroup:ro siliconchris/hxe:v0.0.2 /bin/bash
</code></pre>

<p>If I do this, systemctl still gives exact same error.</p>

<p>If I start <strong>/sbin/init</strong> instead of /bin/bash, I can see that quite a lot of services are started (some, like wicked, login and module, fail). In the end, the container presents me with a login. After login, I can now execute systemctl and it shows all services with their respective states.</p>

<p>Now my next question is: <strong><em>IS THIS APPROACH FEASIBLE AT ALL???</em></strong></p>

<p>Best regards,</p>

<p>Chris</p>

<p>You may find the repo to this image at <a href="https://hub.docker.com/r/siliconchris/hxe/" rel="nofollow noreferrer">SAP HANA Express Edition inside docker</a></p>