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 amd64I 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
testit 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.
12 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