"who" command does not show all users logged in the containers

Hi, I was wondering if there is any way to show all the users currently logged in the containers in the host?

I’ve tried the “who” command on the host, but it only shows the users logged on the host machine, while the users logged in the containers cannot be displayed.

My solution is to write a script to do “lxc exec CONTAINER_NAME who” to all the containers on the host, but it is a bit annoying…

Are there any better solutions? thx :slight_smile:

That sounds like a reasonable way to approach it.

LXD containers are isolated from the host’s namespaces, so as you’ve seen user sessions don’t show on the host.