Disk-space consumed: < 500 MB.
0. Run in shell; takes about 5 minutes depending on download speed.
#!/bin/bash
SYSR=/var/lib/machines/debian
sudo mkdir $SYSR
sudo chown $USER $SYSR; sudo chgrp $USER $SYSR
sudo debootstrap --include=sudo,dbus,libpam-systemd sid $SYSR http://httpredir.debian.org/debian/
1. Open a shell inside the new container:
export SYSR=/var/lib/machines/debian
sudo systemd-nspawn -m sid -D $SYSR
See: root@debian prompt.
2. Create another user the usual way:
root@debian:~# adduser jack
Adding user `jack' ...
3. Add your user to systemd-journal group:
root@debian:~# addgroup jack systemd-journal
Adding user `jack' to group `systemd-journal' ...
4. Exit container with Ctrl-] 3 times in a row.
5. Employ a text editor from localhost to add jack to /etc/sudoers:
# User privilege specification
root ALL=(ALL:ALL) ALL
jack ALL=(ALL:ALL) ALL
Also, employ a text editor to change /etc/hostname to differ from that
of your test machine in order to minimize confusion.
6. Now boot the container and login as your new user:
[alison@localhost ]$ sudo systemd-nspawn -bD $SYSR
Spawning container debian on /vol/debian.
Press ^] three times within 1s to kill container.
Detected virtualization systemd-nspawn.
Detected architecture x86-64.
Welcome to Debian GNU/Linux stretch/sid!
Debian GNU/Linux stretch/sid sid.localhost.com console
sid login: jack
Password:
jack@sid:~$ systemctl status
â sid.localhost.com
State: running
Jobs: 0 queued
Failed: 0 units
Since: Thu 2015-08-27 17:58:03 UTC; 3min 6s ago
CGroup: /machine.slice/machine-sid.scope
ââ1 /lib/systemd/systemd
ââsystem.slice
ââdbus.service
â ââ58 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
ââcron.service
â ââ57 /usr/sbin/cron -f
ââsystemd-journald.service
â ââ17 /lib/systemd/systemd-journald
ââsystemd-logind.service
â ââ56 /lib/systemd/systemd-logind
ââconsole-getty.service
â ââ62 /bin/login --
â ââ69 -bash
â ââ86 systemctl status
â ââ87 pager
âârsyslog.service
ââ60 /usr/sbin/rsyslogd -n
jack@sid:~$ sudo dpkg -l "*systemd*"
sudo: unable to resolve host sid.localhost.com
[sudo] password for jack:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=====================-===============-===============-================================================
ii libpam-systemd