I am trying to create a child process with Python under a new Linux namespace. But checking the subprocess documentation it does not seem as though Python actually has an API to do so. The closest thing I found is the unshare method in the os module (here). But that seems to require these steps: Create a child process in the same namespace as the current parent Run unshare isolate the child process Run the command(s) we wanted in the child process That's not quite the same as creating an isolated process to start with. Is there indeed no simple API in Python for this? As an example, here is the analogous code in Go: cmd := exec.Command(...) cmd.SysProcAttr = &syscall.SysProcAttr { Cloneflags: syscall.CLONE_NEWUTS } cmd.Run() The question is how to achieve the same with Python. Continue reading...