[lxc-users] Viewing processes inside a container

Fajar A. Nugraha list at fajar.net
Wed Feb 25 03:16:59 UTC 2015


On Wed, Feb 25, 2015 at 7:51 AM, Anjali Kulkarni <anjali at juniper.net> wrote:
> Hi,
>
> I started a process within a container, however, when I ‘ps’ the process on
> the host I can see it running. How can one differentiate or check which
> processes are running inside the container?

Try:

* lxc-attach -n container_name -- ps -efa
all pids are relative inside the container, different from the one on the host

* ps -eo pidns,cgroup:50,pid,user,args --sort pidns
this will show additional column, pidns and cgroups
process on the host and the container will have different pidns, and
cgroups column should include the name of the container among other
things.

-- 
Fajar


More information about the lxc-users mailing list