Build new image
cd /var/local/mkosi
# if not existing yet
mkdir mkosi.cache
If not done yet, install latest version of mkosi in a virtualenv
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install git+https://github.com/systemd/mkosi.git
Otherwise, just activate the virtualenv
source .venv/bin/activate
Build the image
mkosi -i -t directory -o /var/lib/machines/xcache-$(date +%Y-%m-%d-%H%M)
To start xcache with the new image create a symlink and restart
ln -s /var/lib/machines/<image-to-use> /var/lib/machines/xcache
machinectl stop xcache
machinectl start xcache