|
| 1 | +--- |
| 2 | +title: Container runtime 'podman' could not be found in WSL |
| 3 | +description: Learn how to troubleshoot the error "Container runtime 'podman' could not be found" when using Podman in Windows Subsystem for Linux (WSL). |
| 4 | +ms.date: 08/04/2025 |
| 5 | +--- |
| 6 | + |
| 7 | +# Container runtime 'podman' could not be found in WSL |
| 8 | + |
| 9 | +.NET Aspire requires a container runtime to be available in the system PATH. This article describes how to resolve issues when Podman isn't found in Windows Subsystem for Linux (WSL) environments. |
| 10 | + |
| 11 | +## Symptoms |
| 12 | + |
| 13 | +When starting your .NET Aspire application, you see an error message similar to: |
| 14 | + |
| 15 | +```Output |
| 16 | +Container runtime 'podman' could not be found. The error from the container runtime check was: exec: "podman": executable file not found in $PATH |
| 17 | +``` |
| 18 | + |
| 19 | +This occurs even though running `podman images` or other Podman commands work successfully in your WSL terminal. |
| 20 | + |
| 21 | +## Cause |
| 22 | + |
| 23 | +This issue occurs in WSL environments when: |
| 24 | + |
| 25 | +- Podman is installed in a separate WSL distribution than where your .NET Aspire application is running. |
| 26 | +- You're using shell aliases instead of having the actual Podman executable in your PATH. |
| 27 | +- The Podman executable isn't available in the system PATH that .NET Aspire searches. |
| 28 | + |
| 29 | +.NET Aspire resolves container runtimes by searching for the executable in the system PATH. Shell aliases (like those defined in `~/.bash_aliases`) aren't recognized during this process. |
| 30 | + |
| 31 | +## Solution |
| 32 | + |
| 33 | +Choose one of the following solutions: |
| 34 | + |
| 35 | +### Install Podman in the current WSL distribution |
| 36 | + |
| 37 | +Install Podman directly in the WSL distribution where you're running your .NET Aspire application: |
| 38 | + |
| 39 | +```bash |
| 40 | +# For Ubuntu/Debian-based distributions |
| 41 | +sudo apt update |
| 42 | +sudo apt install -y podman |
| 43 | +``` |
| 44 | + |
| 45 | +For other distributions, see [Install Podman on Linux](https://podman.io/docs/installation#installing-on-linux). |
| 46 | + |
| 47 | +### Create a symbolic link |
| 48 | + |
| 49 | +If you have Podman installed elsewhere, create a symbolic link: |
| 50 | + |
| 51 | +```bash |
| 52 | +# Find where Podman is installed |
| 53 | +which podman-remote-static-linux_amd64 |
| 54 | + |
| 55 | +# Create a symbolic link in a directory that's in your PATH |
| 56 | +sudo ln -s /path/to/podman-remote-static-linux_amd64 /usr/local/bin/podman |
| 57 | +``` |
| 58 | + |
| 59 | +### Add Podman directory to PATH |
| 60 | + |
| 61 | +Add the directory containing the Podman executable to your PATH: |
| 62 | + |
| 63 | +```bash |
| 64 | +# Add to your shell profile |
| 65 | +echo 'export PATH="/path/to/podman/directory:$PATH"' >> ~/.bashrc |
| 66 | +source ~/.bashrc |
| 67 | +``` |
| 68 | + |
| 69 | +## Verify the solution |
| 70 | + |
| 71 | +Confirm that Podman is correctly configured: |
| 72 | + |
| 73 | +```bash |
| 74 | +# Check that Podman is in your PATH |
| 75 | +which podman |
| 76 | + |
| 77 | +# Verify Podman is working |
| 78 | +podman --version |
| 79 | + |
| 80 | +# Test that Podman can list containers |
| 81 | +podman ps |
| 82 | +``` |
| 83 | + |
| 84 | +All commands should succeed before running your .NET Aspire application. |
| 85 | + |
| 86 | +## See also |
| 87 | + |
| 88 | +- [Container runtime setup](../fundamentals/setup-tooling.md#container-runtime) |
| 89 | +- [Container runtime appears to be unhealthy](container-runtime-unhealthy.md) |
0 commit comments