<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 27, 2017 at 8:12 AM, T.C 吳天健 <span dir="ltr"><<a href="mailto:tcwu2005@gmail.com" target="_blank">tcwu2005@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">What's the trick of building unprivileged container rootfs by the way ?</div></blockquote><div><br></div><div><br></div><div>I believe the answer is "you don't".</div><div>Build the images privileged, then shift the uids when used as unpriv.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto">I guess device files permission might matters, any others ?</div></div><div class="gmail_extra"><br></div></blockquote><div><br></div><div>- build rootfs (e.g. using image, template, convert existing VM, or whatever method you choose) as root. This includes creating necessary device nodes.</div><div>- (optional) create a tar archive, or publish it as lxd image</div><div>- change file u/gids using fuidshift (or similar tools): <br><a href="http://packages.ubuntu.com/xenial-backports/amd64/lxd-tools/filelist">http://packages.ubuntu.com/xenial-backports/amd64/lxd-tools/filelist</a> <br><a href="http://manpages.ubuntu.com/manpages/xenial/man1/fuidshift.1.html">http://manpages.ubuntu.com/manpages/xenial/man1/fuidshift.1.html</a><br></div><div><br></div><div>-- </div><div>Fajar</div></div></div></div>