Mkosi configs and files for Arch Linux systemd-nspawn images.
Expected to be used in Arch Linux box.
- Install
base-devel
,git
- Install
mkosi
(ormkosi-git
in AUR) - Clone this repository
After cloning it, you can do the followings:
Run update-nspawn-images
as root:
update-nspawn-images CONTAINER [OTHER_CONTAINER ...]
where CONTAINER
or OTHER_CONTAINER
are nspawn container name in this repository.
update-nspawn-images
will do below:
- Build specified nspawn image
- Remove existing image (nspawn container will be terminated)
- Install new image and config
cd CONTAINER/
sudo make
- Import container image via
machinectl
- Install nspawn config to
/etc/systemd/nspawn/
asCONTAINER.nspawn
cd CONTAINER/
sudo make install
- Remove container image via
machinectl
- Delete nspawn config installed as
/etc/systemd/nspawn/CONTAINER.nspawn
cd CONTAINER/
sudo make uninstall
Delete container image and mkosi.default
in CONTAINER/
cd CONTAINER/
sudo make clean
corespawn/
: Basic Arch LInux containermstdnspawn/
: Configuable Mastodon instanceguispawn/
: Packaging GUI apps. Currently only web browsers (Tor browser & Chromium)tlspawn/
: Packaging Tex Live utilitiestorspawn/
: Running Tor proxy (Tor + Privoxy; tcp:8118 opened)sngskspawn/
: Web app run as sngsk.info
See this comment.
Some environment variables are required to run X apps. Use below snippet:
machinectl shell \
--setenv=display=:0 \
--setenv=xauthority="\${HOME}/.xauthority" \
--setenv=pulse_server=unix:/run/user/host/pulse/native \
gui@guispawn /usr/bin/COMMAND ARGUMENTS
Or you can use script launch-app-in-container
like below:
launch-app-in-container COMMAND ARGUMENTS
This will do same thing of above snippet.