Why doesn't htop show my docker-processes using wsl2

Viewed 767
2 Answers

Docker does not run in your default WSL-distro, but in a special Docker-Wsl-distro. Running wsl -l shows the installed distros:

Ubuntu (Standard)
docker-desktop
docker-desktop-data

Docker desktop is based on alpine and you can run top right out of the box:

wsl -d docker-desktop top

If you want htop, you need to install it first:

wsl -d docker-desktop apk update 
wsl -d docker-desktop apk add htop

Running

wsl -d docker-desktop htop

will now give you a nice overview of what is happening in your docker-containers:

htop showing docker processes

I agree with @Morty.

The following commands give you the list for windows

wsl -l

Then you can run either of the following command

wsl -d  docker-desktop ps
wsl -d  docker-desktop top
Related