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

VS Code Exec format error in Terminal but can open remote window from within VS Code integrated terminal #8790

Closed
clmnin opened this issue Aug 3, 2023 · 3 comments

Comments

@clmnin
Copy link

clmnin commented Aug 3, 2023

  • VSCode Version: 1.80.2 - 2ccd690cbff1569e4a83d7c43d45101f817401dc - x64
  • Local OS Version: Windows 11
  • Remote OS Version: Ubuntu 22.04.2 LTS
  • Remote Extension/Connection Type: WSL

When I try running code from the Terminal I get an error

code --version
/mnt/c/Users/username/AppData/Local/Programs/Microsoft VS Code/bin/code: 61: /mnt/c/Users/username/AppData/Local/Programs/Microsoft VS Code/Code.exe: Exec format error

But if I open a remote connection from within VS Code, following the below steps

  1. Open new window Ctrl + Shift + N
  2. Open a WSL / Ubuntu / remote folder Ctrl + K Ctrl + O
  3. Open the integrated terminal Ctrl + `
  4. Get version of code
    code --version
    1.80.2
    2ccd690cbff1569e4a83d7c43d45101f817401dc
    x64
    

The location of code in the terminal and in the VS Code integrated terminal are different

  1. This is from the terminal
which code
/mnt/c/Users/username/AppData/Local/Programs/Microsoft VS Code/bin/code
  1. This is from the VS Code integrated terminal
which code
/home/username/.vscode-server/bin/2ccd690cbff1569e4a83d7c43d45101f817401dc/bin/remote-cli/code
@rcdeo
Copy link

rcdeo commented Aug 3, 2023

I have the same problem.

  1. This is from the terminal code --version or code .
/mnt/c/Program Files/Microsoft VS Code/bin/code: 61: /mnt/c/Program Files/Microsoft VS Code/Code.exe: Exec format error
  1. This is from the terminal which -a code
/mnt/c/Program Files/Microsoft VS Code/bin/code
  1. This is from the VS Code integrated terminal code --version
1.81.0 6445d93c81ebe42c4cbd7a60712e0b17d9463e97 x64
  1. This is from the VS Code integrated terminal which -a code
/home/USERNAME/.vscode-server/bin/6445d93c81ebe42c4cbd7a60712e0b17d9463e97/bin/remote-cli/code
/mnt/c/Program Files/Microsoft VS Code/bin/code

@chinsoon12
Copy link

Following this
microsoft/WSL#8952 (comment)

resolved the below for me
/mnt/c/Program Files/Microsoft VS Code/bin/code: 61: /mnt/c/Program Files/Microsoft VS Code/Code.exe: Exec format error

@clmnin
Copy link
Author

clmnin commented Aug 7, 2023

@chinsoon12 solution worked for me. Will be closing this issue

@clmnin clmnin closed this as completed Aug 7, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants