Hi everyone,
following this doc page I have successfully shared a disk between two containers and the host. Both containers can read/write files but conceptually something is missing for me....
The first part is clear:
here I'm mapping container uids to high values except for uid 1005.
uid 1005 in the container is mapped to the same uid of the host.
in /etc/subuid and /etc/subgid I add the line
The subuid and subgid configurations grant this mapped UID the privileges to act as UID 1005 on the host.
Ok also for the permission on host mounted disk
but (....and here I can't understad... ) when the container wants to write a file it uses the uid 0 (100000 on the host), not 1005.
How can it have the permissions to write on disk?
Thanks in advance.
following this doc page I have successfully shared a disk between two containers and the host. Both containers can read/write files but conceptually something is missing for me....
The first part is clear:
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 1005
lxc.idmap = g 0 100000 1005
# we map 1 uid starting from uid 1005 onto 1005, so 1005 → 1005
lxc.idmap = u 1005 1005 1
lxc.idmap = g 1005 1005 1
# we map the rest of 65535 from 1006 upto 101006, so 1006..65535 → 101006..165535
lxc.idmap = u 1006 101006 64530
lxc.idmap = g 1006 101006 64530
here I'm mapping container uids to high values except for uid 1005.
uid 1005 in the container is mapped to the same uid of the host.
in /etc/subuid and /etc/subgid I add the line
Code:
root:1005:1
The subuid and subgid configurations grant this mapped UID the privileges to act as UID 1005 on the host.
Ok also for the permission on host mounted disk
Code:
chown -R 1005:1005 /mnt/pve/......
but (....and here I can't understad... ) when the container wants to write a file it uses the uid 0 (100000 on the host), not 1005.
How can it have the permissions to write on disk?
Thanks in advance.