You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ubuntu running under WSL2 not seeing Docker daemon at unix:///var/run/docker.sock #5096
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
and from Ubuntu WSL2 (only distro installed)
docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
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.
Reacted by Erokos, Kelven G. Campos, Alexandro Willian Hervis , Ivy Wang, duongloihai, Milad Vaziri, Erick Agrazal, Rafa Cardoso, linuxadmin25, taoufikrais and 5 more
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?
@mwoodpatrick you need to go to the settings, and enable integration with your distro in "Resources -> WSL Integration".
Reacted by Valentin Legrand, Yoav Balasiano, anthonyxiques, Mike Dickey, lorenzulrich, Kibria Shuvo, Sonus Sundar, Borre Mosch, Tomas Sedlak, Adrian Nistor and 128 more
Reacted by Michael Qin, David Corbin, Sukirti Pandey, danmut, Alexander Iljushkin ✅, Armin Vieweg and SzymonGesele
Reacted by Roy Boivin II, Vanessa, jm-paulin, Pablo, Oliver Salzburg, Eka Cahya Pratama, Michael Qin, Greg Cota, Bruno Ferreira, Gabriel Costa Moura and 12 more
Reacted by Leonardo Minari, Gheorghe Gherciu, SzymonGesele and Raymond Luis
Reacted by Tomas Sedlak, Sebastian Buckpesch, Adrian Nistor, Ilya Eriklintsev, Carlin MacKenzie, Evan Loughlin, Justin Collier, Ghislain Proulx, cyberm1nd, KokoTa and 34 more
Reacted by Armin Vieweg and SzymonGesele
Reacted by Alexander Iljushkin ✅, DylanMorison, zohar, Zhen and SzymonGesele
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?
Reacted by Carlin MacKenzie, Wompeter, sanchitjainv2, Ali Sanjabi, Mike DuPont, Siddharth, Andrey Diakov, Agrover112, Dave Jensen, Ronan O'Malley and 6 more
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 ?
Reacted by Bruno Ferreira, YUJIE WANG, Lucas Campbell, David Axelrod, Sekhar Routray, Umar, Nardu Malherbe, CYC, Ismail Kose, aaporras3 and 1 more
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>
.
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.
Reacted by Prayag Singh, Leandro Osorio, Matthieu, ctrmcubed, Safi, Adrian Joian, Matthew Casperson, 90DY, Samy Dindane, Michael Richardson and 19 more
Reacted by Andrey Diakov, spicylentils, Erick Bravo, Bruno Alfieri, Martin Vrabel and Gustav
Then I restarted docker desktop and it worked again:
powershell$ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default * Current DOCKER_HOST based configuration npipe:////./pipe/docker_engine swarm
wsl$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Then I restarted docker desktop and it worked again:
powershell$ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default * Current DOCKER_HOST based configuration npipe:////./pipe/docker_engine swarm
wsl$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Then I restarted docker desktop and it worked again:
powershell$ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default * Current DOCKER_HOST based configuration npipe:////./pipe/docker_engine swarm
wsl$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Windows: Windows 11 Home Insider Preview 22483.1000, Feature Experience Pack 1000.22483.1000.0
WSL: Ubuntu 20.04
FWIW, this issue only popped up after explicitly enabling integration with Ubuntu in Docker Desktop settings.
Prior to that, I had only checked Default Distro because I thought that meant Ubuntu, but it did not. So I had been using it without the integration for some time.
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.
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.
@timothydavis thank you very much. this worked for me
@mwoodpatrick you need to go to the settings, and enable integration with your distro in "Resources -> WSL Integration".
I am doing this, but it seems to reset after a reboot of Windows (shutdown /g as in CMD). I turned on integration yesterday, and it's off today morning. I did click "Apply", and some other settings (such as checking for updates in Docker Desktop) persist.
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen comment.
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.
/lifecycle stale
Activity
zeehjr commentedon Nov 7, 2019
Which output do you see when running the following statement on powershell/cmd?
docker context lsWhich output is returned when you run the follow statement on WSL terminal?
docker psliyo commentedon Nov 7, 2019
Same issue here.
@zeehjr
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.
liyo commentedon Nov 7, 2019
Fixed it by switching to Linux containers...
mwoodpatrick commentedon Nov 8, 2019
simonferquel commentedon Nov 8, 2019
@mwoodpatrick you need to go to the settings, and enable integration with your distro in "Resources -> WSL Integration".
mwoodpatrick commentedon Nov 8, 2019
mikedickey commentedon Nov 10, 2019
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?
simonferquel commentedon Nov 12, 2019
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 ?
mwoodpatrick commentedon Nov 12, 2019
stewartadam commentedon Nov 13, 2019
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.
HawkiesZA commentedon Nov 19, 2019
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.
ilerik commentedon Dec 4, 2019
Thanks a lot! Never thought of such a possibility!
luck02 commentedon Dec 13, 2019
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
wsl -l -vflipch commentedon Dec 13, 2019
I can't seem to get WSL 2 to connect with Docker.
From powershell

From WSL 2 Debian

Docker version

Docker Resources > WSL Integration

Am I missing something?
luck02 commentedon Dec 13, 2019
One update, when I check the docker logs I do see this:
Which is presumably cruft leftover from my WSL 1 based ubuntu instance.
78 remaining items
zeromask1337 commentedon Sep 2, 2021
I solved this problem by running
sudo service docker start. Its because systemctl doesn't work on wsl and you have to use Sysvinit.muhammadsheraz commentedon Sep 5, 2021
This solution saved me, thanks a lot man!
toreylittlefield commentedon Oct 11, 2021
@ldormoy thank you very much! I can confirm this solution worked for me.
GavinRay97 commentedon Nov 22, 2021
Thank you so much! This fixed it for me as well:
4.0.0 (67817)Windows 11 Home Insider Preview 22483.1000, Feature Experience Pack 1000.22483.1000.0Ubuntu 20.04FWIW, this issue only popped up after explicitly enabling integration with
Ubuntuin Docker Desktop settings.Prior to that, I had only checked
Default Distrobecause I thought that meantUbuntu, but it did not. So I had been using it without the integration for some time.Muhannadimad commentedon Jan 21, 2022
I am running wsl2 (Ubuntu-18.04) and I ran into the same issue.
I solved the problem using:
1- By default your ubuntu doesn't have 'docker engine', and to install it follow these steps: https://docs.docker.com/engine/install/ubuntu/ .
2- Start docker daemon using this command:
service docker start.timothydavis commentedon Jan 26, 2022
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.
veysel-dtech commentedon Jun 17, 2022
@timothydavis thank you very much. this worked for me
eccentricOrange commentedon Jul 3, 2022
I am doing this, but it seems to reset after a reboot of Windows (
shutdown /gas in CMD). I turned on integration yesterday, and it's off today morning. I did click "Apply", and some other settings (such as checking for updates in Docker Desktop) persist.docker-robott commentedon Oct 1, 2022
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with
/remove-lifecycle stalecomment.Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an
/lifecycle frozencomment.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.
/lifecycle stale
docker-robott commentedon Nov 30, 2022
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.
/lifecycle locked