<div dir="ltr">Hello,<div style>Thanks a lot for your very detailed answer and quick response!</div><div style><br></div><div style>Best,</div><div style>Andy</div><div style><br></div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Fri, Apr 19, 2013 at 5:18 PM, Serge Hallyn <span dir="ltr"><<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Quoting Andy Johnson (<a href="mailto:johnsonzjo@gmail.com">johnsonzjo@gmail.com</a>):<br>
> Hello,<br>
><br>
> Question about namespaces and lxc:<br>
><br>
> I see that there is a tool named lxc-unshare, which is (according to<br>
> <a href="https://help.ubuntu.com/12.04/serverguide/lxc.html" target="_blank">https://help.ubuntu.com/12.04/serverguide/lxc.html</a>) for<br>
> testing and in fact calls the clone() syscall (via lxc_clone())<br>
> and not via the unshare() syscall.<br>
<br>
</div>lxc-unshare will be deprecated soon, as there is a 'unshare' command<br>
in util-linux.<br>
<div class="im"><br>
> While looking in the code for namespaces usage, I saw that in<br>
> lxc_attach_to_ns()<br>
> there is a call to setns(). But I am not sure as to whether this is used.<br>
<br>
</div>clone and unshare create new namespaces.  setns() attaches to an<br>
existing namespace.<br>
<div class="im"><br>
> Usage of cgroups in lxc is known.<br>
><br>
> Regarding namesapces: does lxc support all six namesapaces ? are there<br>
> examples<br>
>  of *.conf file/links for using namespaces ?<br>
<br>
</div>All namespaces are used.  uts, pid, ipc and mounts are always unshared.<br>
netns is not unshared if you don't specify any 'lxc.network.type' in<br>
your .conf.  user is not unshared if you don't list any lxc.id_map<br>
entries.  Both are described in the lxc.conf(5) man page.<br>
<div class="im"><br>
> is there support for user<br>
> namespace ?<br>
<br>
</div>Very basic support - for creating a mapped user namespace when starting<br>
as the root user - is there.  More advanced support for user namespace<br>
is in the works.  In particular we want unprivileged users to be able<br>
to create and start containers in user namespaces, but there is work<br>
left to be done.<br>
<br>
<a href="http://s3hh.wordpress.com/2012/10/31/full-ubuntu-container-confined-in-a-user-namespace/" target="_blank">http://s3hh.wordpress.com/2012/10/31/full-ubuntu-container-confined-in-a-user-namespace/</a><br>
<a href="http://s3hh.wordpress.com/2013/03/07/experimenting-with-user-namespaces/" target="_blank">http://s3hh.wordpress.com/2013/03/07/experimenting-with-user-namespaces/</a><br>
<a href="http://s3hh.wordpress.com/2013/02/12/user-namespaces-lxc-meeting/" target="_blank">http://s3hh.wordpress.com/2013/02/12/user-namespaces-lxc-meeting/</a><br>
<br>
The last link in particular leads to some discussion of where we want<br>
to go and what's left to do.<br>
<span class="HOEnZb"><font color="#888888"><br>
-serge<br>
</font></span></blockquote></div><br></div>