When we work with WSL2 and Docker to create containers using Visual Studio Code Dev Containers feature we migth face some issues that are trick to identify. One of them are when the Dev Container in Visual Studio is unable to connect with Docker Desktop even though Docker Engine is running:

image.png

image.png

Visual Studio Code [Dev Container ERROR]:

image.png

So…what the heck might be the issue here?

Well…there’s one configuration from Docker Desktop that might be unable and can be the root of this problem my friend. Docker Desktop has a specific configuration in order to be able to communicate with you WSL distro.

Go to Settings > Resources > WSL integration

image.png

image.png