简体   繁体   English

Docker 始终运行 Frozen 或 WSL Ubuntu 发行版在等待生命周期服务器时停止

[英]Docker run always Frozen or WSL Ubuntu distro stopped while waiting for Lifecycle server

Running into this Error after updating to the latest version of Windows in the Insider Preview program.在 Insider Preview 程序中更新到最新版本的 Windows 后遇到此错误。 I have noticed that my Hyper-V settings for Hyper-V Management Tools and Hyper-V platform are now on after applying this Windows update.我注意到,在应用此 Windows 更新后,我的 Hyper-V 管理工具和 Hyper-V 平台的 Hyper-V 设置现在已启用。 I do not remember if these were both on prior to update.我不记得这两个是否在更新之前都打开了。

Windows Windows

在此处输入图像描述

Error错误

WSL distro stopped while waiting for Lifecycle server.
  >Stdout:

  >Stderr:
2020/08/08 20:51:59 resolving /mnt/host/c/Program Files/Docker/Docker/resources/wsl/docker-wsl-cli.iso...
2020/08/08 20:51:59 copying...
Error: mounting wslCLIDest: open /mnt/host/wsl/docker-desktop-data/isocache/c6c2ec214a20124f40a56bbc09f0f7f8fdc9a217881c0ff725af2e476e4b3734.iso: input/output error
2020/08/08 20:51:59 open /mnt/host/wsl/docker-desktop-data/isocache/c6c2ec214a20124f40a56bbc09f0f7f8fdc9a217881c0ff725af2e476e4b3734.iso: input/output error
mounting wslCLIDest
main.doRun
    /go/src/github.com/docker/pinata/linuxkit/pkg/wsl-bootstrap/main.go:224
main.run.func1
    /go/src/github.com/docker/pinata/linuxkit/pkg/wsl-bootstrap/main.go:83
github.com/docker/pinata/vendor/github.com/spf13/cobra.(*Command).execute
    /go/src/github.com/docker/pinata/vendor/github.com/spf13/cobra/command.go:762
github.com/docker/pinata/vendor/github.com/spf13/cobra.(*Command).ExecuteC
    /go/src/github.com/docker/pinata/vendor/github.com/spf13/cobra/command.go:852
github.com/docker/pinata/vendor/github.com/spf13/cobra.(*Command).Execute
    /go/src/github.com/docker/pinata/vendor/github.com/spf13/cobra/command.go:800
main.main
    /go/src/github.com/docker/pinata/linuxkit/pkg/wsl-bootstrap/main.go:25
runtime.main
    /usr/local/go/src/runtime/proc.go:203
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1357

WSL Spec WSL 规范

usr@win:/mnt/c/$ neofetch
            .-/+oossssoo+/-.               usr@win
        `:+ssssssssssssssssss+:`           ----------------
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 20.04 LTS on Windows 10 x86_64
    .ossssssssssssssssssdMMMNysssso.       Kernel: 4.19.104-microsoft-standard
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Uptime: 3 mins
  +ssssssssshmydMMMMMMMNddddyssssssss+     Packages: 640 (dpkg)
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Shell: bash 5.0.16
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Terminal: /dev/pts/1
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   CPU: Intel i7-6700K (8) @ 4.007GHz
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   GPU: 9542:00:00.0 Microsoft Corporation Device 008e
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   Memory: 497MiB / 7959MiB
+sssshhhyNMMNyssssssssssssyNMMMysssssss+
.ssssssssdMMMNhsssssssssshNMMMdssssssss.
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/
  +sssssssssdmydMMMMMMMMddddyssssssss+
   /ssssssssssshdmNNNNmyNMMMMhssssss/
    .ossssssssssssssssssdMMMNysssso.
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.

Update memory to 1G fixed the issue for me.将 memory 更新到 1G 为我解决了这个问题。 Follow below steps:请按照以下步骤操作:

Open Windows Terminal/CMD/PowerShell and run the commands below:打开 Windows 终端/CMD/PowerShell 并运行以下命令:

#turn off all wsl instances such as docker-desktop
wsl --shutdown
notepad "$env:USERPROFILE/.wslconfig"

Notepad opens and a new file.wslconfig is created.(if this is the first time)记事本打开并创建了一个新的 file.wslconfig。(如果这是第一次)

Edit.wslconfig file with notepad and write down these settings:使用记事本编辑.wslconfig 文件并记下这些设置:

[wsl2]
memory=1GB  

I was able to fix this.我能够解决这个问题。 Follow these steps and it might fix it for you as well, this the order I tried these in:请按照以下步骤操作,它也可能会为您解决问题,这是我尝试过的顺序:

  1. Delete your Ubuntu on Windows WSL distro and reinstall it from the Microsoft Store.删除 Windows WSL 发行版上的 Ubuntu 并从 Microsoft Store 重新安装。
  2. Clean / Purge data using the Docker Desktop app.使用 Docker 桌面应用程序清理/清除数据。
  3. Reset Docker to factory defaults using the Docker Desktop app.使用 Docker 桌面应用程序将 Docker 重置为出厂默认设置。
  4. Disable Hyper-V Management Tools and Hyper-V platform and reboot Windows <-------- ✔ real fix for my case.禁用 Hyper-V 管理工具和 Hyper-V 平台并重新启动 Windows <-------- ✔ 真正解决我的情况。
  5. Run Docker commands as a super user sudo su <-------- you may need to do this if step 4 does not wok for you.以超级用户身份运行 Docker 命令sudo su <-------- 如果步骤 4 不适合您,您可能需要执行此操作。

For Windows before re-installing and other stuff, just reset docker to factory defaults .对于重新安装之前的Windows和其他东西,只需reset docker to factory defaults Works most of the time on windows env after this.此后大部分时间都在 windows 环境中工作。

In my case, WSL sometimes did not mount the c:\ drive after windows startup.就我而言,WSL 有时在 windows 启动后没有安装 c:\ 驱动器。 Therefore Docker also does not start and aborts with error "WSL distro stopped while waiting for Lifecycle server."因此 Docker 也不会启动并因错误“WSL 发行版在等待生命周期服务器时停止”而中止。

I wrote a.bat script which checks for existing "/mnt/c/".我编写了一个检查现有“/mnt/c/”的.bat 脚本。 If not there it restarts WSL.如果不存在,它将重新启动 WSL。 Only then Docker is started.只有这样 Docker 才会启动。

I removed Docker from autostart, instead this script is executed on startup.我从自动启动中删除了 Docker,而是在启动时执行此脚本。

@echo off
set CHECKDIR="/mnt/c/Users"
echo Check if dir %CHECKDIR% exists.
bash -c "cd %CHECKDIR%" && (
    echo Check successful
) || (
    echo Check failed. Restarting WSL
    wsl --shutdown
)
echo Start Docker
start "" "C:\Program Files\Docker\Docker\Docker Desktop.exe"

Maybe this is interesting for some here, as long as this bug is not fixed.也许这对这里的一些人来说很有趣,只要这个错误没有被修复。

in ubuntu cmd, code.在 ubuntu cmd 中,代码。 will install vscode server and this will figure out this problem.将安装 vscode 服务器,这将解决这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WSL Ubuntu 20.04,在此 WSL 2 发行版中找不到命令“docker” - WSL Ubuntu 20.04, The command 'docker' could not be found in this WSL 2 distro 无法从 WSL 2 Ubuntu 运行 docker compose - Unable to run docker compose from WSL 2 Ubuntu 为什么 Docker 无法在 Windows 10 Home 中检测到 WSL 2 发行版? - Why Docker can't detect WSL 2 distro in Windows 10 Home? WSL2 的 %USERPROFILE%\AppData\Local\Docker\wsl\distro\ext4.vhdx 文件中存储了什么? - What is stored in the %USERPROFILE%\AppData\Local\Docker\wsl\distro\ext4.vhdx file for WSL2? 将Docker Windows WSL Ubuntu连接到VMware Ubuntu - Connecting Docker Windows WSL Ubuntu to VMware Ubuntu 无法连接到 unix:///var/run/docker.sock 上的 Docker 守护进程。 docker 守护进程是否正在运行? (Ubuntu 20.04,WSL2) - Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (Ubuntu 20.04 ,WSL2) 在 Windows 终端 WSL2 中找不到我的发行版或 ubuntu 用户 - Can't find my distro or ubuntu user in Windows terminal WSL2 添加 JDK 路径从 WSL2 Ubuntu 到 IntelliJ IDE 冻结屏幕 - Adding JDK path from WSL2 Ubuntu to IntelliJ IDE frozen the screen 在使用Docker的Windows上运行Ubuntu服务器并使用IDE进行开发的最佳方法是什么? - What is the best way to run an Ubuntu server on Windows with Docker and develop with an IDE? 无法将现有的 WSL1 发行版转换为 WSL2 - Not able to convert existing WSL1 distro to WSL2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM