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

Serge E. Hallyn serge at hallyn.com
Mon Mar 27 13:28:07 UTC 2017


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


More information about the lxc-users mailing list