microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.64k stars 285 forks source link

'code' not found WSL - Microsoft VS Code #9838

Open kkhan2023 opened 5 months ago

kkhan2023 commented 5 months ago

Hello,

I have installed an instance of WSL2 and Microsoft VS code on my windows 11 machine. I have also installed WSL extension on VS code however when i type code in the Ubuntu/WSL terminal, it states that the file is 'not found'

I have ran the debug command and the output is as follows. Please can you asssist?

aeschli commented 5 months ago

Can you check if /home/kasam/.vscode-server/bin/e170252f762678dec6ca2cc69aba1570769a5d39/bin/remote-cli/code exists?

Maybe it got corrupted?

kkhan2023 commented 5 months ago

Hello, Thanks for the tips.

I have now resolved this issue with the following steps:

'Code' not found

Within the WSL terminal, type rm -r ~/.vscode-server to delete the VS Code WSL server.

Exit the terminal and from your PowerShell/Cmd, run wsl --shutdown . Then you can log in back to your WSL and run code . and it should work normally.

khushal123 commented 4 months ago

I tried everything, it didnt work. I have to connect wsl manually but code command is unrecognized. this is what .vscode-remote looks like ksc@kschouhan:~/.vscode-server/bin/611f9bfce64f25108829dd295f54a6894e87339d$ ls -l total 94176 -rw-r--r-- 1 ksc ksc 13380 Jun 12 02:32 LICENSE drwxr-xr-x 4 ksc ksc 4096 Jun 12 02:33 bin drwxr-xr-x 34 ksc ksc 4096 Jun 12 02:33 extensions -rwxr-xr-x 1 ksc ksc 96338512 Jun 12 02:33 node drwxr-xr-x 86 ksc ksc 4096 Jun 12 02:33 node_modules drwxr-xr-x 3 ksc ksc 4096 Jun 12 02:33 out -rw-r--r-- 1 ksc ksc 116 Jun 12 02:31 package.json -rw-r--r-- 1 ksc ksc 51157 Jun 12 02:32 product.json

aeschli commented 4 months ago

No bin/remote-cli/code ? Maybe try deleting ~/.vscode-server/bin/ again. There's an issue with extracting, but I haven't been able to hunt it down.

khushal123 commented 4 months ago

I tried that many times. It seems its not issue for everyone, Even I am encountering it for first time. I tried uninstalling vscode and install again , with cache cleared.

vs-code-engineering[bot] commented 21 hours ago

Hey @aeschli, this issue might need further attention.

@kkhan2023, you can help us out by closing this issue if the problem no longer exists, or adding more information.