Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to connect to bus: No such file or directory on systemd operations #7

Open
vonpupp opened this issue Jan 17, 2017 · 1 comment

Comments

@vonpupp
Copy link

vonpupp commented Jan 17, 2017

Hello,

I am having problems to use systemd, I suspect is related to dbus.

Here is my Vagrantfile:

Vagrant.configure("2") do |config|
  ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'
  config.vm.provider "docker" do |d|
    d.image = "tknerr/baseimage-ubuntu:16.04"
    d.has_ssh = true
    d.create_args = [ "--privileged", "-v", "/sys/fs/cgroup:/sys/fs/cgroup:ro" ]
  end
  config.vm.synced_folder ".", "/vagrant"
end

When I ssh to the box I try to list the units of systemd and I get the following error:

$ vagrant ssh
Last login: Tue Jan 17 13:13:15 2017 from 172.17.0.1
vagrant@d6fa0552baf5:~$ sudo su
root@d6fa0552baf5:/home/vagrant# systemctl list-units
Failed to connect to bus: No such file or directory

Have you seen this issue? Any idea?

Thanks.

@tknerr
Copy link
Owner

tknerr commented Jan 24, 2017

Hi @vonpupp , sorry for the delay.

What you are seeing is actually expected. The entrypoint for the docker images in this repository is actually sshd, i.e. this is the only process that is being started when you run the container.

E.g. running ps aux inside the container you see that these are the only processes that are running:

vagrant@linus-kitchen:~$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   4448   740 ?        Ss   21:21   0:00 /bin/sh -c /usr/sbin/sshd -D     -o UseDNS=no    -o UsePAM=no    -o PasswordAuthentication=yes    -o UsePrivilegeSeparation=no    -o PidFile=/t
root         7  0.0  0.2  61384  5008 ?        S    21:21   0:00 /usr/sbin/sshd -D -o UseDNS=no -o UsePAM=no -o PasswordAuthentication=yes -o UsePrivilegeSeparation=no -o PidFile=/tmp/sshd.pid
root      9642  0.0  0.2  61740  5748 ?        Ss   21:32   0:00 sshd: vagrant@pts/0
vagrant   9643  0.0  0.1  19764  3476 pts/0    Ss   21:32   0:00 -bash
vagrant   9660  0.0  0.1  17140  2256 pts/0    R+   21:33   0:00 ps aux

Especially there is no init system like systemd running, so systemctl isn't usable here.

More info about it here:
http://phusion.github.io/baseimage-docker/

As a possible solution for your case, you could:

HTH to get you a bit further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants