[TUTORIAL] LXC ID mapping tool

hywax

New Member
Mar 12, 2024
1
2
3
Hi everyone, ran into a problem with ID mapping. And there's pretty little useful information on the web, and especially online tools. I gathered a lot of information, did some testing and made my own online mapper. It makes life very much easier, the tool is completely free! Who needs it, use it!

⚡ Try online
⭐ Star on Github (I would be very grateful for a star)

How do you generate the mapping?
  1. Go to the ⚡ online instrument
  2. Enter the required mappings
  3. Edit the files and insert the generated data
Example:
  • 44:44
  • 107:104
Output:
Code:
# Add to /etc/pve/lxc/%id%.conf:
lxc.idmap: u 0 100000 44
lxc.idmap: g 0 100000 44
lxc.idmap: u 44 44 1
lxc.idmap: g 44 44 1
lxc.idmap: u 45 100045 63
lxc.idmap: g 45 100045 63
lxc.idmap: u 107 104 1
lxc.idmap: g 107 104 1
lxc.idmap: u 108 100108 65428
lxc.idmap: g 108 100108 65428

# Add to /etc/subuid:
root:44:1
root:104:1

# Add to /etc/subgid:
root:44:1
root:104:1
 
  • Like
Reactions: alkaizer and Dunuin
Hi everyone, ran into a problem with ID mapping. And there's pretty little useful information on the web, and especially online tools. I gathered a lot of information, did some testing and made my own online mapper. It makes life very much easier, the tool is completely free! Who needs it, use it!

⚡ Try online
⭐ Star on Github (I would be very grateful for a star)

How do you generate the mapping?
  1. Go to the ⚡ online instrument
  2. Enter the required mappings
  3. Edit the files and insert the generated data
Example:
  • 44:44
  • 107:104
Output:
Code:
# Add to /etc/pve/lxc/%id%.conf:
lxc.idmap: u 0 100000 44
lxc.idmap: g 0 100000 44
lxc.idmap: u 44 44 1
lxc.idmap: g 44 44 1
lxc.idmap: u 45 100045 63
lxc.idmap: g 45 100045 63
lxc.idmap: u 107 104 1
lxc.idmap: g 107 104 1
lxc.idmap: u 108 100108 65428
lxc.idmap: g 108 100108 65428

# Add to /etc/subuid:
root:44:1
root:104:1

# Add to /etc/subgid:
root:44:1
root:104:1
Hey this is a great tool but I just want to point out that when putting in the uid or gid the output is flipped. For example ill fill out 104 for the host id and 106 for the client id but the output will show this

Code:
lxc.idmap: u 0 100000 104
lxc.idmap: g 0 100000 104
lxc.idmap: u 104 106 1
lxc.idmap: g 104 106 1
lxc.idmap: u 105 100105 65431
lxc.idmap: g 105 100105 65431

but the numbers on the left should be the client id and the numbers in the middle should be the numbers of the host it

the subuid and subgid are also outputting the wrong id and showing the client id instead of the host id
 

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!