How to get host pid of a process running in gvisor sandbox?

Skip to first unread message


Nov 29, 2020, 3:24:41 AM11/29/20
to gVisor Users [Public]

I want to get the host PID of a process that runs in the gvisor sandbox. But the information about processes running in the sandbox is the same in the host. It can't help me distinguish them.

Also, the method `docker inspect -f '{{.State.Pid}}' <container>` only can get the host PID of the sandbox. And `/sys/fs/cgroup/memory/docker/<container>/cgroup.procs` just provides all host PID in this container, which cannot provide the mapping relation.

So, is there possible that we can get a mapping relation of process PID between sandbox and host?


Ian Lewis

Nov 29, 2020, 7:50:05 PM11/29/20
to zl, gVisor Users [Public]
There isn't really a way of getting the host PID of a container because it's a platform specific implementation detail. I assume you're using ptrace, but with KVM for example you won't see host PIDs for each container.

Is there a specific reason you want this information?

You received this message because you are subscribed to the Google Groups "gVisor Users [Public]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit


Ian Lewis | Developer Advocate | | +81 (03)4540-2465

Reply all
Reply to author
0 new messages