Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@chhaugen
Last active February 28, 2021 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chhaugen/3d04bddd64126b15511c63494d11c4d0 to your computer and use it in GitHub Desktop.
Save chhaugen/3d04bddd64126b15511c63494d11c4d0 to your computer and use it in GitHub Desktop.
Notes that helped me figure out the mapping scheme.
To me, it seams like its supposed to remap all of the containers {u,g}ids.
So the important detail is that all of the containers id need to be maped, not the hosts.
Please correct me if I'm wrong.
I added "symbols" to make the syntax more readable, and some show the result on the nest line.
// https://www.reddit.com/r/homelab/comments/6p3xdw/proxmoxlxc_mount_host_folder_in_an_unprivileged/dkncmrc/
0 -> 100000 x 124
0-123 -> 100000-100123
124 -> 1004 x 1
124-124 -> 1004-1004
125 -> 100125 x 64410
125-65534 -> 100125-165534
// https://pve.proxmox.com/wiki/Unprivileged_LXC_containers#Using_local_directory_bind_mount_points
0 -> 100000 x 1005
0-1004 -> 100000-101004
1005 -> 1005 x 1
1005-1005 -> 1005-1005
1006 -> 101006 x 64530
1006-65535 -> 101006-165535
0 -> 100000 x containerid
containerid -> hostid x 1
containerid+1 -> 100000+containerid x 65535-containerid
123 -> 1200
99 -> 1300
0 -> 100000 x 99
99 -> 99 x 1
100 -> 100100 x 123-99 (24)
123 -> 123 x 1
124 -> 100123 x 65411
c1 -> h1
c2 -> h2
0 -> 100000 x c1
c1 -> h1 x 1
c1+1 -> 100000+(c1+1) x c2-(c1+1)
c2 -> h2 x 1
c2+1 -> 100000+(c2+1) x c3-(c2+1)
c3 -> h3 x 1
c3+1 -> 100000+c3 x 65535-c3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment