Hi,<div><br></div><div>I have been facing problems getting lxc (more specifically, lxc-attach) to work on Linux v3.1.0-rc4. When I run lxc-attach, I get the following error:</div><div>$ lxc-attach -n foo -- /bin/bash </div>
<div>lxc-attach: No such file or directory - failed to open '/proc/821/ns/pid'</div><div>lxc-attach: failed to enter the namespace</div><div><br></div><div>More info:</div><div><br></div><div>$  uname -a</div><div>
Linux nf-build2 3.1.0-rc4-with-cfs-dctcp #3 SMP Mon Sep 5 23:56:47 PDT 2011 x86_64 GNU/Linux</div><div> </div><div>I had enabled namespace config while building the kernel:</div><div><div>CONFIG_NAMESPACES=y</div><div>CONFIG_UTS_NS=y</div>
<div>CONFIG_IPC_NS=y</div><div>CONFIG_USER_NS=y</div><div>CONFIG_PID_NS=y</div><div>CONFIG_NET_NS=y</div></div><div><br></div><div>lxc-checkconfig doesn't seem to show any problems:</div><div><div>lxc-checkconfig </div>
<div>Kernel config /proc/config.gz not found, looking in other places...</div><div>Found kernel config file /boot/config-3.1.0-rc4-with-cfs-dctcp</div><div>--- Namespaces ---</div><div>Namespaces: enabled</div><div>Utsname namespace: enabled</div>
<div>Ipc namespace: enabled</div><div>Pid namespace: enabled</div><div>User namespace: enabled</div><div>Network namespace: enabled</div><div>Multiple /dev/pts instances: enabled</div><div><br></div><div>--- Control groups ---</div>
<div>Cgroup: enabled</div><div>Cgroup clone_children flag: enabled</div><div>Cgroup device: enabled</div><div>Cgroup sched: enabled</div><div>Cgroup cpu account: enabled</div><div>Cgroup memory controller: enabled</div><div>
Cgroup cpuset: enabled</div><div><br></div><div>--- Misc ---</div><div>Veth pair device: enabled</div><div>Macvlan: enabled</div><div>Vlan: enabled</div><div>File capabilities: enabled</div></div><div><br></div><div>I'm using the latest version of lxc from the git repo:</div>
<div>commit f7b98d38f042c403114fd07187dfe7daed44bdda</div><div><br></div><div>I spawn a container using the following command:</div><div>$ lxc-execute -n foo -f /etc/mn/host.conf -- /bin/bash</div><div>It seems to be working perfectly alright.</div>
<div><br></div><div>$ cat /etc/mn/host.conf </div><div>lxc.utsname = mnhost</div><div>lxc.network.type = empty</div><div>lxc.network.flags = up</div><div><br></div><div>$ lxc-ls</div><div>foo</div><div><br></div><div>I picked a random pid in the system and ran:</div>
<div>$ ls /proc/32157/ns/</div><div>ipc  net  uts</div><div>("pid" is not present in the directory.)</div><div><br></div><div><div>According to <a href="http://kernelnewbies.org/Linux_3.0#head-69fb31d5d1d284f3a95e56d0ec43a2b23c30c4f3">http://kernelnewbies.org/Linux_3.0#head-69fb31d5d1d284f3a95e56d0ec43a2b23c30c4f3</a> setns() is enabled by default from Linux v3.0. So, I did not apply any specific patches for setns.</div>
</div><div><br></div><div>Am I doing something wrong? I'd appreciate any help.</div><div><br></div><div>Thanks,</div><div>Nikhil</div>