Docker-Desktop and WSL2 not Jiving

Hello All,
I am new to the DevOps world so forgive me if this question has a simple answer!

I am having issues getting docker to work in WSL2. Whenever I start Docker Desktop I get a windows error saying “WSL integration with distro Ubuntu unexpectedly stopped with exit code 1. Do you want to restart it?”. No matter how many times I restart it, I get the same error.

In Ubuntu, if i try to run “Docker run hello-world” i get the error:
“docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?”
When I try to start docker with ‘sudo service docker start’ it tells me it is starting docker, but ‘service docker status’ always shows that it is not running.

If i open a command prompt window in windows, and run the command for getting started “docker run -d -p 80:80 docker/getting-started” i get an error back saying:
“docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:80 → 0.0.0.0:0: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.”
^^(after looking into this, this is probably a windows thing and ntoskrnl.exe is using port 80 on my system so this may be a separate issue but including just in case)

When i run the self-diagnose tool within Docker Desktop it tells me : “com.docker.wsl-distro-proxy.exe is not running” and “vpnkit.exe is not running”. Not sure what those do or how to fix that, or if thats even my issue.

Troubleshooting Ive done:
-verified that ‘wsl -l -v’ shows Ubuntu is running WSL version 2
-verified windows build is compatible (build 19042)
-uninstalled docker desktop, rebooted, reinstalled as admin
-verified the settings in docker desktop are using WSL2
-tried to expose daemon on tcp://localhost:2375 in docker-desktop settings

Not sure where to go next, so hoping someone can help.

Thanks so much!

I am not sure why you get the original error message, so I will just try to explain what I can.

WSL integration is an optional feature so you can use a Docker client in your favorite WSL distro. You should be able to use Docker from the Windows host. Are you?

I don’t know what can go wrong with the integration, but I installed WSL2 preview version and one Ubuntu distribution didn’t work with Docker Desktop. I got “protocol error”, so it is a different issue and it could be caused by the custom kernel I built for WSL. If you don’t have any customization and WSL integration is enabled in Docker Desktop, that should work, I guess.

It works as expected then. If you want to run the getting started guide, you can chose an other host port. For example 8088. Don’t change the destination port on the right side:

docker run -d -p 8088:80 docker/getting-started

I realized I can’t use Docker Desktop anymore for unrelated reasons. Thanks for the reply, but I’m going to go ahead and “close” this.