Container namespace isn't visible in ip netns list

I wonder why we can't see the namespaces created by lxc-create on the output of "ip netns list" For example I create a namespace like below

lxc-create -t download -n cont1 -- -d ubuntu -r trusty -a amd64

I don't see this on "ip netns list" however if I add a namespace myself,

root@lin:~# ip netns add test
root@lin:~# ip netns list
test

it is visible.

containers use namespaces but here namespaces created lxc-create are hidden from admin user? Is there any way to list them via ip netns?

Thanks.

1

2 Answers

The ip netns list command displays only namespaces that have been named, by virtue of a corresponding file in /var/run/netns/. Network namespaces can be created without names, though, and are referenced by a file descriptor. (The ip-netns (8) man page mentions this.)

I believe lxc uses unnamed network namespaces. To see them, start a container and run lsns -t net .

You cannot see LXC namespaces using ip netns.

LXCs use a different LXC can be listed by using

% sudo lxc-ls -f

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like