If I understand the lxc code right, it's failing in the function get_cgroup_mount in src/lxc/cgroup.c, which tries to read the cgroup mount point from /proc/mounts.<div><br></div><div>/proc/mount seems to be fine on my machine:</div>
<div>$ cat /proc/mounts</div><div>...</div><div>...</div><div><div>cgroup /cgroup cgroup rw,relatime,blkio,net_cls,freezer,devices,memory,cpuacct,cpu,debug,cpuset,clone_children 0 0</div></div><div><br></div><div><br></div>
<div>The cgroup entry is present, but it seems it's unable to open /proc/mounts. <br clear="all"><br></div><div>-/\/<br>
<br><br><div class="gmail_quote">On Thu, Sep 8, 2011 at 1:16 PM, Nikhil Handigol <span dir="ltr"><<a href="mailto:nikhil.handigol@gmail.com" target="_blank">nikhil.handigol@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Ah! That was something I had missed. I recompiled lxc with the --with-linuxdir option and the old error went away. <div><br></div><div>Now I'm getting the following error:</div><div><div>$ lxc-attach -n foo -- /bin/bash </div>



<div>lxc-attach: No such file or directory - failed to open /proc/mounts</div><div>lxc-attach: cgroup is not mounted</div><div>lxc-attach: No such file or directory - failed to get cgroup path for cgroup foo</div><div><br>



</div><div>On my machine, cgroup is mounted on /cgroup via the following command:</div>mount -t cgroup cgroup /cgroup<div><br></div><div>It looks like I also need to specify where cgroup is mounted? How do I do that?</div>


<div>(I think we're close to getting this to work)</div><div><br></div><div>Thanks,<br clear="all">
-/\/<div><div></div><div><br>
<br><br><div class="gmail_quote">On Thu, Sep 8, 2011 at 1:07 PM, Daniel Lezcano <span dir="ltr"><<a href="mailto:daniel.lezcano@free.fr" target="_blank">daniel.lezcano@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div>On 09/08/2011 07:12 PM, Nikhil Handigol wrote:<br>
> It is indeed the case:<br>
><br>
> $ type lxc-attach<br>
> lxc-attach is /usr/local/bin/lxc-attach<br>
<br>
</div>Ok.<br>
<br>
Did you specified the kernel source tree when invoking configure ?<br>
<br>
It is the --with-linuxdir=<path_to_the_patched_kernel><br>
<br>
Make sure to remove src/lxc/setns.h file which is automatically generated.<br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br>
</div>