HELP: shared storage between unprivileged container

Schmart

New Member
Jun 20, 2023
9
0
1
Hey

I am currently trying to setup a shared storage between 2 container, but fail to do so.

What I currently have:
a unprivileged container CID 100​
another unprivileged container CID 101​
a zfs partitioned storage on datacenter level (called tank)​
a storage pointing at a subfolder inside the zfs drive (/tank/movies) on node level​

via the node's console I added
Code:
mp0: /tank/movies,mp=/mnt/movies
to both container conf-files.

I created a working SMB-share between the proxmox-server and my pc on CID 101 via which I can dump files onto /mnt/movies. The dumped files are accessable on CID 101 but I can't see those files from within CID 100's /mnt/movies or node's /tank/movies directories.

Does anyone have a clue how to solve this issue?

EDIT:
I followed these instructions as best as I could and failed (I see a pattern).
What I tried to do:
I have a user "share" UID 1000 GID 1000 inside CID 101​
I edited '/etc/pve/lxc/101.conf' on node level and added the following lines​
[CODE​
# uid map: from uid 0 map 1005 uids (in the ct) to the range starting 100000 (on the host), so 0..1004 (ct) → 100000..101004 (host)​
]lxc.idmap: u 0 100000 1000​
lxc.idmap: g 0 100000 1000​
# we map 1 uid starting from uid 1005 onto 1005, so 1005 → 1005​
lxc.idmap: u 1000 1000 1​
lxc.idmap: g 1000 1000 1​
# we map the rest of 65535 from 1006 upto 101006, so 1006..65535 → 101006..165535​
lxc.idmap: u 1001 101001 64525​
lxc.idmap: g 1001 101001 64525​
[/CODE]​
I edited both '/etc/subuid' and '/etc/subgid' by commenting #root:100000:65536 and adding 'root:1000:1'​
and entered 'chown -R 1000:1000 /tank/movies/' on the node shell​
checking via 'ls -l /tank/' I get​
Code:
drwxr-xr-x 8 1000 1000 8 Jun 20 20:16 movies
But upon restarting the CT I get following error:

Code:
lxc_map_ids: 3701 newuidmap failed to write mapping "newuidmap: uid range [1000-1001) -> [1000-1001) not allowed": newuidmap 8738 0 100000 1000 1000 1000 1 1001 101001 64525
lxc_spawn: 1788 Failed to set up id mapping.
__lxc_start: 2107 Failed to spawn container "101"
TASK ERROR: startup for container '101' failed

Thanks,
Schmart
 
Last edited: