4

I seem to be unable to create any new dev containers on WSL2 Ubuntu (worked fine before) and I don't know how to debug this.

Environment

  • Windows 11
  • WSL2 with Ubuntu distribution
  • VSCode 1.75.1
    • Extension: Dev Containers 0.275.1 or 0.279.0 (no difference observed)
    • Extension: WSL 0.75.3
  • Docker on Windows: none
  • Docker on WSL Ubuntu: 20.10.22

Scenario

  • Open WSL2 Ubuntu terminal
  • Go to desired development folder
  • Start code .
  • VSCode shows on Windows (Mentioning remote host "WSL:Ubuntu")
  • Command: Dev Containers: Create dev container (e.g. Python container)
  • Error shows: Docker returned an error. Make sure the Docker daemon is running and select an option how to proceed.
  • Log shows: Start: Run: docker version --format {{.Server.APIVersion}} [883 ms] findLocalWindowsExecutable: Exectuable 'docker' not found on PATH 'C:\Windows\system32;(...)'. [885 ms] Exectuable 'docker' not found on PATH 'C:\Windows\system32;(...)'. [890 ms] Docker returned an error code ENOENT, message: Exectuable 'docker' not found on PATH 'C:\Windows\system32;(...)'.

Already tried

  • Previous creation of such dev containers on this environment worked fine.
  • Executing the old dev containers on the current environment still works fine.

Question

  • I don't know where to get started to debug this. Probably something changed in my environment causing the creation of dev containers to fail, but I have no clue. I can't really reconstruct what would have changed to the setup.
  • I didn't expect devcontainers to go and look for docker on my Windows path... I read about docker cli being used under the hood, but I never had docker on this Windows system, so it mustn't be essential in the WSL2 setup since it worked before.

Thanks, Johan

1 Answer 1

8

Maybe you fixed your problem in the meantime, but i was facing exactly the same problem. After some searching, i finally found the solution in the following blog article: https://www.tecracer.com/blog/2023/01/devcontainers-on-windows-without-docker-for-desktop.html

To solve it, just enable the following setting in VS Code Settings:

Settings -> Dev Containers -> Execute in WSL (Applies to all profiles)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.