Problem description
Visual Studio Code’s Containers (Dev Containers) extension reports Failed to connect. Is Docker installed and running? even though Docker is installed and the daemon is running. This typically occurs because the current user does not have permission to access the Docker daemon socket.
Solution
Add the user to the docker group and restart the session so the new permissions take effect. Open the terminal and run the following commands:
sudo usermod -aG docker $USER
sudo reboot
After reboot, verify that Docker works without sudo. Open the terminal and run the following command:
docker ps
Once this succeeds, VS Code will be able to connect to Docker normally.