Use systemd in Debian containers ?

alex3137

Member
Jan 19, 2015
43
3
8
Hello.

I installed systemd within my Debian containers but everytime I type systemctl command, I have this error:

Failed to get D-Bus connection: Unknown error -1

What am I doing wrong ?
 
systemd in Jessie is too old and does not work on LXC.

our Jessie lxc template does NOT run with systemd.
 
use sysvinit on Jessie (just use our LXC template, using sysvinit)
 
  • Like
Reactions: alex3137
systemd seems to work fine after installing systemd-sysv (version 215-17+dev8u4) on debian 8 containers. Is there any reason I shouldn't use it?
 
systemd in ArchLinux template from http://download.proxmox.com/images/system/ doesn't work inside LXC too. Same as in ALTLinux template from ALTLinux itself.
Meanwhile both of them perfectly work in ALTLinux implementation of PVE, same as other systemd-based templates.
Difference between Proxmox and ALTLinux pveversion is shown below:

pve-manager/4.3-10/7230e60f (running kernel: 4.4.24-1-pve)
pve-manager/4.3-6/ (running kernel: 4.7.8-un-def-alt1)
 
Last edited:
The arch template there is a old but does work...
 
Found this question while trying to do this in the debian:8 official container. For anyone else trying to do this on the official debian:8 (debian:jessie) container, @frank-from-DSPEED's answer works with a slight modification as described in an older git hub post:

docker run -d \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
--cap-add SYS_ADMIN \
debian:jessie /sbin/init
docker exec -it <your-new-container-name-or-ID> bash

Then from in the container:

systemctl show-environment

This works perfectly for me and since this is only a development environment, the security issue does not matter to me.

Note: The /sbin/init command gets /sbin/init to be Process 1, which is a key part of making this work.
 
Found this question while trying to do this in the debian:8 official container. For anyone else trying to do this on the official debian:8 (debian:jessie) container, @frank-from-DSPEED's answer works with a slight modification as described in an older git hub post:

docker run -d \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
--cap-add SYS_ADMIN \
debian:jessie /sbin/init
docker exec -it <your-new-container-name-or-ID> bash

Then from in the container:

systemctl show-environment

This works perfectly for me and since this is only a development environment, the security issue does not matter to me.

Note: The /sbin/init command gets /sbin/init to be Process 1, which is a key part of making this work.

this has nothing to do with the question at hand - please don't hijack threads..
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!