Does Ubuntu 16.04 lxc container work on Ubuntu 22.04 lxd host?

I’m using Ubuntu 22.04 lxd (5.0.1-9dcf35b installed as snap as ubuntu 22.04 does by default).

I’m launching a new Ubuntu 16.04 container with

lxc launch ubuntu:16.04 test-1604

or copying from an older lxd installation (ubuntu 18.04) with

lxc copy container1604 server2204:container1604

But it seems that both the new and old 16.04 container are unable to fully boot on lxd 5:

root@server2204:~# lxc exec test-1604 /bin/bash
root@test-1604:~#
root@test-1604:~# ps fax
PID TTY STAT TIME COMMAND
24 pts/1 Ss 0:00 /bin/bash
34 pts/1 R+ 0:00 \_ ps fax
1 ? Ss 0:00 /sbin/init
root@test-1604:~# ps uax
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 36436 1592 ? Ss 09:00 0:00 /sbin/init
root 24 0.0 0.0 21604 2236 pts/1 Ss 09:00 0:00 /bin/bash
root 36 0.0 0.0 37764 1780 pts/1 R+ 09:01 0:00 ps uax

(only /sbin/init is running inside the container, plus my session bash and ps)

and it’s not possible to shutdown the 1604 container

root@test-1604:~# systemctl status
Failed to connect to bus: No such file or directory
root@test-1604:~# systemctl poweroff
Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory
root@test-1604:~# halt -p
Failed to connect to bus: No such file or directory
Failed to talk to init daemon.
root@test-1604:~#

And
root@test-1604:~# systemctl is-system-running
offline

All these commands inside the container have been executed twice, immediately after boot and one hour after the boot.

Any ideas ?

It could be a cgroup version mismatch. Please check setting systemd.unified_cgroup_hierarchy=false helps as mentioned in

3 Likes

I added systemd.unified_cgroup_hierarchy=false to hosts’s grub GRUB_CMDLINE_LINUX, rebooted the host and it works now. Ubuntu 16.04 container boots and shutdowns without problems.

Thank you @sdeziel .

Now I would like now to apply the same fix to the production server, but… what are side effects of applying this to a server where newer containers (ubuntu 22.04) are already working? Will I have other problems in the future using this fix?

1 Like

In Ubuntu 22.04 it uses a pure cgroupv2 environment by default, but setting systemd.unified_cgroup_hierarchy=false allows cgroupv1 to work as well. I’ve not had any reports of people running into issues with this fix when trying to run containers that require cgroupv1 to work.

2 Likes