[lxc-users] How to apply commands in howtos - macvlan and disk passthrough

John Gubert john.gubert at web.de
Wed Dec 21 12:34:04 UTC 2016


Hi Tycho,

thank you for your fast response.

My id on the host is indeed 1000. I read your blog article and then had
a look at /etc/subuid:

before:
"me at host:~$ cat /etc/subuid
lxd:100000:65536
root:100000:65536
me:165536:65536"

after:
"me at host:~$ cat /etc/subuid
lxd:100000:65536
root:100000:65536
me:165536:65536
root:1000:1"

root seems to be already set up, maybe this is due to lxd being
installed on ubuntu 16.04? It would be really helpful if you could
explain to me what the mapping defined in this file really does. Does it
make a difference if I add your line, or use the one already there? How
does this file use the numbers (100000 and 65536)? Does 1000:1 tell
ubuntu to map the id 1 to 1, if so, what does 100000:65536 mean? Add
65536 to the 100000? If there is a user called "me" in the conatainer,
does a line "me:1000:1" work as well?

I appreciate any help.

with kind regards,
John

P.S.:
I answered to the mailing list, is this the right way to do it, or
should I answer to you directly?


Am 20.12.2016 um 22:52 schrieb Tycho Andersen:
> Hi John,
>
> On Tue, Dec 20, 2016 at 10:39:07PM +0100, john.gubert at web.de wrote:
>>     Hello,
>>      
>>     I have a directory on my host system and want to create several containers
>>     with the same users inside. I would like to pass the directory through to
>>     each container and allow the users to write and read on it. The network
>>     connection should be done using macvlan.
>>     The howtos I have read so far show how to set up lxd, which works very
>>     well on my 16.04 host. Starting a container works out of the box as
>>     unpriviliged user as well.
>>      
>>     My questions:
>>     Is it even possible to share one directory on the host with several
>>     container?
>>     All the howtos I could find mention some commands, that need to be
>>     applied, but they do not tell me about the commands I need to type in to
>>     make it work:
>>      
>>
>>     "That means you can create a container with the following configuration:
>>
>>     lxc.id_map = u 0 100000 65536
>>
>>   lxc.id_map = g 0 100000 65536"
>>
>>     There is a big list of possible options on github, but where does it tell
>>     how to apply them?
>>      
>>     Does someone know a detailed howto, that describes a similiar setup like
>>     mine?
> http://tycho.ws/blog/2016/12/uidmap.html is a blog post I wrote a
> while ago talking about how to set this up with your home directory.
> You can mimic the settings for whatever user map you want, though.
>
> Cheers,
>
> Tycho
>
>>     Every time I read something, I feel like missing something important,
>>     because I could not find a coherent compendium of possible options on how
>>     to do something.
>>      
>>     kind regards,
>>     John
>> _______________________________________________
>> lxc-users mailing list
>> lxc-users at lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-users
>



More information about the lxc-users mailing list