Dobrica Pavlinušić's random unstructured stuff
systemd: Revision 4

running old distributions under systemd-nspawn



install on host

apt install systemd-container

setup old distribution

os-release

root@saturn4:~# cat /saturn/etc/os-release
PRETTY_NAME="Debian GNU/Linux 4 (etch)"
NAME="Debian GNU/Linux"
VERSION_ID="4"
VERSION="4 (etch)"
VERSION_CODENAME=etch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

console

root@saturn4:/saturn/etc# machinectl shell saturn /usr/bin/uptime
Failed to get shell PTY: Protocol error

fix it by adding console to inittab

dpavlin@saturn:~$ grep console /etc/inittab
0:2345:respawn:/sbin/getty 38400 console

network config

full access to host network, services are configured to listen to localhost

root@saturn4:/etc/systemd# mkdir nspawn

root@saturn4:/etc/systemd# cat > nspawn/saturn.nspawn
[Network]
VirtualEthernet=no

start it

root@saturn4:~# mv /saturn/ /var/lib/machines/
root@saturn4:~# machinectl enable saturn
Created symlink /etc/systemd/system/machines.target.wants/systemd-nspawn@saturn.service �/lib/systemd/system/systemd-nspawn@.service.
root@saturn4:~# machinectl start saturn