Why Docker can't detect WSL 2 distro in Windows 10 Home?

16.2k views Asked by At

I've followed the instruction in the official website to use docker with WSL 2 and I've installed the Ubuntu 18.04 for WSL 2 distro. I thought docker can automatically detect my distro, so I can choose which distro that will I use in my docker desktop. I've been searching about this issue, and still not get the solution. Please help, thanks.

This is the WSL Integration page, I've set my ubuntu 18.04 as default, but still no luck. Docker WSL Integration page

This is the list of wsl 2 distro that I have

List WSL 2 distro that I have

This is my docker version, it's the latest one. Docker version

Because of this, I can't access the docker container, it said

error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
4

There are 4 answers

2
Thomas F. Abraham On BEST ANSWER

I believe this is because the public version of Docker Desktop for Windows does not yet support the backported WSL 2 support. The Edge/beta version does though.

0
Mohammed Bouaziz On

For anyone still trying to solve this :

Open Docker Desktop => settings icon (top right) => Resources => WSL Integration

Unable the Ubuntu tick, Refresh click on Apply & Restart on the bottom right

Restart a new ubuntu console on your windows: sudo apt-get update

Check if docker is running by just typing : docker on the terminal

It should work.

0
Niv On

For others researching the same problem:

I was running Docker Desktop as an admin and not my regular user. After adding my user to docker-users group in windows, I was able to run Docker Desktop as a regular user.

0
Alviy On

Docker needs user to be in docker-users group. When you try launch admin privilege user Docker Desktop, it looks after WSL distro in admin space and fails any way.

Use cmd style CLI to fix it.

net localgroup docker-users your_username /ADD

After that use Docker and WSL from your regular user.