For questions regarding Linux kernel's namespaces mechanism.
Questions tagged [linux-namespaces]
143 questions
2
votes
1 answer
unshare command doesn't create new PID namespace
I'm learning linux core and I'm on the namepsaces topic now.
I tried to play with "unshare" command just to get hang of namespace and its essentials.
The problem is that it doesn't or, what is more probable, I'm doing something wrong.
I'd appreciate…

Andrew Bolotov
- 99
- 5
2
votes
1 answer
Docker run - how to share UTS namespace between containers?
Docker run command by default uses a dedicated UTS namespace for the container and because of it the container gets its own/unique hostname. I am trying to share the UTS namespace between two containers but it seems that it is not possible with…

Anand Patel
- 6,031
- 11
- 48
- 67
2
votes
2 answers
How to launch container with user namespace configuration?
In the below docker file, base image(jenkins/jenkins) is providing a user jenkins with UID 1000 and GID 1000, within container.
FROM jenkins/jenkins
# Install some base packages
# Use non-privileged user provided by base image
USER jenkins # with…

overexchange
- 15,768
- 30
- 152
- 347
2
votes
1 answer
How can i create more network namespace?
How to use unshare(), clone() to create lots of network namespace in linux?

DaVid
- 287
- 1
- 2
- 10
2
votes
1 answer
Cannot open uid_map for writing from an app with cap_setuid capability set
While toying around with an example from user_namespaces(7), I've come across a strange behaviour.
What the application does
The application user-ns-ex calls clone(2) with CLONE_NEWUSER, thus creating a new process in a new user namespace. The…

Arks
- 569
- 5
- 19
2
votes
0 answers
Create a new system namespace for a process in python
How can I change the system namespace value of a process created by subprocess.Popen in Linux environment?
Need to set following namespaces just after subprocess.Popen(sys.argv[1:])
syscall.CLONE_NEWUTS
syscall.CLONE_NEWPID
syscall.CLONE_NEWNS

Arush Salil
- 163
- 2
- 10
2
votes
2 answers
Side effects of allowing a container to listen on port 80
To simplify service port management between Docker containers I would like to allow the contained HTTP services to listen on HTTP's default TCP port 80 of their respective container's IP address.
Listening to port numbers below 1025 is classically…

aef
- 4,498
- 7
- 26
- 44
2
votes
2 answers
Run multiple commands in network namespace
I'd like to run a series of concatenated bash commands in a network namespace in one single step, but it seems that ip netns exec mynetns only takes one bash command as argument.
For instance:
ip netns exec mynetns ip a
...works as expected.
ip…

Ricky Robinson
- 21,798
- 42
- 129
- 185
2
votes
0 answers
What is the significance of the user in `/etc/sub{u,g}id`? (Help me grok user namespaces)
I would like to ensure that any user inside my docker container always maps to a specific user on my docker host. I have tried using this reference https://stackoverflow.com/a/35854547/1020678
The user name in /etc/subuid seems to be used strictly…

jollyroger
- 659
- 1
- 10
- 19
2
votes
0 answers
Failing example with LWN's "Namespaces in operation, part 4: more on PID namespaces"
The final example from this article fails to work as intended. This is the code:
simple_init.c
ns_child_exec.c
orphan.c
ns_run.c
My environment is Fedora 24, and this is the output I should receive:
# ./ns_child_exec -p ./simple_init -v
init:…

user19087
- 1,899
- 1
- 16
- 21
2
votes
2 answers
Listing all Linux net namespaces by name from inside the Kernel
I need some good examples on how to obtain the NAME of a net namespace from inside the kernel. Getting device names is straightforward but it's not so obvious for net namespaces. Does anyone know a simple method to get the
net namespace name from…

Jeff Merkey
- 93
- 4
2
votes
1 answer
Share state between processes in different network namespaces
Updating the question with more information:
I have 32 network namespaces on a Linux Ubuntu 14.04 box, and a C program
runs in each namespace. I want the program to be able to share some data
with it's siblings in other namespaces (not threads,…

user2511788
- 139
- 1
- 1
- 8
2
votes
1 answer
what is the purpose of tasks member of 'struct pid' defined in Linux/include/linux/pid.h?
Im trying to understand better how the kernel implement pid namespace .
One of the basic structure that is being used is struct pid :
struct pid {
atomic_t count;
unsigned int level;
/* lists of tasks that use this pid */
…

nadavgam
- 2,014
- 5
- 20
- 48
1
vote
0 answers
How to create the docker0 bridge in another network namespace then the default one?
On a server I have an environment with different network namespaces that are created with the command sudo ip netns add ns_name. The physical interfaces of the server get assigned to different namespaces, in the "default" network namespace remains…

ArdalNelson
- 11
- 1
1
vote
3 answers
ERROR: Failed to create user namespace: user namespace disabled - even after disabling setuid in singularity.conf manually
I have to run a singularity.tif file, but it gives me this error:
FATAL [U=1092,P=58809] execStarter() while extracting /net/beegfs/scratch/avanbeelen/beta-version-wgs-pipeline/cnv-tools-scripts/clinSV-0.9/clinsv.sif: root filesystem…

Aron van Beelen
- 33
- 5