Running LXD inside Virtuozzo is not totally working (It may be similar as running LXD inside another LXD).
The Virtuozzo host is a VPS host service (not under my control).
The VPS client is running Ubuntu Server 16.04 and I successfully installed LXD and initialized it until the point it shows the empty lxc list
.
Then I tried to launch an image: lxc launch images:ubuntu/artful artful
, but it failed complaining:
error: LXD doesn't have a uid/gid allocation. In this mode, only privileged containers are supported.
Which cat /var/log/lxd/lxd.log
reports:
lvl=warn msg="Couldn't find the CGroup pids controller, process limits will be ignored." t=2017-07-26T10:11:35+0900
lvl=info msg="Kernel uid/gid map:" t=2017-07-26T10:11:35+0900
lvl=info msg=" - u 0 0 0" t=2017-07-26T10:11:35+0900
lvl=info msg=" - g 0 0 0" t=2017-07-26T10:11:35+0900
lvl=info msg="Configured LXD uid/gid map:" t=2017-07-26T10:11:35+0900
lvl=info msg=" - u 0 100000 65536 (unusable)" t=2017-07-26T10:11:35+0900
lvl=info msg=" - g 0 100000 65536 (unusable)" t=2017-07-26T10:11:35+0900
lvl=warn msg="One or more uid/gid map entry isn't usable (typically due to nesting)" t=2017-07-26T10:11:35+0900
lvl=warn msg="Only privileged containers will be able to run" t=2017-07-26T10:11:35+0900
lvl=info msg="Connecting to a remote simplestreams server" t=2017-07-26T10:11:35+0900
Then I tried to run the container in privileged mode:
lxc launch images:ubuntu/artful artful -c security.nesting=true -c security.privileged=true
It installs successfully, but it can not be started:
error: Error calling 'lxd forkstart artful /var/lib/lxd/containers /var/log/lxd/artful/lxc.conf': err='Failed to run: /usr/bin/lxd forkstart artful /var/lib/lxd/containers /var/log/lxd/artful/lxc.conf: '
lxc 20170726020609.465 ERROR lxc_cgfs - cgroups/cgfs.c:lxc_cgroupfs_create:901 - Could not find writable mount point for cgroup hierarchy 4 while trying to create cgroup.
lxc 20170726020609.465 ERROR lxc_cgfs - cgroups/cgfs.c:cgroup_rmdir:209 - Device or resource busy - cgroup_rmdir: failed to delete /sys/fs/cgroup/systemd//system.slice/lxd.service
It all points that the Virtuozzo container is running unprivileged
and thus LXD is failing.
I was wondering if this is a dead end for LXD in this situation or if there is a chance to make it work?
Virtuozzo is based in OpenVZ (you can check https://wiki.openvz.org/FAQ). They use an old kernel (2.6 based) without cgroups functionality needed for Docker/LXC/LXD. So your attempt will not work. Virtuozzo is already using a container technology (OpenVZ) but was not merged with the mainline kernel code.