Follow-up to Bug #1300369: Server guide misleading/incorrect

Bug #1571135 reported by paranoya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Server Guide
Fix Released
Medium
Doug Smythies

Bug Description

Following the instructions in the server guide for basic unprivileged usage for LXC containers I get the following error message:

newuidmap: uid range [0-1) -> [100000-100001) not allowed
error mapping child
setgid: Invalid argument
lxc-create: lxccontainer.c: do_create_container_dir: 978 Failed to chown container dir
lxc-create: lxc_create.c: main: 316 Error creating container u1

The guide states "The example below assumes that your mapped user and group id ranges are 100000-165536." Unfortunately it is nowhere explained, how to do that mapping.

System is Ubuntu Server 16.04.

Related branches

Changed in serverguide:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Serge Hallyn (serge-hallyn)
Revision history for this message
Doug Smythies (dsmythies) wrote :

Is this a problem with the documentation or a problem with the default mapped user and group ranges?
In 14.04 the default user range is 100000:65536.
In 16.04 the default user range seems to be 165536:65536

14.04:
doug@serv-tt:~$ cat /etc/subgid
doug:100000:65536
doug@serv-tt:~$ cat /etc/subuid
doug:100000:65536

16.04:
doug@serv64-dev:~$ cat /etc/subuid
lxd:100000:65536
root:100000:65536
doug:165536:65536
doug@serv64-dev:~$ cat /etc/subgid
lxd:100000:65536
root:100000:65536
doug:165536:65536

When creating ~/.config/lxc/default.conf, if I use the appropriate range, then the lxc-create step works fine.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Hi Doug,

no the bug sadly is that the documentation should not assume pre-determined defaults. Nice as it would be...

Revision history for this message
Doug Smythies (dsmythies) wrote :

O.K. so how about this:

The example below assumes that your mapped user and group id ranges are 100000-165536. Check your actual user and group id ranges and modify the example accordingly:

grep $USER /etc/subuid
grep $USER /etc/subgid

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Actually, the documentation is not wrong. subuids are in fact still started at 100000, it's just that in xenial cloud instances the first allocation goes to lxd/root.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Also, the 'User namespaces' section says:

 The list of assigned ids can be seen in the files
      <filename>/etc/subuid</filename> and <filename>/etc/subgid</filename>
      See their respective manpages for more information.
      </para>

If you think it can be clarified please do submit a merge proposal.

Changed in serverguide:
status: Triaged → Invalid
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Sorry, Doug, didn't see your update before I changed the status.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Your suggestion sounds good. Do you want to push it, or would you prefer I do it?

Revision history for this message
Doug Smythies (dsmythies) wrote :

Serge, I agree that this bug report could be set to invalid, as everything that is needed is actually there. However, having struggled through it yesterday, I think adding lookup as per my comment 3 would be worthwhile. I'll do the edit.

Changed in serverguide:
status: Invalid → In Progress
assignee: Serge Hallyn (serge-hallyn) → Doug Smythies (dsmythies)
Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1571135] Re: Follow-up to Bug #1300369: Server guide misleading/incorrect

Thanks, Doug.

Changed in serverguide:
status: In Progress → Fix Committed
Changed in serverguide:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.