NFS shared mount point

Josselin

Member
Jun 12, 2019
2
0
21
39
Hi,
I cannot get permissions from a mounted nfs drive, it's always assigned to "nobody nogroup".

I've tried this in /etc/pve/lxc/XXX.conf

lxc.idmap = u 0 100000 2000
lxc.idmap = g 0 100000 2000
lxc.idmap = u 2000 2000 1
lxc.idmap = g 2000 2000 1
lxc.idmap = u 2001 102001 65536
lxc.idmap = g 2001 102001 65536

also added `root:2000:1` in `/etc/subgid` and `/etc/subuid`. I've tried by adding it or replacing the existing one, doesn't change…

The error when I start the container with `sudo lxc-start -F -n XXX` is :

cgroups/cgfsng.c: mkdir_eexist_on_last: 1301 File exists - Failed to create directory "/sys/fs/cgroup/systemd//lxc/101"
lxc-start: 101: cgroups/cgfsng.c: container_create_path_for_hierarchy: 1353 Failed to create cgroup "/sys/fs/cgroup/systemd//lxc/101"
lxc-start: 101: cgroups/cgfsng.c: cgfsng_payload_create: 1526 Failed to create cgroup "/sys/fs/cgroup/systemd//lxc/101"
lxc-start: 101: cgroups/cgfsng.c: mkdir_eexist_on_last: 1301 File exists - Failed to create directory "/sys/fs/cgroup/systemd//lxc/101-1"
lxc-start: 101: cgroups/cgfsng.c: container_create_path_for_hierarchy: 1353 Failed to create cgroup "/sys/fs/cgroup/systemd//lxc/101-1"
lxc-start: 101: cgroups/cgfsng.c: cgfsng_payload_create: 1526 Failed to create cgroup "/sys/fs/cgroup/systemd//lxc/101-1"
lxc-start: 101: conf.c: lxc_map_ids: 3053 newuidmap failed to write mapping "newuidmap: uid range [2001-67537) -> [102001-167537) not allowed": newuidmap 11598 0 100000 2000 2000 2000 1 2001 102001 65536
lxc-start: 101: start.c: lxc_spawn: 1727 Failed to set up id mapping.
lxc-start: 101: start.c: __lxc_start: 1989 Failed to spawn container "101"
lxc-start: 101: tools/lxc_start.c: main: 330 The container failed to start
lxc-start: 101: tools/lxc_start.c: main: 336 Additional information can be obtained by setting the --logfile and --logpriority options


Regards.
 
Hello there,

Dump the container configuration with pct config <affected vmid> and wrap it in [ code ][/ code ] tags.

Cheers

P.S. You might want to restore modified files to their original defaults to avoid any future complications.
 
Hi,
Thanks for your reply

Code:
arch: amd64
cores: 1
description: 
hostname: ftp
memory: 512
mp0: /mnt/nas/ftp,mp=/mnt/nas/ftp
net0: name=eth0,bridge=vmbr0,gw=XXX.XXX.XXX.254,hwaddr=XX:XX:XX:XX:XX:XX,ip=XX.XX.XX.XX/32,type=veth
onboot: 1
ostype: debian
rootfs: local:101/vm-101-disk-0.raw,size=16G
swap: 512
unprivileged: 1
lxc.idmap: u 0 100000 2000
lxc.idmap: g 0 100000 2000
lxc.idmap: u 2000 2000 1
lxc.idmap: g 2000 2000 1
lxc.idmap: u 2001 102001 65536
lxc.idmap: g 2001 102001 65536
 
What happens when you mount it inside the container ? I don't know what you attempting with lxc.idmap but at a glance, seems you overwriting value with another. The problem is that it's unprivileged container and I assume you were using 'lxc.idmap' to remap, what you were trying was never going to work because how lxc bootstraps.


Alternatively you might want to look into lxc.mount options here https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html.
 

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!