Subject: Linux-Vserver + LXC + Systemd achievement unlocked
From: Ben Green <ben@bristolwireless.net>
Date: Tue, 18 Jul 2017 15:45:36 +0100

Hi all,

I've been asked to get a system running which supports LXC, and this  
seems to require bits of systemd to run, at least on the default  
stretch install. So, here's some packages which have a patch to  
util-vserver from AlexanderS which fix this. The packages are from here:

http://repo.psand.net/util-vserver_AlexanderS/

mkdir util-vserver_AS
cd util-vserver_AS
wget  
http://repo.psand.net/util-vserver_AlexanderS/util-vserver-build_0.30.216-pre3126-1_amd64.deb
wget  
http://repo.psand.net/util-vserver_AlexanderS/util-vserver-core_0.30.216-pre3126-1_amd64.deb
wget  
http://repo.psand.net/util-vserver_AlexanderS/util-vserver-sysv_0.30.216-pre3126-1_amd64.deb
wget  
http://repo.psand.net/util-vserver_AlexanderS/libvserver0_0.30.216-pre3126-1_amd64.deb
wget  
http://repo.psand.net/util-vserver_AlexanderS/util-vserver_0.30.216-pre3126-1_amd64.deb
dpkg -i *.deb
apt-get -f install

I built these by pulling util-vserver from git, then adding Alexander's patch:

git clone https://github.com/AlexanderS/util-vserver
cd util-vserver
git pull origin fix/systemd-shared-mounts

I then copied some files from the util-vserver tar ball to help build  
with Debian.

Please try the packages, they should be able to build and run vservers  
from a stock Debian Stretch install with no trouble, and also allow  
LXC to function. I would recommend using a bridged network interface  
for both Linux-Vserver and LXC. Standard LXC setup applies.

The one issue I have at the moment is that restarting util-vserver  
either via the "service util-vserver restart" or via systemd's  
systemctl, results in a messed up cgroup mount structure. There's a  
slight mitigation by adding by adding the following to  
/etc/vservers/.defaults/cgroup/subsys:

blkio
cpu,cpuacct
cpuset
devices
freezer
memory
net_cls,net_prio
perf_event

But it's still not really a good idea to restart util-vserver as it  
will remove all LXC directories, and the perf_event mount ends up  
missing a couple of options.

Cheers,
Ben