[Lxc-users] Problem with lxc-attach on Linux v3.1.0

Nikhil Handigol nikhil.handigol at gmail.com
Wed Sep 7 00:17:37 UTC 2011


Hi,

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:
$ lxc-attach -n foo -- /bin/bash
lxc-attach: No such file or directory - failed to open '/proc/821/ns/pid'
lxc-attach: failed to enter the namespace

More info:

$  uname -a
Linux nf-build2 3.1.0-rc4-with-cfs-dctcp #3 SMP Mon Sep 5 23:56:47 PDT 2011
x86_64 GNU/Linux

I had enabled namespace config while building the kernel:
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y

lxc-checkconfig doesn't seem to show any problems:
lxc-checkconfig
Kernel config /proc/config.gz not found, looking in other places...
Found kernel config file /boot/config-3.1.0-rc4-with-cfs-dctcp
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled

--- Control groups ---
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
File capabilities: enabled

I'm using the latest version of lxc from the git repo:
commit f7b98d38f042c403114fd07187dfe7daed44bdda

I spawn a container using the following command:
$ lxc-execute -n foo -f /etc/mn/host.conf -- /bin/bash
It seems to be working perfectly alright.

$ cat /etc/mn/host.conf
lxc.utsname = mnhost
lxc.network.type = empty
lxc.network.flags = up

$ lxc-ls
foo

I picked a random pid in the system and ran:
$ ls /proc/32157/ns/
ipc  net  uts
("pid" is not present in the directory.)

According to
http://kernelnewbies.org/Linux_3.0#head-69fb31d5d1d284f3a95e56d0ec43a2b23c30c4f3
setns()
is enabled by default from Linux v3.0. So, I did not apply any specific
patches for setns.

Am I doing something wrong? I'd appreciate any help.

Thanks,
Nikhil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20110906/20602a90/attachment.html>


More information about the lxc-users mailing list