-
Notifications
You must be signed in to change notification settings - Fork 86
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
Failure to install and run Docker in WSL Ubuntu 22.04 (works in 20.04): "Cannot connect to the Docker daemon" #1406
Comments
gives
|
Facing the same issue. Does anybody has a solution for this please? |
Are you fully updated? If you are then maybe you could try using one of the 2 other ways :
You could also try manually download the repo packages through wget on https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/ |
Fully updated, services don't start at all. 22.04 is completely boinked.
|
It seems that you are using WSL version 1. If you want to run Docker within WSL without having the windows Docker client, you have to update it to WSL2. |
As a workaround in dev environment, I installed Docker using the convenience script that installed the latest stable release of Docker ( |
@Adverte No, it's WSL 2. |
In Ubuntu 22.04, it might have an issue with the iptables version. When checking the status, it might still show up not running. Hence, please make sure to switch the iptables to legacy. To switch to iptables-legacy, run the below command to change the default iptables version. Then re-start docker service And check docker status again with If this can solve your problem, please close the issue. |
The above solution worked for me, without needing Docker Desktop. I have no idea how modifying the iptables will affect everything else though. Does this mean that we shouldn't bother with 22.04 for WSL in general and just stick with 20.04? |
@YoshikoJanai imo, you can do anything you want, unless you want to have a specific feature that the lower version doesn't satisfy your desire. |
@40rn05lyv did it work from your side?
|
I had this issue with Linux Mint 21 upgrade; setting iptables to legacy fixed docker not starting. |
similar issues for me too tried some workarounds
root@PRAKASH:~# nohup sudo dockerd & root@PRAKASH:~# sudo docker run hello-world Hello from Docker! To generate this message, Docker took the following steps:
To try something more ambitious, you can run an Ubuntu container with: Share images, automate workflows, and more with a free Docker ID: For more examples and ideas, visit: root@PRAKASH:# ps -a |
I had the same issue upon upgrading wsl to jammy 22.04. I changed iptables to legacy via update-alternatives like you suggested, and the docker service seems to be running now. Thank you. |
Was facing the same issue and solved with @ThaiLe011094 solution! Thank you! |
thanks it help, after upgrade to 22.04 |
+1 on the firewall issue! thanks @ThaiLe011094 |
Thank you. |
I had the same error; upgrading the Linux distro to WSL version 2 and integrating it to the Docker Windows fixed it. https://docs.docker.com/desktop/windows/wsl/#enabling-docker-support-in-wsl-2-distros |
|
thanks |
I was having same problem with Windows 11 Pro. Problem resolved after following @ThaiLe011094 's method.
Below is my machine configuration. Hope that helps.
|
After few hours of digging, your solution worked. |
Thanks! This worked for me! => sudo apt update && sudo apt full-upgrade -y |
I have a similar problem but its a little bit different, i have installed docker desktop with wsl2 on my ubuntu 22.04. It worked pretty well the installation but when i try to run the hello-world container it keeps sending me this message: docker: request returned Internal Server Error for API route and version http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create, check if the server supports the requested API version. I wonder if there's anything i have done wrong... EDIT: I have tried to switch the iptables to legacy but it didnt work. |
same problems |
after install it's work, but after reboot |
I have the same problem (Windows 11 + WSL 2 → Ubuntu 22.04.3 LTS). I need to take some actions every morning (when I turn on my pc):
That can't start and show me the message:
That starts normallly. After this, my day starts. |
I have the same issue with WSL2 Ubuntu-22.04 on windows 11
switching iptables to legacy version solved the issue ( |
I get this error: I can tell right away this is due to my customized Kernel. Docker appears to need modules within the Kernel that most things don't need. I know that I stripped down IPtables. It would be nice to find a Docker list of Kernel module dependencies. So for some of you, maybe try one of the default Ubuntu Kernels? I'll mess with this more this weekend, hopefully. |
thanks , sudo apt update && sudo apt install docker.io -y that's working |
This is the right solution, Thanks for posting the same. |
This is the hack guys |
The issue I had was that apparently docker now installs via snap and well that causes a bit of a break -- where sudo service docker start returns a no docker.service file located changed into directory: /etc/systemd/system/ I see a few snap.doccker files and decied to do a copy of cp snap.docker.dockerd.service docker.service Reboot machine or sudo systemctl daemon-reload After that the command docker.service works as expected |
THIS REALLY WORKS. but i reinstalled docker and follow these steps |
Steps to reproduce the behavior
OS: Windows 10 21H2
Enabled features: Virtual Machine Platform, Windows Subsystem for Linux
Steps:
Install a WSL Ubuntu 22.04 distribution and run it.
Set any username/password during installation password.
Perform all steps from official Docker installation guide (https://docs.docker.com/engine/install/ubuntu/):
Start service:
sudo service docker start
.Verify installation:
sudo docker run hello-world
.Expected behavior
sudo docker run hello-world
starts a sample container.Actual behavior
sudo docker run hello-world
fails with a messagedocker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
.!!!!!!
NOTE: the same steps works ok with Ubuntu 20.04
!!!!!!
Output of
docker version
:Output of
docker info
:The text was updated successfully, but these errors were encountered: