I have my LXC container running on ubuntu-20.04 machine. Many processed are running inside the container. On running “top” and “ps” command inside the container I can see the processes running inside the container with specific PID.
If I use the “ps” commands (for any process running inside the container) on host i.e outside the container I could see the processes running inside the container but with different PIDs. It looks something like those processes are running on my host machine. And, If I stop my container and check with the “ps” command then the process will also disappear on host machine.
I am not understanding how and why does this is happening actually. Hoe really the processes inside the container are mapped? Is this really normal to see the process outside the container with different PID?
On using “ps -eaf” command I could see all the processes that are running inside the conrtainers are being shown on the host machine with differrent username something like “1000000”.
$: ps -eaf
on host machine:
#: ps -eaf
inside the container
Here we could see that same processes both inside the container and on host machine but with different PID and user. Is container really performing the virtualization here?
Can anybody help me on understanding this scenario? Any inputs will help me a lot.