Find container based on process (USER id)

Dear all,
I beg appologize if this question duplicated.

I wonder how to find container owns of specific process id (or user id).
I make use of “top” command line to list all process in host server.

top_ss

You can’t really track it based on the user.

Use something that can show you a process tree instead like ps fauxww or the tree option in htop.

Omg, … thanks alot Stéphane…
I got the answer how to find which container running such process.

Thank you very much, I love the simple way you mention on finding the container.

Sincerely,
Dedy Yasriady / Pekanbaru, Indonesia

When using htop, you press F5 to get into Tree view.

Here is an example. The first line is a container called kde (it says: /var/lib/incus/containers kde). There’s a + on that line, which means that I pressed earlier - to hide the processes of that process tree. If I press +, it will show the tree.
The second line shows the full process tree for a container called rss.

1 Like

Excellent… thank you simos,
I follow such instruction to get the container and found it exactly.

Anyway,… thank you very much for kind support from all team here.
I’m new to this group, but we make use of lxd container in our server since years ago.

You all are best …

Sincerely,
Dedy Yasriady/ Pekanbaru, Riau - Indonesia.