LXC IDmapping host:container. Newlt created files work, old files not visible

fuzzyduck

Member
Jul 14, 2021
66
3
13
44
Hey,

I had to reinstall Proxmox 6.4 due to failed upgrade to 7. I pulled the lxc containers from backup and got them running, with proper lxc mappings as before.

NEW LXC containers behave weird.

Inside a fresh LXC ubuntu: (Harro is my name)
groupadd -g 1000 Harro useradd -u 1000 -g Harro Harro passwd Harro

I got this very same user on the host with 1000:1000

then in the conf of the lxc:
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 101001 64530 lxc.idmap: g 1001 101001 64530 mp0: /TANK/shares/,mp=/mnt/shares

Then inside the LXC I log in as Harro and change dir to /mnt/shares/
1. I can make a file and it appears as Harro:Harro (so 1000:1000) on both sides and can interact with it
2. I can see the existing dirs but as nobody:nogroup although on the host its Harro:Harro
3. Changing into these existing dirs give me NO files. On host there are files as Harro:Harro

/etc/subuid gives me:
root:100000:65536 Harro:165536:65536 root:1000:1

/etc/subgid gives me:
root:100000:65536 Harro:165536:65536 root:1000:1

Any idea why this happens?
 
Last edited:
hi,

mp0: /TANK/shares/,mp=/mnt/shares
that's a zfs dataset?

3. Changing into these existing dirs give me NO files. On host there are files as Harro:Harro
that's normal since they aren't mounted recursively because of possible security implications. you can try adding the inner folders as a separate mountpoint and see if that solves your issue
 
Yes its in the zfs list command

In a working running LXC container (those working from backup) and i can browse the mountpoint + subdirs + files just fine. They are all Harro:Harro. In fact i can name the user inside the lxc whatever i want (www-data for nextcloud) as long as the IDs match with the host. In my case 1000:1000.

I have looked for other people with LXC mount problems i posted this due to a similar error on starting a fresh lxc unmodified container. Maybe its not related at all, but errors on a fresh lxc boot is strange to start with.
https://forum.proxmox.com/threads/mountpoint-with-lxc-idmap-no-longer-working.96575/post-418491
 
Last edited:

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!