Unprivileged LXC containers UIDs

IKlotz

New Member
Jan 29, 2025
1
0
0
I have tried a number of approaches, but nothing seems to work.I am trying to map the UID of users from an LXC container with Samba, for correct folder permission mapping, but I always end up with the same error, where it seems that no port mapping is allowed.I followed the exact documentation from: https://pve.proxmox.com/wiki/Unprivileged_LXC_containers, even testing using the same data from it, and the error is always the same:

lxc_map_ids: 245 newuidmap failed to write mapping "newuidmap: uid range [0-1000) -> [100000-101000) not allowed": newuidmap 38704 0 100000 1000 1000 1000 1 1001 1001 1 1002 101006 64530
lxc_spawn: 1795 Failed to set up id mapping.

lxc.idmap = u 0 100000 1000
lxc.idmap = g 0 100000 1000
lxc.idmap = u 1000 1000 1
lxc.idmap = g 1000 1000 1
lxc.idmap = u 1001 1001 1
lxc.idmap = g 1001 1001 1
lxc.idmap = u 1002 101006 64530
lxc.idmap = g 1002 101006 64530

file /etc/subuid and /etc/subgid

root:100000:1
user1:101000:1
user2:101001:1

However, what I want is to map users 1000 and 1001 from the container. Even when putting the mapping sequentially, the error persists, as if I simply can't do it. What am I missing?"
 
file /etc/subuid and /etc/subgid

root:100000:1
user1:101000:1
user2:101001:1
Change this to:
Code:
root:100000:65536
root:1000:2

lxc.idmap = u 0 100000 1000
lxc.idmap = g 0 100000 1000
lxc.idmap = u 1000 1000 1
lxc.idmap = g 1000 1000 1
lxc.idmap = u 1001 1001 1
lxc.idmap = g 1001 1001 1
lxc.idmap = u 1002 101006 64530
lxc.idmap = g 1002 101006 64530
You might also want to change this to:
Code:
lxc.idmap = u 0 100000 1000
lxc.idmap = g 0 100000 1000
lxc.idmap = u 1000 1000 2
lxc.idmap = g 1000 1000 2
lxc.idmap = u 1002 101002 64534
lxc.idmap = g 1002 101002 64534