Questions tagged [namespace]

Questions relating to Linux namespaces, including commands such as: unshare and ip netns. Namespaces support isolation of filesystems, system names, IPC, processes, networks, and users. Closely related to the docker and lxc tags; use those tags instead of this one if you are simply using docker or lxc to implement namespaces.

Old techniques like chroot are focused on filesystem isolation, but with namespaces, the focus is to isolate other OS layers like PIDs, users, IPC, networking, creating a "virtual OS" with a new group of pids, a new set of users, a completely unshared IPC system (semaphores, shared memory etc.), a dedicated network interface and its own hostname.

Further Reading:

  • ip-netns manpage. The network namespace related iproute2 command.
  • LWN article about network namespaces and a review on other linux namespaces.
  • Explanation about Linux namespaces.
280 questions
2
votes
1 answer

Create new process namespace with existing mount namespace

I'm having trouble figuring out how to create a new process namespace once I exit from the one created by unshare. So, for example, I have the following. unshare -f --mount-proc --mount=/containers/1/ns/mnt --pid=/containers/1/ns/pid And in another…
Todd
  • 141
2
votes
1 answer

Namespace numbers in /proc

I am checking the namespaces associated with a shell process as follows: # ll /proc/$$/ns total 0 dr-x--x--x 2 root root 0 May 2 15:10 ./ dr-xr-xr-x 9 root root 0 May 1 18:39 ../ lrwxrwxrwx 1 root root 0 May 2 15:11 cgroup ->…
Jake
  • 1,353
2
votes
0 answers

What are the ways and risks of using linux namespaces as nonroot user?

I know unshare and nsenter are userland tools to work with linux namespaces. Since I, as much as possible, try to avoid working with root priveledges enabled, I often run into troubles with those tools unshare yielding me some "permissions denied".…
0
votes
0 answers

User namespace error - /dev/pts mode change

I am doing a simple test on user namespace on Ubuntu 16.04 as shown below. root@PC:/# root@PC:/# unshare --user --map-root-user mesg: change /dev/pts/2 mode failed: Operation not permitted root@PC:/# I want to ask if anyone knows why the error…
Jake
  • 1,353
0
votes
2 answers

Distinguish the name and namespace

Reference to 'namespace', in Namespace - Wikipedia: In computing, a namespace is a set of symbols that are used to organize objects of various kinds, so that these objects may be referred to by name. Prominent examples include: file systems…
Wizard
  • 2,503
-2
votes
1 answer

How to create a user namespace in Ubuntu?

I want to create namespaces with and without the privilege and need to study the implications if the namespace creation is restricted only for the privileged users. How to create a user namespace in Ubuntu 18.04LTS. Which command I should use?
Franc
  • 289