<div dir="ltr">Hi,<div><br></div><div>I'm running lxc-1.0.6-r1 on Gentoo.  I can create my lxc container and ssh into it and everything looks fine.</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>lxc-create -n u1 -t download -- --no-validate --dist ubuntu --release trusty --arch amd64</div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>lxc-start -n u1</div></blockquote><div><br></div><div>However, lxc-attach runs programs in the host's root, not in the container root:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>lxc-attach -n u1 ls /tmp</div><div><br></div></blockquote>This lists files in the *hosts* /tmp.  The guest's /tmp is empty<div><br></div><div>Looking at /proc/$PID/mountinfo in host and guest, I see that processes created inside the guest are chrooted to the right place:</div><div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">(in lxc guest, init is chrooted)</blockquote></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div>head -1 /proc/1/mountinfo </div><div>81 124 0:2 /etc/lxc/u1/rootfs / rw - rootfs rootfs rw,size=16332604k,nr_inodes=4083151</div></div></div><div><br></div></blockquote><div>However, programs run by lxc-attach are not chrooted</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div>lxc-attach -n u1 -- head -1 /proc/self/mountinfo</div></div></div><div><div><div>82 82 0:2 / / rw - rootfs rootfs rw,size=16332604k,nr_inodes=4083151</div></div></div></blockquote><div><div><div><br></div></div></div><div>What config options could break this?</div><div><br></div><div>I created a small program that just does nsexec [1], and it has the same behaviour.  somehow, setns() is not setting the root fs properly using processes running in lxc.</div><div><br></div><div><br></div><div>[1] <a href="https://gist.github.com/noelbk/b6964f8c55d5f6258819">https://gist.github.com/noelbk/b6964f8c55d5f6258819</a></div><div><br></div><div><br></div><div>PS<br></div><div>This all works fine on stock ubuntu-14.04/<br></div><div><br></div><div>Cheers,</div><div>--</div><div>Noel</div><div><br></div></div>