for-win icon indicating copy to clipboard operation
for-win copied to clipboard

Docker Desktop tries to update wsl each startup

Open anton-filatov opened this issue 1 year ago • 17 comments

Description

Docker Desktop fails to determine wsl version if windows system locale differs from en. This leads to attempt to upgrade wsl which triggers UAC elevation prompt for "Docker Desktop Privileged Helper" for program location ["C:\Program Files\Docker\Docker\resources\com.docker.admin.exe" wsl-update].

After startup Docker works fine, but UAC elevation prompt is annoying.

Looks like the problem is similar to https://github.com/docker/for-win/issues/13518, https://github.com/docker/for-win/issues/13524. Also https://github.com/docker/for-win/issues/13806 may have the same reason.

Reproduce

  1. Switch to ru locale (Start > Settings > Time & Language > Region > Regional format).
  2. Check wsl version, should be:
wsl --version
Версия WSL: 2.0.14.0
Версия ядра: 5.15.133.1-1
Версия WSLg: 1.0.59
Версия MSRDC: 1.2.4677
Версия Direct3D: 1.611.1-81528511
Версия DXCore: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Версия Windows: 10.0.19045.3693
  1. Start Docker Desktop.

Expected behavior

There is no attempt to update wsl.

docker version

Client:
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.20.10
 Git commit:        afdd53b
 Built:             Thu Oct 26 09:08:44 2023
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.26.1 (131620)
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.10
  Git commit:       311b9ff
  Built:            Thu Oct 26 09:08:02 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.25
  GitCommit:        d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc:
  Version:          1.1.10
  GitCommit:        v1.1.10-0-g18a0cb0
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    24.0.7
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.0-desktop.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.23.3-desktop.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.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:  0.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.10
    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
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scan.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.2.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 24.0.7
 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 logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc version: v1.1.10-0-g18a0cb0
 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: 12
 Total Memory: 15.47GiB
 Name: docker-desktop
 ID: 801d2d94-f34c-4415-9369-5760c9cc712f
 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

Additional Info

Logs when locale is en:

  • com.docker.backend.exe.log
[2024-01-09T16:01:06.989259800Z][com.docker.backend.exe.wsl][I] WSL Updater: version is 2.0.14.0. an update is not required

Logs when locale differs from en:

  • com.docker.backend.exe.log
[2024-01-09T16:00:11.563871200Z][com.docker.backend.exe.wsl][I] WSL Updater: assuming wsl.exe --version not supported. checking wsl.exe --status
[2024-01-09T16:00:11.687214800Z][com.docker.backend.exe.wsl][I] WSL Updater: could not get kernel version from wsl.exe --status. assuming an update is required
[2024-01-09T16:00:11.699008100Z][com.docker.backend.exe.wsl][I] WSL Upater: install mode is set to: installLatestWsl
[2024-01-09T16:00:11.699551700Z][com.docker.backend.exe.wsl][I] WSL Updater: waiting for elevated update to complete
[2024-01-09T16:00:15.590939300Z][com.docker.backend.exe.wsl][I] WSL Updater: elevated update completed
[2024-01-09T16:00:15.884871800Z][com.docker.backend.exe.wsl][I] WSL Updater: assuming wsl.exe --version not supported. checking wsl.exe --status
[2024-01-09T16:00:16.178812500Z][com.docker.backend.exe.wsl][I] WSL Updater: could not get kernel version from wsl.exe --status. assuming an update is required
[2024-01-09T16:00:16.178812500Z][com.docker.backend.exe.wsl][I] WSL Updater: waiting for non-elevated update to complete
[2024-01-09T16:00:16.178812500Z][com.docker.backend.exe.wsl][I] WSL Updater: updating wsl with -> wsl.exe --update --web-download
[2024-01-09T16:00:16.504354700Z][com.docker.backend.exe.wsl][I] WSL Updater: update completed successfully: @>25@O5BAO  =0;8G85  >1=>2;5=89. 
 
 >A;54=OO  25@A8O  ?>4A8AB5<0  W i n d o w s   4;O  L i n u x   C65  CAB0=>2;5=0. 
 
 
[2024-01-09T16:00:16.504354700Z][com.docker.backend.exe.wsl][I] WSL Updater: non-elevated update completed
  • com.docker.admin.exe.log
-------------------------------------------------------------------------------->8
-------------------------------------------------------------------------------->8
[2024-01-09T16:00:14.136132400Z][com.docker.admin.exe.wsl][I] WSL Updater: updating wsl with -> wsl.exe --update --web-download
[2024-01-09T16:00:15.576283600Z][com.docker.admin.exe.wsl][I] WSL Updater: update completed successfully: @>25@O5BAO  =0;8G85  >1=>2;5=89. 
 
 >A;54=OO  25@A8O  ?>4A8AB5<0  W i n d o w s   4;O  L i n u x   C65  CAB0=>2;5=0. 

anton-filatov avatar Jan 09 '24 16:01 anton-filatov

Hi @anton-filatov,

Sorry you hit an issue, but thanks for reporting it.

If possible, could you upload the Docker Desktop diagnostics bundle? That will provide us with even more info so we can debug.

Thanks!

ctalledo avatar Jan 10 '24 22:01 ctalledo

@anton-filatov you are the best ) nothing else helped to solve that problem so docker desktop became useless (win 11 with latest updates). Now i at least have a workaround - change locale and work. Thank you! And UP. For Docker desktop team: Problem is actual. We need normal solution for all locales. Docker desktop worked just fine in previous versions with any locale. But now it does not. It's a breaking change.

lone-cat avatar Jan 23 '24 14:01 lone-cat

Hello,

I wanted to post a quick update to say thank you for your patience and that after some investigation, we identified an issue.

The fix will be included in the upcoming 4.27 release.

Thanks! Craig 🙂

chelnak avatar Jan 23 '24 18:01 chelnak

Great news up here. Look forward to update to 4.27 ) Thanks!!!

lone-cat avatar Jan 23 '24 18:01 lone-cat

Confirm - everything works now in 4.27. Thanks!

lone-cat avatar Jan 27 '24 19:01 lone-cat

Great news! Thank you 🙏

chelnak avatar Jan 28 '24 11:01 chelnak

I'm closing the issue for now and will re-open in case this happens again. Thanks @chelnak

bsousaa avatar Jan 29 '24 14:01 bsousaa

@bsousaa I also had this issue before and now I have this issue again on version 4.28.0

TheSilvermind avatar Mar 01 '24 07:03 TheSilvermind

@TheSilvermind Would you be able to open a new ticket and provide some diagnostic logs please? 🙏

chelnak avatar Mar 01 '24 08:03 chelnak

version 4.24.2 doesn't check version of wsl https://docs.docker.com/desktop/release-notes/#4242

nfyrjd1 avatar Mar 19 '24 07:03 nfyrjd1

Same thing. Had to uninstall 28 version. Sickening.

mockinbirdy avatar Apr 01 '24 00:04 mockinbirdy

Since updating to 4.33.0 yesterday, I have the same issue. On automatic startup while system startup. First access control of Windows shows up and asks for permission to update system components. When declining it, I see a docker error message, that WSL update failed.

thedatabaseme avatar Jul 26 '24 10:07 thedatabaseme

Hey @thedatabaseme - if possible, can you generate a diagnostic bundle and post the ID here?

If the UI is blocked by this issue you can generate one from the command line.

Check out this document for more information https://docs.docker.com/desktop/troubleshoot/overview/

chelnak avatar Jul 26 '24 16:07 chelnak

@chelnak . Here's the ID F20B0889-70CA-4835-A9B4-7EA20D0B9529/20240726182547. Not sure if this is really helpful though. Since the error on WSL update is reasonable when declining permissions. Since the issue is, that Docker is running a WSL update at every autostart.

Maybe another interesting thing for you. The WSL update seems only to happen during system start / autostart. When I quit Docker Desktop and start again, no permission request shows up.

thedatabaseme avatar Jul 26 '24 18:07 thedatabaseme

Also have this issue now with Docker Desktop Privileged Helper asking boot now for permission

WSL version: 2.2.4.0 Kernel version: 5.15.153.1-2 WSLg version: 1.0.61 MSRDC version: 1.2.5326 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26091.1-240325-1447.ge-release Windows version: 10.0.22631.3880

datapedd avatar Jul 27 '24 11:07 datapedd

Having the same issue since 4.33.0

grafik

baumheld avatar Jul 28 '24 07:07 baumheld

Same problem here with 4.33 (my Docker Desktop is configured to start a minute after boot)

I've take a look into the logs and so far found out the following:

  1. (unrelated) UtilTranslatePathList:2866 spams a lot with Failed to translate ..., this makes the logs not very readable...
  2. The WSL Update check is done two times: The first one is successful:
    [2024-07-28T11:38:45.913414400Z][com.docker.backend.exe.sys] Checking if a WSL update is required
    [2024-07-28T11:38:45.944888600Z][com.docker.backend.exe.update] version is 2.2.4.0. an update is not required
    [2024-07-28T11:38:45.971183100Z][com.docker.backend.exe.sys] Ensure WslUpdateRequired setting: WslUpdateRequired = false
    
    The second one fails completely:
    [2024-07-28T11:38:50.935181300Z][com.docker.backend.exe.sys] Checking if a WSL update is required
    [2024-07-28T11:38:51.110576800Z][com.docker.backend.exe.update] assuming wsl.exe --version not supported. checking wsl.exe --status
    [2024-07-28T11:38:51.236060100Z][com.docker.backend.exe.update] could not get kernel version from wsl.exe --status. assuming an update is required
    [2024-07-28T11:38:51.307857300Z][com.docker.backend.exe.sys] Ensure WslUpdateRequired setting: WslUpdateRequired = true
    [2024-07-28T11:38:53.926060100Z][com.docker.backend.exe.update] install mode is set to: installLatestWsl
    [2024-07-28T11:38:53.926596200Z][com.docker.backend.exe.update] waiting for elevated update to complete
    

It would be great if we could manually set "wslInstallMode" to something else - which blocks WSL updates - instead of "installLatestWsl" so that we could work around this bug for now. Is it anywhere documented what options can be set for "wslInstallMode"?

litetex avatar Jul 28 '24 12:07 litetex

Same problem here with 4.33

teejay-87 avatar Jul 31 '24 21:07 teejay-87

I appears fixed after upgrade to 4.33.1 (maybe related to https://github.com/docker/for-win/issues/14222? that's the only fix mentioned in release notes)

teejay-87 avatar Aug 01 '24 12:08 teejay-87

Same problem here, with upgrade from 4.32 to 4.33.1 today,

wsl --version WSL version: 2.2.4.0 WSLg version: 1.0.61 MSRDC version: 1.2.5326 Windows version: 10.0.19045.4717

Edit : launched wsl --update --pre-release in pwsh, have WSL version: 2.3.14.0 right now, coming from 2.2.4 Have new Kernel version for WSL, Docker Desktop works fine now, but all images are lost ☹ . So good so far ...

wsl --version WSL version: 2.3.14.0 Kernel version: 6.6.36.3-1 WSLg version: 1.0.64 MSRDC version: 1.2.5326 Windows version: 10.0.19045.4717

Mickachouw avatar Aug 01 '24 16:08 Mickachouw

I appears fixed after upgrade to 4.33.1 (maybe related to #14222? that's the only fix mentioned in release notes)

For me, the issue was gone for one restart but reoccured on the second and all thereafter on v 4.33.1

thedatabaseme avatar Aug 01 '24 18:08 thedatabaseme

Same issue in our case with v 4.33.1. Docker keeps trying to update wsl after a reboot. It is possible that it does not ask for permissions, but as stated by @thedatabaseme this is always only the case for a single reboot. After that reboot Docker again attempts to perform an update.

In our case Docker tries that within a VM (long story) that does not have any internet access and therefor cannot update anything. In case of that VM, granting the permission does not seem to do anything. My Host PC runs fine and does not ask for these permissions, though which is weird.

I've tried to tell Docker not to do any updates, but all attempts in modifying the settings.json failed so far:

  • Set disableUpdate to true
  • Set showInstallScreen to false
  • Set wslUpdateRequired to false (this will be set to true again by Docker)
  • Set wslInstallMode to an empty string or something like "none"

JohnnyDoesStuff avatar Aug 02 '24 10:08 JohnnyDoesStuff

Same issue in the latest update.... I am fed up !! Since last week, after every reboot (or startup), Docker asks for privileges to update wsl. What is this bug!

vaibhavc2 avatar Aug 05 '24 07:08 vaibhavc2

Hey all, I have shared a development build that should avoid this loop of "WSL Update required" prompts here. Feel free to try that out and report any feedback!

(Please, also note that custom WSL2 kernels are not officially supported in Docker Desktop - some of the diagnostics shared in this and other threads point to that as a common source of the problem)

andrea-reale avatar Aug 06 '24 15:08 andrea-reale

@andrea-reale while i cant try this custom build id like to say thanks for addressing this issue, hope it is solved with an official build soon.

regarding the custom WSL2 kernels: when working with e.g. cilium it is (was?) required to enable additional modules within the kernel (see e.g. https://wsl.dev/wslcilium/), can you point into a direction of where the problems arise for docker desktop? would be a pity if its an either-or-situation.

theBNT avatar Aug 06 '24 18:08 theBNT

Hey @theBNT thanks for sharing your feedback.

It is impossible for us to support officially custom kernels, as Docker Desktop as many dependencies on kernel features and the matrix of combination is impossible to maintain.

That said, with development build I shared above (and future Docker Desktop releases), your custom kernel will most likely continue to unofficially work, if it did in the past.

For full openness, the source of the issue in 4.33.1 comes from the added support to the upcoming WSL2 versions (2.3.11 and above), which will ship a thin kernel with loadable modules support. Docker Desktop needs to load some of these modules at boot. Unfortunately, module loading is disabled and fails hard on WSL2 custom kernels, hence the error you were experiencing. The development build tolarates failing to modprobe kernel modules, this way you can continue using your custom kernel as long as it has the required features built-in.

andrea-reale avatar Aug 07 '24 08:08 andrea-reale

I still have the same issue,

Screenshot 2024-07-29 124957

my UAC settings were always like this,

Screenshot 2024-08-15 135447

and with this setting, I didn't have this problem before.

It suddenly appeared, probably after a Windows update, and is still there.

Has there been any progress on this?

Shaphil avatar Aug 15 '24 08:08 Shaphil

Hi @Shaphil , have you tried the build I shared above in this thread? If you still have problems, please upload your diagnostics and share your ID and we'll try to help!

andrea-reale avatar Aug 20 '24 09:08 andrea-reale

Hi @Shaphil , have you tried the build I shared above in this thread? If you still have problems, please upload your diagnostics and share your ID and we'll try to help!

Yes, I just did, but it failed like this https://github.com/docker/for-win/issues/13806#issuecomment-2272722382

So I reverted to v4.32 like you suggested (https://github.com/docker/for-win/issues/13806#issuecomment-2298732452) and now everything's ok. I will be waiting for Docker Desktop 4.34.

Shaphil avatar Aug 20 '24 16:08 Shaphil

Hi, ~~just set C:\Program Files\Docker\Docker\resources\com.docker.admin.exe to 'Run as admin'. The UAC prompt no longer appears.~~ Worked only with logout, not reboot ;/

pawelel avatar Aug 22 '24 06:08 pawelel