Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running 'code .' in terminal in wsl produces an error

I recently installed wsl and running code . in the terminal I get this error:

Updating VS Code Server to version f80445acd5a3dadef24aa209168452a3d97cc326
Removing previous installation...
Installing VS Code Server for x64 (f80445acd5a3dadef24aa209168452a3d97cc326)
Downloading: 100%
Failed
--2022-03-01 20:19:21--  https://update.code.visualstudio.com/commit:f80445acd5a3dadef24aa209168452a3d97cc326/server-linux-x64/stable
Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 40.64.128.224
Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|40.64.128.224|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://az764295.vo.msecnd.net/stable/f80445acd5a3dadef24aa209168452a3d97cc326/vscode-server-linux-x64.tar.gz [following]
--2022-03-01 20:19:25--  https://az764295.vo.msecnd.net/stable/f80445acd5a3dadef24aa209168452a3d97cc326/vscode-server-linux-x64.tar.gz
Resolving az764295.vo.msecnd.net (az764295.vo.msecnd.net)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘az764295.vo.msecnd.net’
ERROR: Failed to download https://update.code.visualstudio.com/commit:f80445acd5a3dadef24aa209168452a3d97cc326/server-linux-x64/stable to /home/burbanox/.vscode-server/bin/f80445acd5a3dadef24aa209168452a3d97cc326-1646176740.tar.gz

I need to know how I can solve it to be able to open visual studio code

like image 271
Harold Burbano Avatar asked Dec 11 '25 23:12

Harold Burbano


1 Answers

  1. Open VS Code from Windows
  2. Open command palette Ctrl + Shift + p
  3. Type WSL and select option WSL: connect to WSL using Distro
  4. Select your distro, for example Ubuntu-22.04

Now if you try command code . from WSL it should work.

This seems to me a network issue in WSL. By doing the above steps, the vscode gets updated from the windows side instead from inside WSL which was failing previously.

like image 69
PR7 Avatar answered Dec 13 '25 18:12

PR7