[systemd-devel] systemd and LXC

Dmitry Rozhkov dmitry.rojkov at gmail.com
Wed Mar 21 03:03:30 PDT 2012


Hi,

I'm trying to run MeeGo SDK (http://merproject.org) as a LXC container,
but there some complications related to systemd. The default target looks
as follows:

[Unit]
Description=Non-Graphical Interface
#Requires=multi-user.target
#After=multi-user.target
Requires=systemd-logind.service
Conflicts=rescue.target
AllowIsolate=yes

[Install]
Alias=default.target

But when I run `lxc-start -n mer` there is no output. It turned out that
systemd uses the host's system console for its output which is not very
convenient when starting containers remotely.

Is there a way to make systemd show its output in the container console?

What should be the minimal setup to get a system managed by systemd to
show the "login:" prompt in the console?

The current version of systemd in MER is 37.

======= {rootfs}/etc/systemd/system.conf ==========
[Manager]
#LogLevel=info
LogTarget=console
#LogColor=yes
#LogLocation=no
#DumpCore=yes
CrashShell=yes
#ShowStatus=yes
#SysVConsole=yes
CrashChVT=1
#CPUAffinity=1 2
MountAuto=no
SwapAuto=no
#DefaultControllers=cpu
#DefaultStandardOutput=syslog
#DefaultStandardError=inherit
#JoinControllers=cpu,cpuacct
JoinControllers=
=====================================================

==={rootfs}/etc/systemd/systemd-logind.conf==========
[Login]
NAutoVTs=1
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
=====================================================

The host system is Ubuntu 11.10.

===/var/lib/lxc/mer/config===========================
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.veth.pair = veth_1
lxc.tty = 4
lxc.console=/var/log/lxc/mer.console
lxc.pts = 1024
lxc.rootfs = /var/lib/lxc/mer/rootfs
lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm

# mounts point
lxc.mount.entry=proc /var/lib/lxc/mer/rootfs/proc proc nodev,noexec,nosuid
0 0
lxc.mount.entry=devpts /var/lib/lxc/mer/rootfs/dev/pts devpts defaults 0 0
lxc.mount.entry=sysfs /var/lib/lxc/mer/rootfs/sys sysfs defaults  0 0
lxc.mount.entry=shm /var/lib/lxc/mer/rootfs/run/shm tmpfs defaults  0 0
=====================================================

Best regards,
Dima
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20120321/90015834/attachment.htm>


More information about the systemd-devel mailing list