WSL integration with distro Ubuntu unexpectedly stopped with exit code 1

I have been running the gauntlet of switching to Windows 11 from ubuntu. The reason I am able to make the switch is because of WSL (windows subsystem for linux). My job requires me to use docker and docker compose so I tried using Docker Desktop.

Setting up Windows 11 + WSL 2 + Docker Desktop seemed so simple, and everything works intuitively except for one major problem:

“WSL integration with distro Ubuntu unexpectedly stopped with exit code 1”

This error appears seemingly at random whenever I run any docker command in the WSL bash prompt.

docker -v
docker run hello-world
docker compose up -d
etc…

The error comes as a native windows 11 notification and offers a button labeled “Restart It”, well in a typical workday I will need to hit this button anywhere from 0 to 50 times. It is incredibly annoying and I was at my wits end trying to fix it. I reinstalled my OS two times thinking that I messed something up somewhere.

Eventually, I realized something the Docker docs don’t point out about using Docker on windows.

You can simply follow the regular installation instructions for Installing Docker Engine on Ubuntu from within the WSL bash. So far this error has disappeared, but I still have my fingers crossed.

I am making this post in the hope that it helps someone else out there who is getting frustrated with Docker Desktop for Windows. I think you may still need the desktop app if you are doing windows containers, but that is not a requirement. If you are seeing this error about WSL integration stopping, just stop using Docker Desktop and follow the guide here using the WSL 2 bash Install Docker Engine on Ubuntu | Docker Documentation