windows 11 启动Docker Desktop报“Docker Desktop - Unexpected WSL error”错

发布时间 2023-08-09 00:58:20作者: 未来的羁绊

windows 11 启动Docker Desktop报“Docker Desktop - Unexpected WSL error”错

报错内容如下:

An unexpected error was encountered while executing a WSL command. Commoncauses include access rights issues, 
which occur after waking the computer or notbeing connected to your domain/active directory.

please try shutting WSL down (wsl --shutdown) and/or rebooting your computer. lfnot sufficient, WSL may need to be reinstalled fully. 
As a last resort, try touninstall/reinstall Docker Desktop, lf the issue persists please collect diagnostics andsubmit an issue
....//docs.docker.com/desktop/troubleshoot/overview/#diagnose-from-the-terminal).

报错截图如下:

图一

图二

图三

解决方案:

执行以下命令:

netsh winsock reset

出现场景:

  1. 启动wsl使用过代理或加速器等软件
  2. wsl更新后, wsl --update操作后
  3. win10/win11升级后, 替你安装或者升级了"Windows Subsystem for Linux Preview"

出现原因:

(我不懂, 搬运大佬猜测)wsl启动时加载了Proxifier的一个模块, 此前使用过代理会导致此问题出现

解决方法:

管理员身份启动cmd/powershell , 运行

netsh winsock reset
  1. 重启电脑后启动wsl, 我通过这种方式已经解决了问题, 如果仍然不能启动wsl, 或者在使用代理加速器等软件后又重现此问题可以采取方法2
  2. 使用NoLsp.exe防止Windows 将 LSP DLL 加载到 wsl.exe 进程中NoLsp下载地址, 管理员启动cmd/powershell, 输入指令: “.\NoLsp.exe c:\windows\system32\wsl.exe”, 返回success即可

如何查看本地的Ubuntu能够正常使用

1、搜索输入框中输入 Ubuntu -> 应用设置 (APP settings)

2、正常则进入如下页面:

3、异常则会提示:

占位程序接收到错误数据。 
Error code: Wsl/Service/0x800706f7

参考文章:

  1. 【win10/win11下启动wsl/wsl2出现“占位程序接收到错误数据“启动失败的解决办法】 https://blog.csdn.net/caiji112/article/details/124916376
  2. 【Windows Subsystem for Linux (WSL) 重置 - 重装操作系统】https://blog.csdn.net/chengyq116/article/details/121218415