docker / for-win

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

wsl integration #13499

Open imgitsha opened 1 year ago

imgitsha commented 1 year ago

<!-im using ubuntu version 2 , docker desktop version 2 windows 10 home

the error is wsl integration with distro ubuntu unexpectedy stopped with exit code 1- i have tried restarting unintalling reset factory setting, clean purge etc any help would be appreciated


READ ME FIRST

This repository is for reporting bugs with the Docker Desktop for Windows software, which we respond to on a best-effort basis.

Do not paste logfiles into github issues: upload diagnostics instead, which are only visible to Docker engineers.

Support requests in this repository (i.e., trouble installing or using the software) will be ignored, but personalized support is available to Docker Pro and Team customers at https://hub.docker.com/support/desktop/, and community support is available from the Docker community Slack (https://www.docker.com/docker-community).

Issues without sufficient detail to debug them will be closed. They generally need a clear title and description, steps to reproduce, and a diagnostics ID. See https://docs.docker.com/docker-for-windows/troubleshoot/#diagnose-and-feedback for how to generate a diagnostics ID either from inside the app or from the command line.


-->

Actual behavior

Expected behavior

Information

Output of & "C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check

Steps to reproduce the behavior

  1. ...
  2. ...
ctalledo commented 1 year ago

Hi @imgitsha, thanks for reporting the issue.

Would it be possible for you to upload a Docker Desktop diagnostics bundle so we can take a look at the logs? Without this info it's really hard for us to pinpoint the issue.

Thanks!

ctalledo commented 1 year ago

Hi @imgitsha,

do i need to pay for uploading diagnostics bundle

No, no payment is necessary. We appreciate you filing the issue, and uploading the diagnostics bundle will help us debug it. Thanks!

samuk190 commented 1 year ago

Don't use wsl2 with docker desktop, its unstable buggy and have severe issue with memory leak (its not issue from wsl, but from docker), it will be waste of time What currently works is using docker desktop with hyper v but you will sacrifice resources all time because it reserve the resources for hyper v VM.

to use docker desktop with htper v you will need upgrade to windows 10 pro or windows 11 pro. I highly recommend windows 11

ctalledo commented 1 year ago

Don't use wsl2 with docker desktop, its unstable buggy and have severe issue with memory leak (its not issue from wsl, but from docker).

FYI, see here for more info on DD WSL memory usage and the causes behind it.

imgitsha commented 1 year ago

Thanks, I'll check it out.

On Fri, 2 Jun 2023, 3:40 am Cesar Talledo, @.***> wrote:

Don't use wsl2 with docker desktop, its unstable buggy and have severe issue with memory leak (its not issue from wsl, but from docker).

FYI, see here https://github.com/docker/for-win/issues/13227#issuecomment-1558534914 for more info on DD WSL memory usage and the causes behind it.

— Reply to this email directly, view it on GitHub https://github.com/docker/for-win/issues/13499#issuecomment-1572855148, or unsubscribe https://github.com/notifications/unsubscribe-auth/A54I5OJCMZNANSCSEJVLAG3XJEHLXANCNFSM6AAAAAAYJGYBXQ . You are receiving this because you were mentioned.Message ID: @.***>

Darkbelg commented 1 year ago

Can you check you virtual hdd disk space?

samuk190 commented 1 year ago

Don't use wsl2 with docker desktop, its unstable buggy and have severe issue with memory leak (its not issue from wsl, but from docker).

FYI, see here for more info on DD WSL memory usage and the causes behind it.

Why you keep recommending something unstable? I answered it on topic, its not a problem related to a specific image, or specific version of Windows, it happens with everyone, some people go back to linux and not complain here, but if you look at issues NO ONE that REPORTED IT, got the problem "FIXED". They did a workaround ( usually bad one like changing .wslconfig ) or switched back to linux.

Only thing that works well so far is Docker Desktop on Hyper V Engine. The only downside is that it locks resource from machine.

ctalledo commented 1 year ago

Hi @samuk190,

We recommend Docker Desktop on WSL because in theory it's a more efficient way to run Docker (e.g., all WSL distros share the same kernel and Windows will allocate and reclaim memory from the WSL VM on demand).

However, what I think you (as well as several other users) are experiencing is that WSL memory usage grows significantly over time, leaving the host without memory. Since the WSL VM will be default grow up to 50% of the RAM size, that can be a problem.

For example, I have a Windows machine with 16GB of RAM. Without even running Docker Desktop (DD), the RAM utilization is 10GB (~60%) for the programs I have (Windows OS, Chrome, Slack, VSCode, etc.) When I start DD and run a few containers, the WSL RAM utilization grows steadily (primarily due to page cache usage inside the WSL VM) and eventually leaves the host without memory.

In contrast, if I run DD with Hyper-v, the DD VM is typically sized to a lower value (e.g., 2GB or 4GB). This in essence ensures that DD will not consume all my host memory (even if inside the DD VM the memory utilization may be high). But if I where to increase the Hyper-v VM size to the same limit as the WSL VM (e.g., 8GB on my host), then the same effect of running out of host mem would occur. Or vice-versa, if I where to limit the WSL VM to 4GB in size (same as the hyper-v VM), then the host won't run out of memory.

The nice thing about WSL is that unlike Hyper-V, the memory is allocated and reclaimed from the WSL VM on demand. Hyper-V on the other hand eats up all the memory right away.

However, I acknowledge DD needs to do a better job on WSL, particularly releasing memory that's not required inside the WSL VM so that the Windows OS can reclaim it back to the host. We are working on this right now, so expect improvements very soon.

Hope that helps.

samuk190 commented 1 year ago

Hi @ctalledo Latest WSL PRE Release fixed the problem!!!!! Tested on docker-desktop but now im using natively on wsl image

.wslconfig

[experimental] autoMemoryReclaim=true

The reclaim was not being done in previous versions of wsl, thats why I said this been for years, and you can see changelog to see the fix addresses this issue, now I can use docker in peace (haha)

in my opinion this issue can be closed now, I thought this problem was happening due to Docker because it only happened with Docker other apps wsl was releasing memory, but now with the latest wsl it seems it was wsl issue because with the new memory auto reclaim its working pretty well!! no more hiccups, freeze, host ouf memory or miracle workarounds!

ctalledo commented 1 year ago

Hi @samuk190, thanks for the update.

Yes, we expect that new WSL feature will help quite a bit, as it allows WSL to better reclaim memory from the WSL kernel back to the host (particularly from the kernel page cache).

I thought this problem was happening due to Docker because it only happened with Docker other apps wsl was releasing memory, but now with the latest wsl it seems it was wsl issue because with the new memory auto reclaim its working pretty well!!

Makes sense. Nonetheless we are also doing more improvements for Docker Desktop in the upcoming releases to better utilize memory, so that combined with the new WSL feature should result in a very noticeable improvement for developers.

Thanks again for the update!