0

I inspected the symlinks in an Ubuntu VM for the namespace related directories under /proc/PID/ns. I see all the links are in red color.

enter image description here

I even tried to test using unshare to see if I can create a new namespace. I tested using mount namespace and a new namespace is assigned to the new process.

root@VM:/# ll /proc/$$/ns
total 0
dr-x--x--x 2 root root 0 Apr 21 01:56 ./
dr-xr-xr-x 9 root root 0 Apr 21 01:56 ../
lrwxrwxrwx 1 root root 0 Apr 21 01:56 cgroup -> cgroup:[4026531835]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 ipc -> ipc:[4026531839]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 ** mnt -> mnt:[4026531840] **
lrwxrwxrwx 1 root root 0 Apr 21 01:56 net -> net:[4026531957]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 pid -> pid:[4026531836]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 user -> user:[4026531837]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 uts -> uts:[4026531838]
root@VM:/# 
root@VM:/# unshare --mount
root@VM:/# 
root@VM:/# ll /proc/$$/ns
total 0
dr-x--x--x 2 root root 0 Apr 21 01:56 ./
dr-xr-xr-x 9 root root 0 Apr 21 01:56 ../
lrwxrwxrwx 1 root root 0 Apr 21 01:56 cgroup -> cgroup:[4026531835]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 ipc -> ipc:[4026531839]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 ** mnt -> mnt:[4026532226] **
lrwxrwxrwx 1 root root 0 Apr 21 01:56 net -> net:[4026531957]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 pid -> pid:[4026531836]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 user -> user:[4026531837]
lrwxrwxrwx 1 root root 0 Apr 21 01:56 uts -> uts:[4026531838]

Can anyone tell why the symlinks are in red ? Does this mean the namespace feature is not working ?

3

This is ls’ representation of broken symlinks; see What does a red-colored filename mean?

The fact that the links are red, or even that the symlinks are broken, doesn’t imply anything with regard to whether namespaces are working or not; it’s only related to the namespace representation in /proc. The existence of the files means that the corresponding namespaces are set up, and presumably working correctly.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.