LXC und Veracrypt

mle

Member
Aug 5, 2021
78
16
13
31
Austria
Hy Leute

Wollte euch mal fragen ob ihr Erfahrungen mit TrueCrypt/Veracrypt unter LXC Container habt.

In Bezug auf Probleme beim mounting der Container (schätze ich zumindest mal), allgemeine Performance, e.t.c ;-)

Danke ;-)
 
fuer container kannst du nur *unter* dem storage verschluesseln (und z.b. beim/nach dem booten entschluesseln, bevor der storage verwendet wird), oder file-basiert im volume (dann kuemmert es PVE nicht, sondern muss im gast drinnen behandelt werden), nicht das volume selbst. das volume muss bei containern direkt ein mount-bares filesystem (ext4) enthalten (bei VMs ist der inhalt des volumes fuer PVE egal, soferns ein "raw" image ist).
 
Thx für die rasche Antwort ;-)

Geplant wäre das ich ein Debian in einem LXC Container starte mit einem zusätzlichen mountpoint der auf einem ext4 formatierten speicher liegt.
Dort liegt dann der TrueCrypt/Veracrypt Container als file und auch ext4 als dateisystem den würde ich dann gerne in dem Container mounten.

Es ist schon etwa länger her als ich das getestet habe und erinnere mich nur noch dran das ich den TrueCrypt/Veracrypt Container nicht in einem LXC Container mounten konnte unabhängig ob privilegiert oder unprivilegiert.

Aktuell nutze ich es JA in einer debian VM aber würde es gerne aus Ressourcen und Performance gründen gerne unter einem LXC Container testen.
 
ich weiss nicht genau was veracrypt zum mounten verwendet/braucht.. vielleicht mal mit einem test container probieren und dann fehler und config posten? ;)
 
LXC Config:

Code:
arch: amd64
cores: 40
features: fuse=1,mount=nfs;cifs,nesting=1
hostname: vera-test
memory: 4096
net0: name=eth0,bridge=vmbr301,hwaddr=CE:99:84:B7:AF:CB,ip=dhcp,type=veth
ostype: debian
protection: 1
rootfs: local-nvme-md-raid1-lvm-thin:vm-9458-disk-0,size=32G
swap: 2048

Console output:

Code:
root@vera-test:~/VeraCrypt-CommandLine-Examples/Linux# veracrypt --text --create vctest.vc --size 600M --password 12345 --volume-type normal --encryption AES --hash sha-512 --filesystem ext4 --pim 0 --keyfiles "" --random-source randomdata.txt

Done: 100.000%  Speed:  76 MiB/s  Left: 0 s         

Error: Failed to set up a loop device:
/root/VeraCrypt-CommandLine-Examples/Linux/vctest.vc

root@vera-test:~/VeraCrypt-CommandLine-Examples/Linux# veracrypt --text --mount vctest.vc /mnt --password 12345 --pim 0 --keyfiles "" --protect-hidden no --slot 1 --verbose

Error: Failed to set up a loop device:
/root/VeraCrypt-CommandLine-Examples/Linux/vctest.vc

LXC Config angepasst:

Code:
arch: amd64
cores: 40
features: fuse=1,mount=nfs;cifs,nesting=1
hostname: vera-test
memory: 4096
net0: name=eth0,bridge=vmbr301,hwaddr=CE:99:84:B7:AF:CB,ip=dhcp,type=veth
ostype: debian
protection: 1
rootfs: local-nvme-md-raid1-lvm-thin:vm-9458-disk-0,size=32G
swap: 2048
lxc.cgroup2.devices.allow: b 7:* rwm
lxc.cgroup2.devices.allow: c 10:237 rwm
lxc.mount.entry: /dev/loop0 dev/loop0 none bind,create=file 0 0
lxc.mount.entry: /dev/loop1 dev/loop1 none bind,create=file 0 0
lxc.mount.entry: /dev/loop2 dev/loop2 none bind,create=file 0 0
lxc.mount.entry: /dev/loop3 dev/loop3 none bind,create=file 0 0
lxc.mount.entry: /dev/loop4 dev/loop4 none bind,create=file 0 0
lxc.mount.entry: /dev/loop5 dev/loop5 none bind,create=file 0 0
lxc.mount.entry: /dev/loop6 dev/loop6 none bind,create=file 0 0
lxc.mount.entry: /dev/loop-control dev/loop-control none bind,create=file 0 0

Console output:

Code:
root@vera-test:~# veracrypt --text --create vctest.vc --size 200M --password MySuperSecurePassword1! --volume-type normal --encryption AES --hash sha-512 --filesystem ext4 --pim 0 --keyfiles "" --random-source randomdata.txt

Done: 100.000%  Speed:  32 MiB/s  Left: 0 s         

Error: /dev/mapper/control: open failed: Operation not permitted
Failure to communicate with kernel device-mapper driver.
Check that device-mapper is available in the kernel.
Incompatible libdevmapper 1.02.175 (2021-01-08) and kernel driver (unknown version).
Command failed.
 
hmm, so you'd need access to the device mapper inside the container, that seems very brittle and not recommendable :-/
 
  • Like
Reactions: mle
Yes, I know I still had that in my memory.

I thought I'd ask anyway, it's been a while and maybe someone has a sensible solution for this.

If it suits me better in time I will deal with it again and if I find something I will share it here. ;)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!