Answers: <p>I feel relevant and important to note that:</p>
  <pre><code>ctr c ls
  </code></pre>
  <p>lists <strong>all</strong> containers, i.e. either stopped or running.</p>
  <p>In accordance with the question title: to precisely list all <strong>running</strong> containers (in the sense of docker terminology) you need to use this command:</p>
  <pre><code>ctr task list
  </code></pre>
  <p>or the shorthand</p>
  <pre><code>ctr t ls
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2024-03-21T01:12:24.853Z
Answers: 2024-03-21T01:12:24.853Z
Answers: adamency
Answers: <p>Try to namespace to list command</p>
  <pre><code>ctr -n k8s.io containers list
  </code></pre>
  <p>To list available namespaces run</p>
  <pre><code>ctr ns ls
  </code></pre>
  <p>For microk8s you have to prefix command with microk8s</p>
  <p>eg: <code>microk8s ctr ns ls</code></p>
  
Answers: CC BY-SA 4.0
Answers: 2024-03-05T08:36:44.757Z
Answers: For microk8s you have to prefix command with `microk8s ctr ...`
Answers: Jan Zahradník
Answers: CC BY-SA 4.0
Answers: 2023-01-09T09:18:38.557Z
Answers: 2024-05-16T21:25:57.417Z
Answers: 2024-05-16T21:25:57.417Z
Answers: fsp
Body: <p>I've switched to containerd in a k8s cluster.</p>
  <p>There's 2 pods running on one node, 2 github runners.</p>
  <p>I used to check on a host what containers were running with &quot;docker container ls&quot; but how to check this when containerd is used?</p>
  <pre><code>sudo ctr container ls
  </code></pre>
  <p>comes back with nothing</p>
  
Comments: CC BY-SA 4.0
Comments: 2022-10-26T16:11:50.653Z
Comments: Try with `crictl ps` & `crictl pods`. To be honest, I'm a bit confused between cri-o and containerd as well. Looking at kubespray especially, I would have both options, while setting "containerd" as a runtime, I would still end up using crictl listing/viewing pods, while as you suggest: ctr doesn't  show anything.
Comments: SYN
Comments: CC BY-SA 4.0
Comments: 2022-10-27T05:17:15.003Z
Comments: ah yes, crictl does the job. Is that a general name so that it works with any cri?
Comments: Serve Laurijssen
Comments: CC BY-SA 4.0
Comments: 2022-10-27T06:23:22.930Z
Comments: Check your `/etc/crictl.yaml`: when using containerd, your crictl configuration would just query containerd's socket file
Comments: SYN
Tags: <docker><kubernetes><containerd>
Title: how to check running containers with containerd
UserDisplayName: Serve Laurijssen
ThreadText: # how to check running containers with containerd
  
  (Asked by: username_0 on 2022-10-26)
  
  I've switched to containerd in a k8s cluster.
  
  There's 2 pods running on one node, 2 github runners.
  
  I used to check on a host what containers were running with "docker container ls" but how to check this when containerd is used?
  
  ```
  sudo ctr container ls
  
  ```
  
  comes back with nothing
  
  **Tags:** docker, kubernetes, containerd
  
  > **Comments:**
  > **username_1**: Try with `crictl ps` & `crictl pods`. To be honest, I'm a bit confused between cri-o and containerd as well. Looking at kubespray especially, I would have both options, while setting "containerd" as a runtime, I would still end up using crictl listing/viewing pods, while as you suggest: ctr doesn't  show anything.  
  > **username_0**: ah yes, crictl does the job. Is that a general name so that it works with any cri?  
  > **username_1**: Check your `/etc/crictl.yaml`: when using containerd, your crictl configuration would just query containerd's socket file  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2023-01-09. Score: 22 | Accepted answer
  
  Try to namespace to list command
  
  ```
  ctr -n k8s.io containers list
  
  ```
  
  To list available namespaces run
  
  ```
  ctr ns ls
  
  ```
  
  For microk8s you have to prefix command with microk8s
  
  eg: `microk8s ctr ns ls`
  
  > **Comments:**
  > **username_4**: For microk8s you have to prefix command with `microk8s ctr ...`  
  
  ---
  
  ### Answer by username_2 on 2024-03-21. Score: 2
  
  I feel relevant and important to note that:
  
  ```
  ctr c ls
  
  ```
  
  lists **all** containers, i.e. either stopped or running.
  
  In accordance with the question title: to precisely list all **running** containers (in the sense of docker terminology) you need to use this command:
  
  ```
  ctr task list
  
  ```
  
  or the shorthand
  
  ```
  ctr t ls
  
  ```
  
  
  ---
  
  