Dobrica Pavlinušić's random unstructured stuff
systemd: Revision 4
running old distributions under systemd-nspawn

{toc: }

^ install on host

.pre
apt install systemd-container
.pre

^ setup old distribution

^^ os-release

.pre
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/"
.pre

^^ console

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

fix it by adding console to inittab

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

^^ network config

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

.pre
root@saturn4:/etc/systemd# mkdir nspawn

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

^^ start it

.pre
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
.pre