↓ 快轉到主要內容

修復 Docker Desktop for Windows 升級後的 WSL integration 錯誤

·692 字·2 分鐘
Y Cheung
作者
Y Cheung
Blogger, Programer & Traveler.

Windows 10 上的 Docker Desktop 最近升級至 v4.38.0 後突然冒出了 WSL 錯誤。

Docker Desktop WSL integration with distro Legacy unexpectedly stopped
running wsl distro proxy in Legacy distro: running proxy: exit status 1

嘗試了 Restart the WSL integration 和 Skip Legacy WSL distro 都不行,問 AI 可能的原因是:

  • Proxy Configuration Issues: If you’re using a proxy, incorrect settings can lead to failures in establishing connections, which might cause the exit status 1 error. This can happen if environment variables like HTTP_PROXY or NO_PROXY are not set correctly.
  • WSL Version Compatibility: Running an older version of WSL (like WSL 1) can lead to compatibility issues with certain applications or configurations, especially when using Docker or other services that rely on network connectivity.
  • Systemd Not Running: In WSL, systemd is not enabled by default, which can lead to issues when trying to manage services that expect it to be present. This is particularly relevant for applications like Docker that may require it for proper initialization and management.
  • Corrupted WSL Filesystem: A corrupted filesystem in your WSL installation can also cause unexpected terminations and errors. Running a filesystem check may resolve this issue.

結合 Y Cheung 的實際情況,估計可能是WSL版本問題了,於是在Powershell中 wsl --update 隨手更新了一波 WSL。

更新後重啟 Docker Desktop for Windows 又彈出錯誤警告窗口,這次錯誤信息提示變了。

Docker Desktop WSL integration with distro Legacy unexpectedly stopped again
retrieving homedir for Legacy distro: getting home folder for Legacy distro: running echo $HOME in Legacy: sending to distro: write |1: The pipe is being closed.

繼續丟去問 AI ,得到的回复是:

  • Renamed Home Directory: If you’ve recently renamed your home directory, Docker Desktop might be looking for the old directory, causing issues.
  • WSL Issues/Corruption: An unexpected error during WSL command execution, possibly due to access rights issues after waking the computer. WSL distro terminated abruptly.
  • Docker Installation on a Different Drive: Installing Docker Desktop on a drive other than the default can cause WSL-related errors.
  • Conflicting CLI Plugins: Problems with CLI plugins can interfere with Docker’s operation.
  • Home Assistant and File Permissions: While this search result relates to Home Assistant, it highlights potential permission issues that can prevent Docker from creating necessary directories.
  • Corrupted Docker Configuration: A corrupted Docker configuration can cause startup issues.

額,感覺不是很靠譜。用 wsl -l -v 命令查看了下當前的狀態是:

1  NAME              STATE           VERSION
2* Legacy            Stopped         1
3  docker-desktop    Running         2

用 wsl --set-version Legacy 2 嘗試將 Legacy 的版本設置為2,結果被拒絕,說是舊分發不支持 WSL 2. 錯誤代碼: Wsl/Service/WSL_E_VM_MODE_NOT_SUPPORTED 喔~

沒辦法,遇事不決,先嘗試重啟系統吧!

重啟系統也沒辦法解決,這…… 大概 Y Cheung 還沒學會怎麼跟 AI 溝通吧,轉回用老辦法 Google 一通,看過 WSL 文檔1與部分網友的建議2,Y Cheung 重新安裝了 WSL,並將原來的 Lagacy 註銷,就解決了。

1# 安裝 WSL 2
2wsl --install
3
4# 註銷 Lagacy
5wsl --unregister Legacy

相關問題參考:

相關文章

解決Windows Docker 客戶端使用 Mariadb 官方image啟動報錯

·526 字·2 分鐘
MariaDB Image使用的是當前最新的v10.3版本 1docker pull mariadb:latest docker-compose.yml文件內容: 1version: "3" 2services: 3 mariadb: 4 image: mariadb 5 container_name: mariadb 6 restart: always 7 volumes: 8 - ${DATA_DIR}:/var/lib/mysql 9 ports: 10 - "3306:3306" 11 environment: 12 MYSQL_ROOT_PASSWORD: password 13 MYSQL_DATABASE: public .env 文件內容:

Win 10 讀取 Mac HFS+ 格式硬碟

·363 字·1 分鐘
因需找出了多年不用的移動硬碟SSD,結果win 10 無法讀取!檢查了驅動什麼的都沒問題,也看到有這個硬碟了,就是不能正常加載出來,著急。 原本還以為是TOSHIBA的問題,因為看到網上有說win 10更新後無法正常使用東芝硬碟的,但是那都是2018年的事情了啊,應該早修復了呀。

非ROOT用户使用docker命令

·345 字·1 分鐘
Docker安装完之后,如果是以非ROOT用户登录的必须加sudo执行docker命令,否则会报错: 1Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.26/images/json: dial unix /var/run/docker.sock: connect: permission denied 解决办法是把当前用户添加进docker用户组。

Windows7安裝Android Studio報錯 ERROR1812

·108 字·1 分鐘
在 Win7 上運行 Android Studio 安裝包的時候,一直報錯 Unable to elevate[error:1812] 上網搜了一下,原來是windows兼容性問題orz… 解決方案: 鼠標右擊,選擇 “兼容性疑難解答”,選擇 “嘗試建議的設置”,選擇啟動程序 ,然後一直點擊下一步就好了。