Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Containers
User Name
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.


  Search this Thread
Old 02-07-2021, 03:03 PM   #1
LQ Newbie
Registered: Apr 2008
Posts: 24

Rep: Reputation: 10
Question Adding LXC id mapping reverses ownership of all user-owned files within the container

I'm using LXC within proxmox.

I’d have some bind mounts I’d like to share between a number of LXC containers. Also like many, I stumbled upon the problem of conflicting UIDs. I'm trying to do a very typical uid mapping. I have both a Guest and Host user id 5000.
Just for reference I'm adding my config, it is valid, because it works. I see Bind mount files on Guest/Host owned by #5000 user as their respective users in Guest/Host.

lxc.idmap: u 0 100000 5000
lxc.idmap: g 0 100000 5000
lxc.idmap: u 5000 5000 1
lxc.idmap: g 5000 5000 1
lxc.idmap: u 5001 105001 60535
lxc.idmap: g 5001 105001 60535

BUT. When the mapping is added, the /home folder on the Guest is suddenly being owned by 65534/nobody. How? Why? What could be the possible issue?
I tried the same with multiple container templates (Turnkey, Alpine) with same results...

Last edited by poisonborz; 02-20-2021 at 06:17 PM.
Old 02-08-2021, 09:04 AM   #2
LQ Sage
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,679

Rep: Reputation: Disabled
Are you using random UID's and GID's instead of actual ones?
Old 02-20-2021, 04:46 PM   #3
LQ Newbie
Registered: Apr 2008
Posts: 24

Original Poster
Rep: Reputation: 10
No, they are both valid users. I updated now the original post to focus on the main issue - even with the mapping basically working, /home becomes owned by nobody.

Last edited by poisonborz; 02-20-2021 at 06:18 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
question: 'onclick' within 'onmouseover' within 'form' within 'table' - how is it possible? rblampain Programming 4 04-25-2017 09:49 PM
[SOLVED] "lxc list" vs "lxc-ls" yknivag Linux - Virtualization and Cloud 1 03-09-2017 06:53 AM
How to end a Linux Container (LXC) from within? Skaperen Linux - Virtualization and Cloud 0 06-14-2011 10:37 AM
Can you make any files and folders created within a directory owned by another user?? helptonewbie Linux - Newbie 13 12-14-2007 05:21 PM
Make a file owned by root owned by a user sharpie Linux - Newbie 2 02-26-2004 02:26 AM > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 11:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration