# 连接错误：此错误可能表示 Docker 守护进程未运行。（http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.41/containers/json）

- **ID:** `docker/docker-daemon-not-running-wsl2`
- **领域:** docker
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 82%

## 根因

当 WSL2 集成配置错误或 WSL2 内核过时时，适用于 Windows 的 Docker Desktop 无法启动守护进程。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Docker Desktop 4.20.0 | active | — | — |
| Docker Desktop 4.21.1 | active | — | — |
| WSL2 kernel 5.15.90.1 | active | — | — |
| Windows 10 22H2 | active | — | — |
| Windows 11 23H2 | active | — | — |

## 解决方案

1. ```
   通过以管理员身份运行的 PowerShell 执行 'wsl --update' 更新 WSL2 Linux 内核，然后重启 Docker Desktop。
   ```
2. ```
   在 Docker Desktop 中禁用并重新启用 WSL2 集成：设置 > 资源 > WSL 集成 > 关闭所有发行版，应用，然后重新打开所需发行版并重启。
   ```
3. ```
   在 %USERPROFILE%\.wslconfig 中手动设置 WSL2 内核路径，例如 'kernel=C:\\path\\to\\kernel'，然后执行 'wsl --shutdown' 并重启 Docker Desktop。
   ```

## 无效尝试

- **Restarting Docker Desktop from the system tray** — If the underlying WSL2 integration is broken or kernel is outdated, restarting Docker Desktop alone does not fix the issue; the daemon will fail again immediately. (65% 失败率)
- **Reinstalling Docker Desktop entirely** — The error is often caused by a stale WSL2 kernel or misconfigured .wslconfig, not by Docker Desktop installation files. Reinstalling is time-consuming and rarely resolves the root cause. (80% 失败率)
- **Running 'wsl --shutdown' and then restarting Docker** — While this can temporarily clear state, it does not update the WSL2 kernel or fix integration settings; the error returns after the next system reboot. (55% 失败率)
