sysbox
sysbox copied to clipboard
mismatching subuid and subgids range
After installing from source on latest master (7e221e0f540793277caeeee4b09b14ad4c0970b2), I was hitting the following error:
failed to create sysbox-mgr: failed to setup subid allocator: could not find matching subuid and subgids range for user sysbox.
It seems that sysbox-mgr generated two different ranges in /etc/subuid and /etc/subgid - if I understand the code here correctly, the ranges should be identical to be accepted.
So, I think there are a few issues here;
sysbox-mgrshould not generate mismatching ranges.- I could not find this requirement in the documentation or troubleshooting guide.
- The error message also feels a bit misleading: I interpreted it as that no subuid and subgids ranges were fond matching the user sysbox.
With some directions, I'd be happy to help resolve this!
Hi @iasoon,
Thanks for giving Sysbox a shot.
Can you post the contents of your host's /etc/subuid and /etc/subgid files?
Hi @ctalledo, sorry about the delay!
/etc/subuid:
iasoon:1000:1
sysbox:1001:65536
/etc/subgid:
iasoon:982:1
sysbox:983:65536
The top line was already present in the file before running the generation. I'm guessing this is what's causing the issue?
after changing the subgid range to 1001:65536, sysbox-mgr starts successfully.
Hi @iasoon,
Thanks for sending the info. A couple of comments:
- The sub[uid|gid] range for user
sysboxshould normally start above 65535. That way, it does not collide with the normal user range (0->65535) in the Linux host. It would still allow you to mount host files into the container, and they will show up with the proper uids inside (see here).
For example, in my host user sysbox is assigned the range starting at 165536, with a size of 65536 (i.e., range 165536 -> 231071).
cesar@whaleux:~$ cat /etc/subuid
cesar:100000:65536
sysbox:165536:65536
cesar@whaleux:~$ cat /etc/subgid
cesar:100000:65536
sysbox:165536:65536
- The ranges for user
sysboxshould be identical in/etc/subuidand/etc/subgid.
Normally, Sysbox configures the /etc/sub[uid|gid] files when it starts. That is, it adds user sysbox to the files if not present, or otherwise checks that the range for that user is configured correctly. The entity that does this is sysbox-mgr, the source code is here.
Hope that helps!