Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kkhan2023 opened this issue May 1, 2024 · 2 comments
Open

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

kkhan2023 opened this issue May 1, 2024 · 2 comments
Assignees
Labels
info-needed Issue requires more information from poster wsl Issue in vscode-remote WSL

Comments

@kkhan2023
Copy link

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?

  • COMMIT=e170252f762678dec6ca2cc69aba1570769a5d39
  • APP_NAME=code
  • QUALITY=stable
  • NAME=Code
  • SERVERDATAFOLDER=.vscode-server
  • realpath /mnt/c/Users/kasam/AppData/Local/Programs/Microsoft VS Code/bin/code
  • dirname /mnt/c/Users/kasam/AppData/Local/Programs/Microsoft VS Code/bin/code
  • dirname /mnt/c/Users/kasam/AppData/Local/Programs/Microsoft VS Code/bin
  • VSCODE_PATH=/mnt/c/Users/kasam/AppData/Local/Programs/Microsoft VS Code
  • ELECTRON=/mnt/c/Users/kasam/AppData/Local/Programs/Microsoft VS Code/Code.exe
  • IN_WSL=false
  • [ -n Ubuntu ]
  • IN_WSL=true
  • [ true = true ]
  • export WSLENV=ELECTRON_RUN_AS_NODE/w:
  • wslpath -m /mnt/c/Users/kasam/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js
  • CLI=C:/Users/kasam/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js
  • WSL_EXT_ID=ms-vscode-remote.remote-wsl
  • ELECTRON_RUN_AS_NODE=1 /mnt/c/Users/kasam/AppData/Local/Programs/Microsoft VS Code/Code.exe C:/Users/kasam/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js --locate-extension ms-vscode-remote.remote-wsl
  • cat /tmp/remote-wsl-loc.txt
  • WSL_EXT_WLOC=c:\Users\kasam.vscode\extensions\ms-vscode-remote.remote-wsl-0.88.0
  • [ -n c:\Users\kasam.vscode\extensions\ms-vscode-remote.remote-wsl-0.88.0 ]
  • wslpath -u c:\Users\kasam.vscode\extensions\ms-vscode-remote.remote-wsl-0.88.0
  • WSL_CODE=/mnt/c/Users/kasam/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.0/scripts/wslCode.sh
  • /mnt/c/Users/kasam/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.0/scripts/wslCode.sh e170252f762678dec6ca2cc69aba1570769a5d39 stable /mnt/c/Users/kasam/AppData/Local/Programs/Microsoft VS Code/Code.exe code .vscode-server .
  • [ -z .vscode-server ]
  • [ .vscode-server = .vscode-insiders ]
  • [ ! -t 0 ]
  • VSCODE_REMOTE_BIN=/home/kasam/.vscode-server/bin
  • AUTHORITY=wsl+default
  • [ Ubuntu ]
  • AUTHORITY=wsl+Ubuntu
  • dirname /mnt/c/Users/kasam/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.0/scripts/wslCode.sh
  • /mnt/c/Users/kasam/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.0/scripts/wslDownload.sh e170252f762678dec6ca2cc69aba1570769a5d39 stable /home/kasam/.vscode-server/bin
  • [ ! -d /home/kasam/.vscode-server/bin/e170252f762678dec6ca2cc69aba1570769a5d39 ]
  • RC=0
  • [ 0 -eq 100 ]
  • [ 0 -ne 0 ]
  • mktemp /tmp/vscode-distro-env.XXXXXX
  • STORED_ENV=/tmp/vscode-distro-env.1lGfYA
  • env
  • dirname /mnt/c/Users/kasam/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.0/scripts/wslCode.sh
  • VSCODE_CLIENT_COMMAND=/mnt/c/Users/kasam/AppData/Local/Programs/Microsoft VS Code/Code.exe VSCODE_CLIENT_COMMAND_CWD=/mnt/c/Users/kasam/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.0/scripts VSCODE_CLI_AUTHORITY=wsl+Ubuntu VSCODE_CLI_REMOTE_ENV=/tmp/vscode-distro-env.1lGfYA VSCODE_STDIN_FILE_PATH= WSLENV=VSCODE_CLI_REMOTE_ENV/w:ELECTRON_RUN_AS_NODE/w: /home/kasam/.vscode-server/bin/e170252f762678dec6ca2cc69aba1570769a5d39/bin/remote-cli/code .
    /mnt/c/Users/kasam/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.0/scripts/wslCode.sh: 68: /home/kasam/.vscode-server/bin/e170252f762678dec6ca2cc69aba1570769a5d39/bin/remote-cli/code: not found
  • exit 127
@VSCodeTriageBot VSCodeTriageBot added the wsl Issue in vscode-remote WSL label May 2, 2024
@aeschli
Copy link
Contributor

aeschli commented May 2, 2024

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

Maybe it got corrupted?

  • close all VS Code windows
  • in a WSL terminal, run rm -r ~/.vscode-server/bin
  • start VS Code again and open a WSL window

@aeschli aeschli added the info-needed Issue requires more information from poster label May 2, 2024
@kkhan2023
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster wsl Issue in vscode-remote WSL
Projects
None yet
Development

No branches or pull requests

3 participants