Going just with adding the boot command to wsl.conf, I don't get a permission denied error, but 'docker version' gives version information and the Cannot connect to the Docker daemon at unix:///var/run/docker.sock.... error. using command = "sudo service docker start" has the same effect. Editing the .profile does work though
That's interesting to know about. I haven't tried yet with Ubuntu 22.04, but I will try and update the guide in case something like this is missing. Thank you!
Going just with adding the boot command to wsl.conf, I don't get a permission denied error, but 'docker version' gives version information and the
Cannot connect to the Docker daemon at unix:///var/run/docker.sock....
error. usingcommand = "sudo service docker start"
has the same effect. Editing the .profile does work thoughI have the same issue. I'm using WSL2. Any solution?
I've the same issue, and using wsl2 and ubuntu 22.04;
I found the possible reason.
If you are using debian or some ubuntu version that has iptables-nft as default:
Install Docker on Windows (WSL) without Docker Desktop.
Try it
sudo update-alternatives --config iptables
and change it to iptable-legacy
It works for me. ;)
That's interesting to know about. I haven't tried yet with Ubuntu 22.04, but I will try and update the guide in case something like this is missing. Thank you!
It turns out that it's indeed necessary for Ubuntu 22.04 on WSL. So, I added instructions for it in the guide. Thanks again for pointing out!
Just to update you, later versions of docker seems to have fixed the issue without requiring this step so I have removed it from the guide.
This specific feature is only available in Windows 11. See the link below for reference.
I also updated the guide to make this clearer.
docs.microsoft.com/en-us/windows/w...
But you can, of course, just use the alternative approach as the guide mentions.
Most likely your WSL version isn't new enough to support this feature.