<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 13, 2013 at 11:23 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">Quoting Fajar A. Nugraha (<a href="mailto:list@fajar.net">list@fajar.net</a>):<br>

> On Wed, Nov 13, 2013 at 5:11 PM, Daniel P. Berrange <<a href="mailto:berrange@redhat.com">berrange@redhat.com</a>>wrote:<br>
><br>
> > For a start I think you should update to the curent Fedora 19<br>
> > kernels which are version 3.11.6. Then I'd suggest taking thue<br>
> > Fedora kernel src.rpm and just setting the CONFIG_USER_NS var<br>
> > in its config file, rather than trying navigate the menus.<br>
> ><br>
> > We're not supporting user namespaces in Fedora until at least<br>
> > Fedora 21, since we don't consider the implementation sufficiently<br>
> > mature / secure to enable it sooner.<br>
> ><br>
> ><br>
> Is there an example somewhere on how to enable user namespace in lxc,<br>
> preferably using manual steps? e.g. which lxc configuration directive<br>
> enables it?<br>
<br>
</div></div>For non-libvirt lxc, I've shown a few times a more manual way to do it<br>
on <a href="http://s3hh.wordpress.com" target="_blank">s3hh.wordpress.com</a>, however, the pieces are there now so that you<br>
should be able to just add<br>
<br>
        lxc.id_map = u 0 100000 9999<br>
        lxc.id_map = g 0 100000 9999<br>
<br>
to a copy of /etc/lxc/lxc.conf, then do<br>
<br>
        lxc-create -t ubuntu-cloud -n u1 -f /copy/of/lxc.conf<br>
<br>
I've been focusing on unprivileged creation, and don't think I've<br>
yet pushed the fixes needed for root to be able to do that.   (which<br>
is complicated by newuidmap not letting root use arbitrary subuids)<br>
<br></blockquote><div><br></div><div><br></div><div>Hmmm ... I got this on my system:</div><div>as normal user:</div><div><div>$ lxc-create -t ubuntu-cloud -n u1 -f /etc/lxc/user.conf </div><div>You lack access to /var/lib/lxc</div>
</div><div><br></div><div>... and after editing permission on /var/lib/lxc, I get this</div><div><div>$ lxc-create -t ubuntu-cloud -n u1 -f /etc/lxc/user.conf </div><div>lxc_container: No such file or directory - Failed executing usernsexec</div>
<div>lxc_container: Error chowning /var/lib/lxc/u1/rootfs to container root</div><div><br></div><div>lxc_container: Error creating backing store type (none) for u1</div><div>lxc_container: Error creating container u1</div>
</div><div><br></div><div>a "strace -f" shows it's looking for "lxc-usernsexec", which is not available. Which package has that?</div><div><br></div><div><br></div><div><br></div><div>when testing as root (which, if I read your post correctly, is not possible yet):</div>
<div><div># lxc-create -t ubuntu-cloud -n u1 -f /etc/lxc/user.conf </div><div>ubuntu-cloudimg-query is /usr/bin/ubuntu-cloudimg-query</div><div>wget is /usr/bin/wget</div><div>--2013-11-14 04:34:08--  <a href="https://cloud-images.ubuntu.com/server/releases/raring/release-20131022/ubuntu-13.04-server-cloudimg-amd64-root.tar.gz">https://cloud-images.ubuntu.com/server/releases/raring/release-20131022/ubuntu-13.04-server-cloudimg-amd64-root.tar.gz</a></div>
<div>Resolving <a href="http://cloud-images.ubuntu.com">cloud-images.ubuntu.com</a> (<a href="http://cloud-images.ubuntu.com">cloud-images.ubuntu.com</a>)... 91.189.88.141</div><div>Connecting to <a href="http://cloud-images.ubuntu.com">cloud-images.ubuntu.com</a> (<a href="http://cloud-images.ubuntu.com">cloud-images.ubuntu.com</a>)|91.189.88.141|:443... connected.</div>
<div>HTTP request sent, awaiting response... 302 Found</div><div>Location: <a href="https://cloud-images.ubuntu.com/releases/raring/release-20131022/ubuntu-13.04-server-cloudimg-amd64-root.tar.gz">https://cloud-images.ubuntu.com/releases/raring/release-20131022/ubuntu-13.04-server-cloudimg-amd64-root.tar.gz</a> [following]</div>
<div>--2013-11-14 04:34:10--  <a href="https://cloud-images.ubuntu.com/releases/raring/release-20131022/ubuntu-13.04-server-cloudimg-amd64-root.tar.gz">https://cloud-images.ubuntu.com/releases/raring/release-20131022/ubuntu-13.04-server-cloudimg-amd64-root.tar.gz</a></div>
<div>Reusing existing connection to <a href="http://cloud-images.ubuntu.com:443">cloud-images.ubuntu.com:443</a>.</div><div>HTTP request sent, awaiting response... 200 OK</div><div>Length: 213508744 (204M) [application/x-gzip]</div>
<div>Saving to: ‘ubuntu-13.04-server-cloudimg-amd64-root.tar.gz’</div><div><br></div><div>100%[============================================================================================================>] 213,508,744  503KB/s   in 9m 27s </div>
<div><br></div><div>2013-11-14 04:43:37 (368 KB/s) - ‘ubuntu-13.04-server-cloudimg-amd64-root.tar.gz’ saved [213508744/213508744]</div><div><br></div><div>Extracting container rootfs</div><div>Container u1 created.</div></div>
<div><br></div><div><div># lxc-start -n u1</div><div>lxc-start: Operation not permitted - failed to mount 'proc' on '/usr/lib/x86_64-linux-gnu/lxc/proc'</div><div>lxc-start: failed to setup the mounts for 'u1'</div>
<div>lxc-start: failed to setup the container</div><div>lxc-start: invalid sequence number 1. expected 2</div><div>lxc-start: failed to spawn 'u1'</div></div><div><br></div><div><br></div><div><br></div><div>This is my /etc/lxc/user.conf:</div>
<div><div>lxc.network.type = veth</div><div>lxc.network.link = lxcbr0</div><div>lxc.network.flags = up</div><div><br></div><div>lxc.id_map = u 0 100000 9999</div><div>lxc.id_map = g 0 100000 9999</div></div><div><br></div>
<div><br></div><div>test system is ubuntu raring, lxc 1.0.0~alpha2+master~20131112-2220-0ubuntu1~ppa1~raring1 from daily ppa, linux-image-3.12.0-2-generic from trusty.</div><div><br></div><div>-- </div><div>Fajar</div></div>
</div></div>