[systemd-devel] linux container started with systemd-nspawn
arnaud gaboury
arnaud.gaboury at gmail.com
Mon Feb 17 04:15:36 PST 2014
Hi all,
I set up a linux container on my host.
Here are some basic infos:
- Host + guest running Archlinux
On host:
- custom kernel on host with user space set
- audit=0 as kernel parameter
- the guest OS is mounted in my rootfs at /dahlia with a symlink to
/var/lib/container
gabx at hortensia ➤➤ ~ % ls -al /var/lib/container
lrwxrwxrwx 1 root root 7 Feb 16 14:06 dahlia -> /dahlia/
- systemd cgconfig.service is disable
- systemd-machined.slice is enable:
gabx at hortensia ➤➤ ~ % systemctl status systemd-machined.service
systemd-machined.service - Virtual Machine and Container Registration Service
Loaded: loaded (/usr/lib/systemd/system/systemd-machined.service; static)
Active: active (running) since Mon 2014-02-17 12:53:47 CET; 2min 2s ago
Main PID: 1109 (systemd-machine)
CGroup: /system.slice/systemd-machined.service
└─1109 /usr/lib/systemd/systemd-machined
On guest:
- I symlinked every systemd udev things to /dev/null
- I commented out this in /etc/systemd/system.conf:
DefaultEnvironment="container=lxc-libvirt" <<<< not sure about this
I haven't be able to start the container with libvirt-lxc, neither
LXC, both for some cgroup issues I can't solve, even after a few days
of reading.
systemd-nspwan -dD /dahlia worked right out of the box !! (TY for this
wonderful tool).
But the output of systemd-cgls puzzles me. Below is part of it:
gabx at hortensia ➤➤ ~ % systemd-cgls
├─user.slice
│ └─user-1000.slice
│ └─session-1.scope
│ ├─ 450 login -- gabx
└─system.slice
├─1 /sbin/init splash
├─machine-dahlia.scope
Wouldn't it be preferable to have a machine.slice instead of a
machine.scope under the system.slice? Does it make any big difference
to run/manage the container ?
Thank you for help as I can't find any helpful hints on this quite new topic.
More information about the systemd-devel
mailing list