What am I doing wrong with my user mapping

kingamajick

New Member
Sep 30, 2024
3
0
1
I wasn't able to write to my bind mount so I followed the guide here, however I'm unsure why i'm hitting the error
Code:
 newuidmap failed to write mapping "newuidmap: uid range [1005-1006) -> [1005-1006) not allowed"

What am I missing?

Code:
root@isaac:~# cat /etc/subuid
root:100000:65536
Code:
root@isaac:~# cat /etc/subgid
root:100000:65536
root:1005:1
Code:
root@isaac:~# cat /etc/pve/lxc/102.conf
#<div align='center'><a href='https%3A//Helper-Scripts.com' target='_blank' rel='noopener noreferrer'><img src='https%3A//raw.githubusercontent.com/tteck/Proxmox/main/misc/images/logo-81x112.png'/></a>
#
#  # Alpine-Docker LXC
#
#  <a href='https%3A//ko-fi.com/proxmoxhelperscripts'><img src='https%3A//img.shields.io/badge/&#x2615;-Buy me a coffee-blue' /></a>
#  </div>
# uid map%3A from uid 0 map 1000 uids (in the ct) to the range starting 100000 (on the host), so 0..999 (ct) %E2%86%92 100000..100999(host)
arch: amd64
cores: 1
features: keyctl=1,nesting=1
hostname: judas
memory: 1024
mp0: /mnt/data,mp=/media/data
net0: name=eth0,bridge=vmbr0,gw=192.168.1.1,hwaddr=BC:24:11:0D:E1:A4,ip=192.168.1.16/24,type=veth
onboot: 1
ostype: alpine
rootfs: local-lvm:vm-102-disk-0,size=2G
swap: 512
tags: proxmox-helper-scripts
unprivileged: 1
lxc.idmap: u 0 100000 1005
lxc.idmap: g 0 100000 1005
lxc.idmap: u 1005 1005 1
lxc.idmap: g 1005 1005 1
lxc.idmap: u 1006 101006 64530
lxc.idmap: g 1006 101006 64530
Code:
root@isaac:~# lxc-start -F -n 102
lxc-start: 102: ../src/lxc/idmap_utils.c: lxc_map_ids: 245 newuidmap failed to write mapping "newuidmap: uid range [1005-1006) -> [1005-1006) not allowed": newuidmap 3693 0 100000 1005 1005 1005 1 1006 101006 64530
lxc-start: 102: ../src/lxc/start.c: lxc_spawn: 1795 Failed to set up id mapping.
lxc-start: 102: ../src/lxc/start.c: __lxc_start: 2114 Failed to spawn container "102"
lxc-start: 102: ../src/lxc/tools/lxc_start.c: lxc_start_main: 307 The container failed to start
lxc-start: 102: ../src/lxc/tools/lxc_start.c: lxc_start_main: 312 Additional information can be obtained by setting the --logfile and --logpriority options
 
And the issue was, I forgot to add the id in /etc/subuid /facepalm

Adding
Code:
/etc/subuid
and the container starts fine.
 

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!