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

WSL2 - Code.exe: Exec format error #189694

Closed
shinebayar-g opened this issue Aug 5, 2023 · 3 comments
Closed

WSL2 - Code.exe: Exec format error #189694

shinebayar-g opened this issue Aug 5, 2023 · 3 comments
Assignees

Comments

@shinebayar-g
Copy link

shinebayar-g commented Aug 5, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version:
Version: 1.81.0 (user setup)
Commit: 6445d93c81ebe42c4cbd7a60712e0b17d9463e97
Date: 2023-08-02T12:37:13.485Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621
  • OS Version:
> wsl --version
WSL version: 1.2.5.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.2070

Not sure if recent update broke it. But I'm getting the following error all of a sudden when I run code . AFAIK It was working fine before upgrading the VSCode today.

Steps to Reproduce:

  1. Open WSL2 shell
  2. Run code .
❯ code .
/mnt/c/Users/me/AppData/Local/Programs/Microsoft VS Code/bin/code: 61: /mnt/c/Users/me/AppData/Local/Programs/Microsoft VS Code/Code.exe: Exec format error

Not sure why code command is trying to run Code.exe.

  • Removed ~/.vscode-server in WSL2, close vscode, shutdown WSL2 and restart everything. Didn't work.
  • Did Clean Install. Didn't work.

Opening VSCode through Windows' desktop shortcut is working and able to connect to WSL2 through the Remote Explorer menu.

Edit: Looks like it's also reported in microsoft/WSL#10363
Edit2: Looks like it's something related to systemd?

It works with systemd disabled.

I had systemd enabled.

❯ cat /etc/wsl.conf
[boot]
systemd=true
@marcelo-r
Copy link

marcelo-r commented Aug 9, 2023

I'm also having the same problem when trying to use code to open a directory from inside WSL.

WSL version:

WSL version: 1.2.5.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.3208

VS Code version

Version: 1.81.0 (system setup)
Commit: 6445d93c81ebe42c4cbd7a60712e0b17d9463e97
Date: 2023-08-02T12:37:13.485Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19045
$ code .
/mnt/c/Program Files/Microsoft VS Code/bin/code: 61: /mnt/c/Program Files/Microsoft VS Code/Code.exe: Exec format error

@pierzchalski
Copy link

If you're using systemd you can try the solution from here - it fixed this exact issue for me.

@aeschli
Copy link
Contributor

aeschli commented Aug 16, 2023

This is a WSL issue (microsoft/WSL#8952), nothing we can fix in VS Code.

@aeschli aeschli closed this as completed Aug 16, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 30, 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

4 participants