docker / for-win

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

Docker Desktop is not integrating with a non-default WSL distribution #12926

Closed joeleisner closed 2 years ago

joeleisner commented 2 years ago

Actual behavior

When installing Docker Desktop with the WSL2 based engine enabled, my default distro is integrated to use Docker as expected. However, when attempting to integrate another (non-default) distro, it does not set up properly. (See attached screenshot)

Docker Desktop is integrating with my default WSL distro as expected, but is not being properly set up with my additional (non-default) WSL distro.

Not sure if it's of any help, but both distros in the screenshot (Ubuntu-22.04-personal and Ubuntu-22.04-work) were based off the same Ubuntu 22.04 install from the Microsoft Store (which was exported and imported twice using different names).

Expected behavior

Enabling WSL Integration on a non-default distro should automatically set up Docker integrations.

Information

I have attempted to terminate both the docker-desktop and docker-desktop-data WSL distros and restarting Docker Desktop to rerun them. I have also attempted multiple clean installs of Docker Desktop to no avail.

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

[2022-08-22T15:21:58.458145500Z][com.docker.diagnose.exe][I] set path configuration to OnHost
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0031: does the Docker API work?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0001: is the application running?
[SKIP] DD0018: does the host support virtualization?
[PASS] DD0002: does the bootloader have virtualization enabled?
[PASS] DD0017: can a VM be started?
[PASS] DD0024: is WSL installed?
[PASS] DD0021: is the WSL 2 Windows Feature enabled?
[PASS] DD0022: is the Virtual Machine Platform Windows Feature enabled?
[PASS] DD0025: are WSL distros installed?
[PASS] DD0026: is the WSL LxssManager service running?
[PASS] DD0029: is the WSL 2 Linux filesystem corrupt?
[PASS] DD0035: is the VM time synchronized?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0005: is the user in the docker-users group?
[PASS] DD0007: is the backend responding?
[FAIL] DD0014: are the backend processes running? 1 error occurred:
        * vpnkit.exe is not running

[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0006: is the Docker Desktop Service responding?
[PASS] DD0012: is the VM networking working?
[PASS] DD0032: do Docker networks overlap with host IPs?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0033: does the host have Internet access?

Please investigate the following 1 issue:

1 : The test: are the backend processes running?
    Failed with: 1 error occurred:
        * vpnkit.exe is not running

Not all of the backend processes are running.

Steps to reproduce the behavior

  1. Install the latest Docker Desktop for Windows (with WSL2 based engine enabled).
  2. Once running, go to Settings > Resources > WSL Integration and "enable integration with additional distros" on a non-default WSL distro.
  3. Open up the WSL distro "enabled" in step 2. via Windows Terminal.
  4. Run docker ps and which docker to confirm issue.
joeleisner commented 2 years ago

Additional information: Checking ls -la /usr/bin | grep docker in the Ubuntu-22.04-work WSL distro shows no symlinks (unlike my Ubuntu-22.04-personal which has those symlinks). (See attached screenshot).

A screenshot of two WSL distros, one (top-left) has the Docker-related executables symlinked to /usr/bin, whereas the other one (bottom-right) does not have these symlinked.

Attempting to manually symlink these executables shows the following error (when attempting to run docker ps):

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Please let me know if you need additional information!

joeleisner commented 2 years ago

Addition information: Exported my Ubuntu-22.04-work WSL distro and reimported it as a different name; Docker Desktop still wouldn't integrate with it. Additionally, I installed a completely different WSL distro from the Microsoft Store (SUSE Linux Enterprise Server 15 SP4) and attempted to integrate Docker Desktop with it and it still didn't work. Looks like my Docker Desktop is refusing to integrate with additional WSL distros outside the default one?

joeleisner commented 2 years ago

Additional information: Deleting the .docker directory in the home directories of my WSL distros as well as in the home directory of my Windows user and reinstalling Docker Desktop did not fix the issue.

joeleisner commented 2 years ago

Additional information: I've added my diagnostics ID to the first comment.

joeleisner commented 2 years ago

Additional information: Updated to Docker Desktop v4.12.0 (85629) - No changes, issue still persists.

joeleisner commented 2 years ago

Additional information: Just noticed the following notification message from Docker Desktop:

Docker Desktop WSL integration unexpectedly stopped

Docker Desktop - Ubuntu 22.04-work WSL integration with distro Ubuntu-22.04-work unexpectedly stopped with exit code 1. Do you want to restart?

joeleisner commented 2 years ago

Additional information: After researching the above error a bit more, I saw some folks were able to manually set up the integration using /mnt/wsl/docker-desktop/docker-desktop-user-distro proxy. When running...

sudo /mnt/wsl/docker-desktop/docker-desktop-user-distro proxy --distro-name Ubuntu-22.04-work --docker-desktop-root
/mnt/wsl/docker-desktop

... in my WSL distro, the following output gets returned...

[2022-09-13T20:29:34.823765815Z][docker-desktop-user-distro][I] set path configuration to InsideWslWorkspace
[2022-09-13T20:29:34.825633732Z][docker-desktop-user-distro in Ubuntu-22.04-work][I] mounting /home/joel/development/docker/terminalfour/terminalfour-8.3.9-FINAL-329.war to /mnt/wsl/docker-desktop-bind-mounts/Ubuntu-22.04-work/de6865e85b3cf6250e3ccaa3ecbedd72b7ed0f608d7011b81da2df099684f74c
[2022-09-13T20:29:34.826107152Z][docker-desktop-user-distro in Ubuntu-22.04-work][I] mounting /mnt/c onto itself
[2022-09-13T20:29:34.826391741Z][docker-desktop-user-distro in Ubuntu-22.04-work][I] mounting /home/joel/development/misc/server-images/ts.jupiter to /mnt/wsl/docker-desktop-bind-mounts/Ubuntu-22.04-work/540bff43293cf84c67bb0936c11df761e14af827baebdd040f8f6c57530b2eba
[2022-09-13T20:29:34.826556881Z][docker-desktop-user-distro in Ubuntu-22.04-work][W] restoreMounts: ensure ready failed: mkdir /home/joel/development/misc/server-images/ts.jupiter: file exists
[2022-09-13T20:29:34.826680011Z][docker-desktop-user-distro in Ubuntu-22.04-work][F] mkdir /home/joel/development/misc/server-images/ts.jupiter: file exists
[main.run()
[       docker-desktop-user-distro/main.go:118 +0x4a7
[main.glob..func6(0x14d14a0?, {0xc000424e80?, 0x4?, 0x4?})
[       docker-desktop-user-distro/main.go:79 +0x17
[vendor/github.com/spf13/cobra.(*Command).execute(0x14d14a0, {0xc000424e40, 0x4, 0x4})
[       vendor/github.com/spf13/cobra/command.go:860 +0x663
[vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x14d1220)
[       vendor/github.com/spf13/cobra/command.go:974 +0x3bd
[vendor/github.com/spf13/cobra.(*Command).Execute(...)
[       vendor/github.com/spf13/cobra/command.go:902
[main.main()
[       docker-desktop-user-distro/main.go:512 +0x25

It somehow trying to mount a custom docker image instead of my WSL distro? I'm assuming this is why nothing is working.

joeleisner commented 2 years ago

Additional information: I've got it running! Taking a look at the previous proxy setup output, I noticed a few key things:

  1. It was attempting to mount a terminalfour-8.3.9-FINAL-329.war file (which did exist)
  2. It was attempting to mount a ts.jupiter symlink (which no longer existed)

I have no idea why Docker would need/want to mount these files, but after clean installs, it shouldn't know about them in any capacity (so some old configuration was left after multiple attempts to wipe everything clean).

However, after removing the files and broken symlinks in question, everything is running as expected (see below screenshot).

Docker running as expected under my work WSL distro.

I guess I'll close this out on my own. Hopefully this can help someone out in the same circumstance!

docker-robott commented 2 years ago

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked