[lxc-users] lxc-attach shows hosts root fs instead of containers'

Florian Klink flokli at flokli.de
Tue Feb 25 13:25:10 UTC 2014




Hi Wojtek,

thanks for your answer!

I built a kernel with the same config, but with CONFIG_USER_NS set to "y".

lxc-checkconfig now also reports user namespace as "enabled".


But when I run lxc-attach, I still see the root file system of the host,
not of the container...

So the problem is not user-ns related.

Steps to reproduce:

lxc-create -n ${CONTAINER_NAME} -t archlinux
lxc-start -n ${CONTAINER_NAME}
lxc-attach -n ${CONTAINER_NAME} /bin/bash
# ls -la / # shows hosts root file system!


I was also able to reproduce this problem with a downloaded template
(centos 6 amd64), so it doesn't seem to be archlinux related...


Do you have any ideas how to investigate further?


Florian




Am 25.02.2014 10:46, schrieb Wojtek Arabczyk:
> You failed to enable user namespace (which is clearly stated in the log
> you posted).
> Try enabling the user namespace and retest.
> 
> -- 
> Pozdraviam
> Wojtek
> 
> On Tuesday, 25 February 2014 at 10:34, Florian Klink wrote:
> 
>> Hi,
>>
>> I created a basic archlinux container (using almost the template):
>>
>> lxc-create -n test -t archlinux
>>
>> I now start the container
>>
>> lxc-start -n test
>>
>> In another shell, I attach inside it:
>>
>> lxc-attach -n test [/bin/bash]
>>
>> And I see the root file system of the host!
>>
>> However, when I get into the machine by logging in from the lxc-start
>> command, I see the correct root of the container.
>>
>> Some information about my system:
>>
>> -----
>> lxc-1.0.0
>> linux x86_64 3.13.5-1-zen
>>
>> --- Namespaces ---
>> Namespaces: enabled
>> Utsname namespace: enabled
>> Ipc namespace: enabled
>> Pid namespace: enabled
>> User namespace: missing
>> 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
>>
>> -----
>>
>> Looks like lxc-attach is unable to attach the MOUNT namespace? Or whats
>> the problem here?
>>
>> Florian
>>
>>
>> _______________________________________________
>> lxc-users mailing list
>> lxc-users at lists.linuxcontainers.org
>> <mailto:lxc-users at lists.linuxcontainers.org>
>> http://lists.linuxcontainers.org/listinfo/lxc-users
> 
> 
> 





More information about the lxc-users mailing list