[systemd-devel] systemd-nspawn/machinectl with LUKS/LVM

bugs-systemd at aquazul.com bugs-systemd at aquazul.com
Tue Oct 3 15:04:17 UTC 2017


Hi,

I'm trying to figure out the right way of using an LUKS-encrypted LV
with systemd-nspawn.

I've got an LV called "containername" which is LUKS-encrypted, and I
start the container using:

systemd-nspawn --boot --image=/dev/vg/containername

it asks me for the LUKS passphrase, and it seems to work OK on the
command line.

However, just a few questions:

1) is there any advantage to using a single-partition GPT instead of no
partition and a filesystem?

2) machinectl list-images doesn't detect the images in LVs; am I
supposed to (auto)mount them in /var/lib/machines/ ?

3) how do I best enable this on boot? "machinectl enable" won't work
since it doesn't know which image to use. Is there an example of a
systemd unit file for an image-based nspawn container?

Thanks,

-- M



More information about the systemd-devel mailing list