-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ubuntu running under WSL2 not seeing Docker daemon at unix:///var/run/docker.sock #5096
Comments
Which output do you see when running the following statement on powershell/cmd? Which output is returned when you run the follow statement on WSL terminal? |
Same issue here.
and from Ubuntu WSL2 (only distro installed)
Strangely, the WSL Integration option is not available from Settings > Resources. WSL 2 based engine is enabled in Settings > General. Docker CLI is installed in Ubuntu. |
Fixed it by switching to Linux containers... |
I'm running with Linux containers and am seeing problem
in power shell
PS C:\WINDOWS\system32> docker context ls
NAME DESCRIPTION DOCKER
ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default * Current DOCKER_HOST based configuration
npipe:////./pipe/docker_engine swarm
wsl Docker daemon hosted in WSL 2
npipe:////./pipe/docker_wsl
In WSL 2 ubuntu shell
docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the
docker daemon running?
…On Thu, Nov 7, 2019 at 3:39 PM Pablo Wolochwianski ***@***.***> wrote:
Fixed it by switching to Linux containers...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5096?email_source=notifications&email_token=AAQ6SQWJIKQKG2KOW7HB67LQSSRM3A5CNFSM4JKMAN3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDOGZFQ#issuecomment-551316630>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ6SQQONCXEHFKQNON3W6TQSSRM3ANCNFSM4JKMAN3A>
.
--
Mark Wood-Patrick
|
@mwoodpatrick you need to go to the settings, and enable integration with your distro in "Resources -> WSL Integration". |
Many thanks that worked
…On Fri, Nov 8, 2019 at 12:02 AM Simon Ferquel ***@***.***> wrote:
@mwoodpatrick <https://github.com/mwoodpatrick> you need to go to the
settings, and enable integration with your distro in "Resources -> WSL
Integration".
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5096?email_source=notifications&email_token=AAQ6SQULY6OFOLPGZ4CZT5DQSUMJ3A5CNFSM4JKMAN3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDPBSGY#issuecomment-551426331>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ6SQSKF43N7HNUV4OW4LTQSUMJ3ANCNFSM4JKMAN3A>
.
--
Mark Wood-Patrick
|
Ran into same problem, and resolved via "Resources -> WSL Integration" This isn't clear anywhere, so I'd suggest adding a popup or something when you "Enable the Experimental WSL 2 Engine." Perhaps it should prompt you for list of distros you want to enable after you turn it on? |
Thanks for those feedback. I understand that this new behavior causes issues. We are giving some thoughts at always enabling integration with the default WSL distro. Would it make things better ? |
That would work for me, or perhaps a dialog box at startup showing which
distros are enabled and ability to modify that would be better, perhaps
with an option not to show this dialog at startup in future
…On Tue, Nov 12, 2019 at 12:57 AM Simon Ferquel ***@***.***> wrote:
Thanks for those feedback. I understand that this new behavior causes
issues. We are giving some thoughts at always enabling integration with the
default WSL distro. Would it make things better ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5096?email_source=notifications&email_token=AAQ6SQU7FG737QKO3AZBLKDQTJVYLA5CNFSM4JKMAN3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDZQLIY#issuecomment-552797603>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ6SQSVNJSL77RB5S4XN2TQTJVYLANCNFSM4JKMAN3A>
.
--
Mark Wood-Patrick
|
A simple note under the Enable the WSL 2 based engine heading (as there is already in light grey) noting the requirement to also configure distros, along with a hyperlink/button to jump there would be more than sufficient. |
Having something pop up in General settings telling you which distros are enabled (and maybe warning you that none are currently active) would be helpful. |
Thanks a lot! Never thought of such a possibility! |
I can't seem to get the WSL context:
I've enabled wsl 2 for my ubuntu machine. But in ubuntu terminal I get:
I'm on docker desktop 2.1.7.0 (41536) Output from PS
|
One update, when I check the docker logs I do see this:
Which is presumably cruft leftover from my WSL 1 based ubuntu instance. |
I ran into the same issue. I had to delete all WSL broken symbolic links previously created by Docker Desktop. Reinstalling Docker Desktop was not enough. Here are the commands I ran to achieve that:
Then I restarted docker desktop and it worked again:
Docker Desktop: 2.1.7.0-edge |
Hello I seem to have the same issue. Reinstalled DD and reenabled WSL2 integration still didn't create the WSL context. @ldormoy : As you didn't have WSL context enabled and now have it, can you explain all steps you did take in addition to the commands you shared? FYI, in Ubuntu having uninstalled Docker Desktop am having this:
Thanks |
Well that's the thing, I don't have it but it still works. I don't know whether this WSL context is a legacy feature from WSL 1, but in my case all I did was to check the docker logfile (it is available if you start a troubleshooting session) and delete the broken symbolic links until the logs are clean. |
After I deleted the docker cruft from my original install everything worked. In my case I think I also found I had serious issues with my zsh config so I just blew away my ubuntu and started fresh. Worked fine after that, still no second WSL context, not sure what that all means though. |
Which settings? I am using docker cli in WSL |
@ankitjena Click on Docker's tray icon. Then navigate to Settings> Resources> WSL Integration. |
Just a heads up for anyone having this issue and everything here has been checked out. I realized that docker-desktop-proxy process wasn't running inside the distribution ( I tried to start it manually with the following command (copied from a working system):
When I ran this I got the following error:
So I went into Settings -> Resources -> WSL Integration and turned it off for the distribution not working. Then I removed that docker-desktop-bind-mounts directory. Flipped back on the WSL Integration for the distribution and bang it works. Hope this helps anyone else. Cheers. |
Thanks for the workaround. I should be able to use that for fixing the underlying issue. |
I'm finding that docker turns off the WSL integration every now and again. It also looses my sign-in information. All the other settings seem to stay in place |
I'm running Docker Desktop 2.2.0 and I'm unable to run docker on my wsl distro without sudo. Also note that: |
You need to follow the instructions here https://docs.docker.com/install/linux/linux-postinstall/ |
@nielswart there is not "docker_wsl" context anymore. Also, you seem to have your DOCKER_HOST environment variable set to tcp://loclhost:23750. You need to unset it to work with docker-desktop. |
I solve my probolem with https://docs.docker.com/docker-for-windows/wsl/ |
I have perfectly working WSL2 Ubuntu 20.04 with all additions provided by Ubuntu developers like systemd enablement. Maybe, the problem is that Ubuntu 20.04 works too well? They are ahead in the CNCF rase but RedHat is closing the gap. |
Thanks @pneborg. It works for me after below changes. |
I experienced the same problem and even after going through the following instructions: https://docs.docker.com/engine/install/linux-postinstall/ , still did not allow me to execute docker commands without sudo.
There probably is a better solution than this, but it worked for me in the meantime. This will then unset the DOCKER_HOST variable each time a bash terminal is opened. |
I use this way,it's works!!!!!! |
this fixed it for me too... but I had to kill and restart my |
I don't know what's going on here, but Docker Desktop broke my Kubernetes install again. Every time I upgrade, it breaks something. First it deactivated Kubernetes integration, so I had to re-enable that: WSL integration was still enabled, but make sure that's checked too:
I don't recall if I had that checked or not before, but it stopped working one way or another, or perhaps that's due to the next issue... I think when Docker Desktop uninstalled Kubernetes by itself, it killed the certificates along with it. So I was also getting errors like this:
So from PowerShell (Windows side) I ran:
And then manually copied the N.B. I have my
Which I set awhile back I think because of some WSL networking shenanigans. Of course it also lost or destroyed all my volumes so now all my test data is gone and my database won't boot. |
Same problem here. Suddenly, since some recent upgrade, the integration with my Ubuntu 20.04 distro (which IS my default distro...) broke, and I had to manually re-enable it... |
I managed to get docker using WSL2 with Ubuntu 2004 distro right away by following docker desktop documentation, however, I had to use SLES distro for one of my projects and it didn't work - docker wsl2 integration component refused to come up. Docker Desktop threw the following message: And within SLES I was getting:
So I followed the workaround provided in this message and managed to make it working by just starting the
Note that I copy-pasted the exact same exec string from ubuntu, i.e. keeping
|
To be clear, run these commands in your linux container that is having issues. Then from Windows restart the whole Docker service. not just the app. Right click the icon in your tray and restart. I think for me this was an issue bcause my container was originally a v1 container and the migration doesnt do a good enough job at cleanup. Thank you @williscool ! |
|
getting the same error: |
I solved this problem by running |
This solution saved me, thanks a lot man! |
@ldormoy thank you very much! I can confirm this solution worked for me. |
Thank you so much! This fixed it for me as well:
FWIW, this issue only popped up after explicitly enabling integration with Prior to that, I had only checked |
I am running wsl2 (Ubuntu-18.04) and I ran into the same issue. I solved the problem using: 2- Start docker daemon using this command: |
If you are trying to do this without docker desktop on Ubuntu. You can edit your /etc/docker/daemon.json and set the path to unix:///var/run/docker.sock this will make commands work inside of linux shell. |
upgrade wsl to wsl2 and restart docker desktop |
@timothydavis thank you very much. this worked for me |
I am doing this, but it seems to reset after a reboot of Windows ( |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. /lifecycle locked |
When running docker desktop version 2.1.5.0 (40323) on:
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.19013 N/A Build 19013
Eben though WSL 2 based engine is enabled in Settings/General
docker container run hello-world on Ubuntu reports
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
The text was updated successfully, but these errors were encountered: