I'm running into this issue which I can't seem to solve on my own with
I tried many different configs to no avail and this honestly doesn't sound like something so hard, unless I'm missing a key point.
Either way, thanks in advance for pointing me in the right direction.
I'm looking for a way to define the uid/gid mappings for containers before the container itself is created. This is because the container is created mapping root to
When I then change my CT config in
I can still attach to the container running
Starting the container with
To solve my problem I thought that creating the container with the correct mappings would have been helpful, but it is impossible via GUI and honestly I'm struggling to get past simply adding the .conf file in /etc/pve/lxc, because I obviously still need to create and provision the rootfs and I'm not sure how to proceed in a way that can work with Proxmox.
man
and the docs.I tried many different configs to no avail and this honestly doesn't sound like something so hard, unless I'm missing a key point.
Either way, thanks in advance for pointing me in the right direction.
I'm looking for a way to define the uid/gid mappings for containers before the container itself is created. This is because the container is created mapping root to
100000:100000
by default, therefore most everything in the container's /
is owned by that user.When I then change my CT config in
/etc/pve/lxc/<ctid>.conf
and remap the uids/gids to a different id range (starting above 2000000), the resources in the filesystem become unavailable and it's impossible to access the container either via GUI or SSH.arch: amd64
cores: 2
cpuunits: 256
hostname: hostname
memory: 512
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=52:F5:F4:C1:6E:6E,ip=dhcp,ip6=dhcp,type=veth
ostype: debian
rootfs: local-lvm:vm-2012-disk-0,size=3G
swap: 512
unprivileged: 1
lxc.idmap: u 0 2000000 65536
lxc.idmap: g 0 2000000 65536
cores: 2
cpuunits: 256
hostname: hostname
memory: 512
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=52:F5:F4:C1:6E:6E,ip=dhcp,ip6=dhcp,type=veth
ostype: debian
rootfs: local-lvm:vm-2012-disk-0,size=3G
swap: 512
unprivileged: 1
lxc.idmap: u 0 2000000 65536
lxc.idmap: g 0 2000000 65536
I can still attach to the container running
lxc-attach <ctid>
on the host and the console works there, and with a ls -la /
I can see the majority of directories and files are owned by nobody:nogroup
.Starting the container with
lxc-start -F <ctid>
allows to glance at the boot process, and as you can see from the attached file there are a bunch of errors.To solve my problem I thought that creating the container with the correct mappings would have been helpful, but it is impossible via GUI and honestly I'm struggling to get past simply adding the .conf file in /etc/pve/lxc, because I obviously still need to create and provision the rootfs and I'm not sure how to proceed in a way that can work with Proxmox.