[lxc-users] Proper Syntax for Setting raw.idmap for a container

Gaétan QUENTIN gaetan.quentin at gmail.com
Mon Mar 27 16:36:17 UTC 2017


in a LXD container, the syntax is:

lxc config set mycontainer   raw.idmap 'both 1003 1003'

as idmap  is a blob, i you want assign multiple values, you have to send
multilines:

echo -e "both 1003 1003\nboth 1004 1004" | lxc config set mycontainer
raw.idmap -


2017-03-27 15:28 GMT+02:00 Serge E. Hallyn <serge at hallyn.com>:

> On Tue, Feb 21, 2017 at 09:57:33PM -0800, Dan Miller wrote:
> > I'm following the procedure for mounting a host drive inside an lxc
> > container as described here:
> > https://insights.ubuntu.com/2016/12/08/mounting-your-home-
> directory-in-lxd/.
> >
> > In that article the author sets the raw.idmap like this:
> >
> > lxc config set zesty raw.idmap 'both 1000 1000'
> >
> > I want to customize the mapping for gid and uid as described in the
> > lxd raw.idmap documentation. Which shows a sample mapping as this:
> >
> > both 1000 1000
> > uid 50-60 500-510
> > gid 10000-110000 10000-20000
> >
> > I'm struggling with the syntax for actually setting this on my
> > container, as it doesn't seem as though the command in the article
> > works for multi-line configurations, and I've tried entering it all on
> > a single line and by using JSON, but no luck, the container gives
> > configuration errors and won't start.
> >
> > What is the correct way to configure this property?
>
> I remember having some trouble too when I tried it out.  @stgraber,
> do you have any insight here?
>
> IIRC I ended up using raw.lxc: lxc.id_map = ...  for what I was doing.
>
> thanks,
> -serge
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users




-- 
Gaétan QUENTIN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170327/702cc979/attachment.html>


More information about the lxc-users mailing list