I am working on a Windows 10 machine but connecting to a Linux server (Ubuntu 22.04) over SSH using vscode to develop. On the Linux server, I am developing a devcontainer. I have been running into an issue that has been slowing down my progress whenever I build my devcontainer (by selecting Dev Containers: Rebuild Container or Reopen in Container).
Looking at the log when the devcontainer is opening, I see one of the first steps is to try to connect to WSL. I assume this is happening because even though I am developing on a Linux server, I am SSHing from a Windows machine that is running vscode. The problem is that this step takes 4 minutes every time I build. And I don’t want to use WSL at all so I am waiting 4 minutes for that step to fail before the rest of my devcontainer will build anytime I make a change where I need to rebuild the devcontainer.
Are there any settings that can be used to skip that step or force it to fail quickly so development can be sped up?
2
Answers
It seems that the docker error is slowing the process.
When I search for it I found this post. I also think this github issue may help you.
Basically the stack overflow discussion was solved by using the command
"runArgs": ["--gpus", "all"]
instead of"runArgs": ["--gpus all"]
. The flag and the argument needs to be their own strings.Take a look at this github issue.
I ran into a similar issue in the past where WSL was working fine but it stopped working after I installed Docker. When I would try to open my Ubuntu distribution from WSL it would just hang and if I tried to open Docker Desktop it would also hang but never open.
From the log you posted, it reminds me of the issue I had with Docker and WSL interacting. The lines that say
Could not connect to WSL; command failed: wsl -l -v
suggest that WSL is just hanging until vscode deems it acceptable to error out and then moves on.The link details the following steps:
Follow the official steps on how to install WSL 2 at
https://docs.microsoft.com/en-us/windows/wsl/install
Open PowerShell and run command:
Uninstall Docker.
Delete temporary data:
Reinstall Docker, ensure wsl box is ticked during install.
Restart computer.
Run Docker as administrator.
Run PowerShell as administrator.
Run the following command:
If this doesn’t work, you may need to run the above command one or two more times.