I’m trying to create a container with an encrypted rootfs using cryptsetup on the host to unlock the partition.
Arch linux is used as both the host and container.
Here’s my config file:
lxc.include = /usr/share/lxc/config/common.conf
lxc.arch = x86_64
lxc.rootfs.path = /dev/mapper/private
lxc.uts.name = private
lxc.net.0.type = none
And what seems to be the pertinent part from the log file when running lxc-start:
lxc-start private 20180925001100.104 ERROR conf - conf.c:lxc_mount_rootfs:1328 - Failed to mount rootfs “/dev/mapper/private” onto “/usr/lib/lxc/rootfs” with options “(null)”
lxc-start private 20180925001100.104 ERROR conf - conf.c:lxc_setup_rootfs_prepare_root:3446 - Failed to setup rootfs for
lxc-start private 20180925001100.104 ERROR conf - conf.c:lxc_setup:3510 - Failed to setup rootfs
lxc-start private 20180925001100.104 ERROR start - start.c:do_start:1234 - Failed to setup container “private”
lxc-start private 20180925001100.104 ERROR sync - sync.c:__sync_wait:59 - An error occurred in another process (expected sequence number 5)
The /dev/mapper/private partition contains an ext4 filesystem with the content created using the lxc template provided by Arch Linux.
The following command works without issue: mount /dev/mapper/private /usr/lib/lxc/rootfs
More recent comments on the following link seems to indicate that this setup should work.
Any suggestions on what I could try?