Cannot start LXD container within LXD container

,

Managed to reproduce this on CentOS 7.

And I know what the issue is I should say. Will fix in a bit.

Ok, so I have fixed this:

root     1211487  0.0  0.3 1198736 14096 ?       Ss   00:41   0:00 [lxc monitor] /var/lib/lxd/containers f1
1000000  1211496  0.1  0.2 170008 12096 ?        Ss   00:41   0:01  \_ /sbin/init
1000000  1211562  0.0  0.3  51688 15908 ?        Ss   00:41   0:00      \_ /lib/systemd/systemd-journald
1000000  1211581  0.0  0.0  21616  4468 ?        Ss   00:41   0:00      \_ /lib/systemd/systemd-udevd
1000100  1211593  0.0  0.1  26800  6808 ?        Ss   00:41   0:00      \_ /lib/systemd/systemd-networkd
1000000  1211609  0.0  0.0   9420  2768 ?        Ss   00:41   0:00      \_ /usr/sbin/cron -f
1000103  1211610  0.0  0.0   7660  4552 ?        Ss   00:41   0:00      \_ /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
1000000  1211613  0.0  0.3  31620 18236 ?        Ss   00:41   0:00      \_ /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
1000104  1211614  0.0  0.0 154720  4304 ?        Ssl  00:41   0:00      \_ /usr/sbin/rsyslogd -n -iNONE
1000000  1211615  0.0  0.1  17004  8020 ?        Ss   00:41   0:00      \_ /lib/systemd/systemd-logind
1000101  1211621  0.0  0.2  24164 12672 ?        Ss   00:41   0:00      \_ /lib/systemd/systemd-resolved
1000000  1211629  0.0  0.0   8208  2128 pts/7    Ss+  00:41   0:00      \_ /sbin/agetty -o -p -- \u --noclear --keep-baud console 115200,38400,9600 vt220
1000107  1278755  0.0  0.0  14792   348 ?        S    00:50   0:00      \_ dnsmasq -u lxc-dnsmasq --strict-order --bind-interfaces --pid-file=/run/lxc/dnsmasq.pid --listen-address 10.0.3.1 --dhcp-range 10.0.3.2,10
1000000  1280129  0.0  0.0   6092  3292 ?        Ss   01:00   0:00      \_ [lxc monitor] /var/lib/lxc f1-nested
1000000  1280130  0.0  0.2 168588 10700 ?        Ss   01:00   0:00          \_ /sbin/init
1000000  1280153  0.0  0.2  35288 12024 ?        Ss   01:00   0:00              \_ /lib/systemd/systemd-journald
1000000  1280166  0.0  0.0  21616  4604 ?        Ss   01:00   0:00              \_ /lib/systemd/systemd-udevd
1000100  1280176  0.0  0.1  26800  6904 ?        Ss   01:00   0:00              \_ /lib/systemd/systemd-networkd
1000000  1280192  0.0  0.0   9420  2912 ?        Ss   01:00   0:00              \_ /usr/sbin/cron -f
1000103  1280193  0.0  0.0   7392  4180 ?        Ss   01:00   0:00              \_ /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
1000000  1280196  0.0  0.3  31620 18172 ?        Ss   01:00   0:00              \_ /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
1000104  1280197  0.0  0.0 154720  4328 ?        Ssl  01:00   0:00              \_ /usr/sbin/rsyslogd -n -iNONE
1000000  1280198  0.0  0.1  16680  6704 ?        Ss   01:00   0:00              \_ /lib/systemd/systemd-logind
1000101  1280204  0.0  0.2  24164 12612 ?        Ss   01:00   0:00              \_ /lib/systemd/systemd-resolved
1000000  1280210  0.0  0.0   8208  2248 pts/1    Ss+  01:00   0:00              \_ /sbin/agetty -o -p -- \u --noclear --keep-baud console 115200,38400,9600 vt220
1000000  1280211  0.0  0.0   8208  2352 pts/0    Ss+  01:00   0:00              \_ /sbin/agetty -o -p -- \u --noclear --keep-baud pts/0 115200,38400,9600 vt220
1000000  1280212  0.0  0.0   8208  2180 pts/1    Ss+  01:00   0:00              \_ /sbin/agetty -o -p -- \u --noclear --keep-baud pts/1 115200,38400,9600 vt220
1000000  1280213  0.0  0.0   8208  2300 pts/2    Ss+  01:00   0:00              \_ /sbin/agetty -o -p -- \u --noclear --keep-baud pts/2 115200,38400,9600 vt220
1000000  1280214  0.0  0.0   8208  2352 pts/3    Ss+  01:00   0:00              \_ /sbin/agetty -o -p -- \u --noclear --keep-baud pts/3 115200,38400,9600 vt220

All containers share the host’s cgroup namespace:

> sudo ls -al /proc/1211496/ns/cgroup
lrwxrwxrwx 1 1000000 1000000 0 Feb 21 01:05 /proc/1211496/ns/cgroup -> 'cgroup:[4026531835]'

> sudo ls -al /proc/1280130/ns/cgroup
lrwxrwxrwx 1 1000000 1000000 0 Feb 21 01:05 /proc/1280130/ns/cgroup -> 'cgroup:[4026531835]'

> ls -al /proc/self/ns/cgroup
lrwxrwxrwx 1 brauner lxd 0 Feb 21 01:05 /proc/self/ns/cgroup -> 'cgroup:[4026531835]'

Took the opportunity to massively simplify the driver

I built off master and can confirm I am able to start a sub-container now. Thanks guys for working on this so quickly! What is the timeframe for 4.0.7?

Excellent!
No current timeline for 4.0.7, it will take a while to backport all of those recent fixes to stable-4.0 and be confident we didn’t regress anything.

I’ll get on those backports on Monday latest.

I finished the backports that include those fixes you want @_bw. See