docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.85k stars 285 forks source link

Docker Engine Stopped because WSL not updating in Win 11 23H2S #13953

Open andreluiz901 opened 6 months ago

andreluiz901 commented 6 months ago

Description

Hello, i need to install docker in my new work machine.

I downloaded, install, click on Docker Desktop,

For some seconds: "Docker Engine Initializating", then docker check for user allow to config, i click yes, but after some seconds appear "Docker Engine Stopped" and then show a error message saying to try use wsl -shutdown, that dont solved of course.

After 6 hours debugging, I tryied to reinstall, I try to uninstall, restart, install like admin, i try to install wsl, i installed ubuntu distro to wsl, and lot of troubleshoooting and guides, stackoverflow.

However, what i found is that WSL do not update directly in some cases. Thats a windows problem, i think. And detailed install for wsl can be found here.

https://superuser.com/questions/1820365/wsl2-ubuntu-20-04-6-lts-not-working-wslregisterdistribution-failed-with-error/1820374#1820374

I need to install manually wsl version, then docker could run normally.

I think we could put a note at troubleshooting guide, since i never found nothing about this.

And, this seems to ocur only at some win versions.

Reproduce

Just by normally trying installing as i sayd before.

Expected behavior

SHould install more easier or with detailed troubleshooting error.

docker version

Client:
 Cloud integration: v1.0.35+desktop.10
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:02 2024
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.27.2 (137060)
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:14:25 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    25.0.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1-desktop.4
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.5-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  debug: Get a shell into any image or container. (Docker Inc.)
    Version:  0.0.24
    Path:     C:\Program Files\Docker\cli-plugins\docker-debug.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.21
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.0.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.4.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 25.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.133.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 7.635GiB
 Name: docker-desktop
 ID: 2cc8a8dd-3a79-4bf2-8f5b-c54f46e8b38f
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: daemon is not using the default seccomp profile

Diagnostics ID

92C74098-E97A-4C46-9209-AF4C429DF4D1/20240307023204

Additional Info

i have generated a diagnosis id now after solved the error, i dont know if generated a local diagnoses in the previous error.

richardtravisdavis commented 6 months ago

I have the same issue and tried to install 4.28.0 and that also did not resolve the issue.

andreluiz901 commented 6 months ago

@richardtravisdavis i only solved here when i reinstall and tryied this:

https://superuser.com/questions/1820365/wsl2-ubuntu-20-04-6-lts-not-working-wslregisterdistribution-failed-with-error/1820374#1820374

I only manually update to 2.0.14 the wsl, i dont know if u should delete the register as suggested, i dont need this step:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex{A9B7A1B9-0671-405C-95F1-E0612CB4CE7E}

Try read this stack overflow to see if help you.

These steps presume you istalled wsl and installed one image (here i use the Ubuntu default)

Maybe wsl --update gives you an error, something like error at 90% with a "not found", then you need to update manually.

And, this could update you wsl, and run docker okay.

You could try to see if you docker has marked "use wsl" at your configs.

richardtravisdavis commented 6 months ago

Use wsl is configured correctly.

I do see the following application crash message in the event viewer:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" Guid="{a0e9b465-b939-57d7-b27d-95d8e925ff57}" /> 
    <EventID>1000</EventID> 
    <Version>0</Version> 
    <Level>2</Level> 
    <Task>100</Task> 
    <Opcode>0</Opcode> 
    <Keywords>0x8000000000000000</Keywords> 
    <TimeCreated SystemTime="2024-03-09T05:50:39.1263124Z" /> 
    <EventRecordID>2368</EventRecordID> 
    <Correlation /> 
    <Execution ProcessID="8868" ThreadID="10432" /> 
    <Channel>Application</Channel> 
    <Computer>MyMachine</Computer> 
    <Security UserID="mysecurityuserid" /> 
  </System>
  <EventData>
    <Data Name="AppName">Docker Desktop.exe</Data> 
    <Data Name="AppVersion">4.28.0.0</Data> 
    <Data Name="AppTimeStamp">65d38e0d</Data> 
    <Data Name="ModuleName">msvcrt.dll</Data> 
    <Data Name="ModuleVersion">7.0.22621.3235</Data> 
    <Data Name="ModuleTimeStamp">c52c5c25</Data> 
    <Data Name="ExceptionCode">c0000005</Data> 
    <Data Name="FaultingOffset">00000000000ad304</Data> 
    <Data Name="ProcessId">0x32d0</Data> 
    <Data Name="ProcessCreationTime">0x1da71e5b47e4357</Data> 
    <Data Name="AppPath">C:\Program Files\Docker\Docker\frontend\Docker Desktop.exe</Data> 
    <Data Name="ModulePath">C:\Windows\System32\msvcrt.dll</Data> 
    <Data Name="IntegratorReportId">a7a93bfc-4fda-4f79-92a6-55b350ecc6ba</Data> 
    <Data Name="PackageFullName" /> 
    <Data Name="PackageRelativeAppId" /> 
  </EventData>
</Event>
Roshan12here commented 2 months ago

I ran into the same Problem and I fixed it by enabling VT in my pc Here is How you can do it Enable Virtualization in BIOS: Restart your computer and enter BIOS settings (usually by pressing a key like F2, F12, Delete, or Esc during startup, depending on your hardware). Look for an option related to virtualization technology. It might be named something like "Intel VT-x" or "AMD-V". Ensure it is enabled. Save the BIOS settings and restart your computer.

alirezag103 commented 1 month ago

Docker engine stopped (windows 11)

I have installed Docker Desktop 4.32 on windows 11 (version 23H2) and same problem occurred virtualization was enabled in BIOS, WSL and Virtual Machine Platform was enabled in windows features (using wsl version 2)

Docker desktop could be started but it was just showing the message: Docker engine stopped I couldn't even quit, restart, or do anything else

also tried to install wsl 2.0.14 as @andreluiz901 said:

I only manually update to 2.0.14 the wsl

But it wasn't enough, I also found this: https://github.com/docker/for-win/issues/13636#issuecomment-1670901814 and finally I solved the problem by modifying the settings.json located in: %userprofile%\AppData\Roaming\Docker\settings.json just set the value of "runWinServiceInWslMode" to true and restarted docker desktop (using task manager!) after a few moments of staying idle docker engine started

here is other key value pairs of my settings which may be relevant to similar problems:

"runWinServiceInWslMode": true,
"skipUpdateToWSLPrompt": true,
"skipWSLMountPerfWarning": false,
"wslEnableGrpcfuse": false,
"wslEngineEnabled": true,
"wslInstallMode": "installLatestWsl",
"wslUpdateRequired": true,