I created an unprivileged container with the number 101. I mounted a single disk ZFS pool from the host by adding an mp0: line to the /etc/pve/lxc/101.conf file. I noticed the container does not have write permissions to this mount point. After reading the Unprivileged LXC containers wiki page, it seems I need to add UID mapping in the LXC config file. I created a user with UID 1000 on both the host and CT, added a mapping to the config file, updated the subuid & subgid files, and changed the owner of the mountpoint on the host to be UID 1000. I assumed that this would give write permission to UID 1000 in the CT. Now the CT won't even start up.
Contents of /etc/pve/lxc/101.conf
Contents of /etc/subuid
Contents of /etc/subgid
Command used to change host directory ownership
Output from ProxMox VE log
Contents of /etc/pve/lxc/101.conf
Code:
arch: amd64
cores: 6
features: nesting=1
hostname: PlexServer
memory: 4096
mp0: /storage/plex,mp=/mnt/plex
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.1.1,hwaddr=CA:FB:D2:FD:F0:C6,ip=192.168.1.80/24,type=veth
ostype: ubuntu
rootfs: local-lvm:vm-101-disk-0,size=20G
swap: 4096
unprivileged: 1
lxc.idmap = u 1000 1000 1
lxc.idmap = g 1000 1000 1
Contents of /etc/subuid
Code:
root:100000:65536
user1:165536:65536
root:1000:1
Contents of /etc/subgid
Code:
root:100000:65536
user1:165536:65536
root:1000:1
Command used to change host directory ownership
Code:
chown -R 1000:1000 /storage/plex
Output from ProxMox VE log
Code:
cgfsng_chown: 1353 No such file or directory - Error requesting cgroup chown in new user namespace
__lxc_start: 2068 Failed to spawn container "101"
TASK ERROR: startup for container '101' failed
Last edited: