Failed to patch code.sh Error: ENOENT: no such file or directory AppData\Local\Programs\cursor\resources\app\bin\code

Stack:

  • Cursor Version: I’ve tried 3.19.13 and 3.14.27 (both User setup).
  • WSL: installed via Microsoft Store (Ubuntu 26.04.1 LTS)
  • Windows permission: local user (no admin rights)

I’ve aware of the past post Cursor WSL error: Failed to patch code.sh launcher post but installing the older version (v0.08) of WSL extension will still give error.

Error (v0.08) of WSL extension:

[Info  - 13:08:03.197] Resolving wsl remote authority 'wsl+docker-desktop' (attemp #1)
[Trace  - 13:08:03.199] Installing cursor-server with options: {"id":"63763fa90753302c65da7159","commit":"dd066f332fcea7382764400fde902f61920648d0","line":"production","extensionIds":[],"serverApplicationName":"cursor-server","serverDataFolderName":".cursor-server","cleanInstall":false}
[Trace  - 13:08:03.299] WSL stderr: <3>WSL (378 - Relay) ERROR: CreateProcessCommon:818: execvpe(bash) failed: No such file or directory

[Error  - 13:08:03.379] Server install exited with code 1
[Error  - 13:08:03.379] Error installing Cursor server
Error: Failed parsing install script output
	at te (c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:94644)
	at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
	at async c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:104832
	at async c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:104064
[Info  - 13:08:04.419] Resolving wsl remote authority 'wsl+docker-desktop' (attemp #2)
[Trace  - 13:08:04.419] Installing cursor-server with options: {"id":"e9f32959d8d5760ac97e6faa","commit":"dd066f332fcea7382764400fde902f61920648d0","line":"production","extensionIds":[],"serverApplicationName":"cursor-server","serverDataFolderName":".cursor-server","cleanInstall":false}
[Trace  - 13:08:04.513] WSL stderr: <3>WSL (381 - Relay) ERROR: CreateProcessCommon:818: execvpe(bash) failed: No such file or directory

[Error  - 13:08:04.580] Server install exited with code 1
[Error  - 13:08:04.580] Error installing Cursor server
Error: Failed parsing install script output
	at te (c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:94644)
	at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
	at async c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:104832
	at async c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:104064
[Info  - 13:08:06.585] Resolving wsl remote authority 'wsl+docker-desktop' (attemp #3)
[Trace  - 13:08:06.585] Installing cursor-server with options: {"id":"502ae322a6f16854ae0edddd","commit":"dd066f332fcea7382764400fde902f61920648d0","line":"production","extensionIds":[],"serverApplicationName":"cursor-server","serverDataFolderName":".cursor-server","cleanInstall":false}
[Trace  - 13:08:06.673] WSL stderr: <3>WSL (384 - Relay) ERROR: CreateProcessCommon:818: execvpe(bash) failed: No such file or directory

[Error  - 13:08:06.742] Server install exited with code 1
[Error  - 13:08:06.742] Error installing Cursor server
Error: Failed parsing install script output
	at te (c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:94644)
	at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
	at async c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:104832
	at async c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:104064
[Info  - 13:08:10.749] Resolving wsl remote authority 'wsl+docker-desktop' (attemp #4)
[Trace  - 13:08:10.750] Installing cursor-server with options: {"id":"519ab66308efb64d0c794652","commit":"dd066f332fcea7382764400fde902f61920648d0","line":"production","extensionIds":[],"serverApplicationName":"cursor-server","serverDataFolderName":".cursor-server","cleanInstall":false}
[Trace  - 13:08:10.836] WSL stderr: <3>WSL (387 - Relay) ERROR: CreateProcessCommon:818: execvpe(bash) failed: No such file or directory

[Error  - 13:08:10.905] Server install exited with code 1
[Error  - 13:08:10.905] Error installing Cursor server
Error: Failed parsing install script output
	at te (c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:94644)
	at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
	at async c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:104832
	at async c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:104064
[Info  - 13:08:18.914] Resolving wsl remote authority 'wsl+docker-desktop' (attemp #5)
[Trace  - 13:08:18.914] Installing cursor-server with options: {"id":"cbdfe2a178a0a8c9323a9547","commit":"dd066f332fcea7382764400fde902f61920648d0","line":"production","extensionIds":[],"serverApplicationName":"cursor-server","serverDataFolderName":".cursor-server","cleanInstall":false}
[Trace  - 13:08:19.1] WSL stderr: <3>WSL (390 - Relay) ERROR: CreateProcessCommon:818: execvpe(bash) failed: No such file or directory

[Error  - 13:08:19.81] Server install exited with code 1
[Error  - 13:08:19.81] Error installing Cursor server
Error: Failed parsing install script output
	at te (c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:94644)
	at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
	at async c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:104832
	at async c:\Users\solom\.cursor\extensions\anysphere.remote-wsl-0.0.8\dist\main.js:2:104064

Original Error (WSL 1.0.13):

2026-09-09 20:49:46.220 [error] Failed to patch code.sh launcher: Error: ENOENT: no such file or directory, open 'c:\Users\solom\AppData\Local\Programs\cursor\resources\app\bin\code'
2026-09-09 20:49:56.946 [info] Resolving wsl remote authority 'wsl+docker-desktop' (attempt #1)
2026-09-09 20:49:56.946 [info] Installing cursor-server with options: {"id":"ed0986c97f5b4649aa510dbf","commit":"047548b00c1a079373d74d00183f32510a4a41e0","line":"production","realCommit":"047548b00c1a079373d74d00183f32510a4a41e1","extensionIds":[],"serverApplicationName":"cursor-server","serverDataFolderName":".cursor-server","forceReinstall":false,"killRunningServers":false,"host":"127.0.0.1"}
2026-09-09 20:49:56.946 [error] Failed to patch code.sh launcher: Error: ENOENT: no such file or directory, open 'c:\Users\solom\AppData\Local\Programs\cursor\resources\app\bin\code'
2026-09-09 20:49:56.990 [info] [wsl exec: installServerScript][stderr]: <3>WSL (457) ERROR: CreateProcessEntryCommon:505: execvpe bash failed 2
2026-09-09 20:49:56.990 [info] [wsl exec: installServerScript][stderr]: <3>WSL (457) ERROR: CreateProcessEntryCommon:508: Create process not expected to return
2026-09-09 20:49:57.045 [error] Error installing Cursor server [wsl exec: installServerScript] Command failed with exit code 1: stdout:

Hey @gc_intern, thanks for the detailed logs.

Good news: this is not the code.sh launcher message. That line is harmless and shows up for everyone right now. The real problem is one line further down: Cursor is connecting to wsl+docker-desktop. That is Docker Desktop’s internal WSL distro, not your Ubuntu. It is a minimal image with no bash in it, which is why the server install fails with execvpe(bash) failed: No such file or directory.

This usually happens when docker-desktop is set as your default WSL distro. Here is how to check and fix it (no admin rights needed):

  1. Open PowerShell (a normal window, not as administrator).
  2. Run wsl -l -v. Note the exact name of your Ubuntu distro (for example Ubuntu-26.04 or Ubuntu). The distro marked with * is the current default; I expect it to be docker-desktop.
  3. Run wsl --set-default <your Ubuntu name>, for example wsl --set-default Ubuntu-26.04.
  4. Run wsl -l -v again and confirm the * is now next to Ubuntu.
  5. Fully quit Cursor (right-click the tray icon and quit, or end it in Task Manager), then start it again.
  6. Press Ctrl+Shift+P, type WSL: Connect to WSL, and run it. It should now say WSL: Ubuntu-26.04 (or your distro name) in the bottom-left corner instead of docker-desktop.

If you prefer not to change the default, you can also use WSL: Connect to WSL using Distro... from the same command palette and pick Ubuntu directly.

If it still fails after step 6, please paste the new output from the WSL log (Output panel, select “WSL” in the dropdown)!