Update broke ability to connect to wsl

Where does the bug appear (feature/product)?

Somewhere else…

Describe the Bug

When starting to connect to wsl using wsl plugin, I get following error.
It started with an update, without changing any settings or plugins.
Its announcing “Setting up WSL Distro: Ubuntu-24.4 and then hangs in there a bit and throws and error. Seems the problem is in installing cursor-server. When doeing clean install on my coworkers computer, it works, but even if I uninstall cursor and remove left over folders, the problem persists when reinstalling.
2025-09-05 08:41:37.028 [error] Failed to patch code.sh launcher: Error: ENOENT: no such file or directory, open ‘c:\Users\diana\AppData\Local\Programs\cursor\resources\app\bin\code’
2025-09-05 08:41:55.939 [info] Resolving wsl remote authority ‘wsl+Ubuntu-24.04’ (attempt #1)
2025-09-05 08:41:55.939 [info] Installing cursor-server with options: {“id”:“c8e5e63794d3d661c5fa91f9”,“commit”:“de327274300c6f38ec9f4240d11e82c3b0660b20”,“line”:“production”,“realCommit”:“de327274300c6f38ec9f4240d11e82c3b0660b29”,“extensionIds”:,“serverApplicationName”:“cursor-server”,“serverDataFolderName”:”.cursor-server",“forceReinstall”:true,“killRunningServers”:false}
2025-09-05 08:41:55.940 [error] Failed to patch code.sh launcher: Error: ENOENT: no such file or directory, open ‘c:\Users\diana\AppData\Local\Programs\cursor\resources\app\bin\code’
2025-09-05 08:41:59.019 [info] [wsl exec: installServerScript][stderr]: your 131072x1 screen size is bogus. expect trouble
2025-09-05 08:42:49.274 [info] [wsl exec: installServerScript][stderr]: 2025-09-05 08:42:49 URL:https://downloads.cursor.com/production/de327274300c6f38ec9f4240d11e82c3b0660b29/linux/x64/cursor-reh-linux-x64.tar.gz [65639063/65639063] → “/tmp/tmp.nKpJu24Chw” [1]
2025-09-05 08:42:51.128 [info] [wsl exec: installServerScript][stderr]: your 131072x1 screen size is bogus. expect trouble
2025-09-05 08:42:54.654 [error] Failed to connect to Cursor server from Windows, attempt 3 of 3 fetch failed
2025-09-05 08:42:54.654 [error] Error installing Cursor server Failed to connect to Cursor server from Windows. Please try rebooting WSL by running “wsl -d Ubuntu-24.04 --shutdown” and then reconnect.
2025-09-05 08:43:21.274 [error] Failed to patch code.sh launcher: Error: ENOENT: no such file or directory, open ‘c:\Users\diana\AppData\Local\Programs\cursor\resources\app\bin\code’
2025-09-05 08:43:27.275 [info] Resolving wsl remote authority ‘wsl+Ubuntu-22.04’ (attempt #1)
2025-09-05 08:43:27.275 [info] Installing cursor-server with options: {“id”:“65189f09ee33a1ffd09a3ff3”,“commit”:“de327274300c6f38ec9f4240d11e82c3b0660b20”,“line”:“production”,“realCommit”:“de327274300c6f38ec9f4240d11e82c3b0660b29”,“extensionIds”:,“serverApplicationName”:“cursor-server”,“serverDataFolderName”:“.cursor-server”,“forceReinstall”:false,“killRunningServers”:false}
2025-09-05 08:43:27.275 [error] Failed to patch code.sh launcher: Error: ENOENT: no such file or directory, open ‘c:\Users\diana\AppData\Local\Programs\cursor\resources\app\bin\code’
2025-09-05 08:43:31.974 [info] [wsl exec: installServerScript][stderr]: your 131072x1 screen size is bogus. expect trouble
2025-09-05 08:43:35.483 [error] Failed to connect to Cursor server from Windows, attempt 3 of 3 fetch failed
2025-09-05 08:43:35.484 [error] Error installing Cursor server Failed to connect to Cursor server from Windows. Please try rebooting WSL by running “wsl -d Ubuntu-22.04 --shutdown” and then reconnect.
2025-09-05 08:50:08.918 [info] Resolving wsl remote authority ‘wsl+Ubuntu-24.04’ (attempt #1)
2025-09-05 08:50:08.918 [info] Installing cursor-server with options: {“id”:“9954340d36f63fd4d3c1b772”,“commit”:“de327274300c6f38ec9f4240d11e82c3b0660b20”,“line”:“production”,“realCommit”:“de327274300c6f38ec9f4240d11e82c3b0660b29”,“extensionIds”:,“serverApplicationName”:“cursor-server”,“serverDataFolderName”:“.cursor-server”,“forceReinstall”:true,“killRunningServers”:false}
2025-09-05 08:50:08.919 [error] Failed to patch code.sh launcher: Error: ENOENT: no such file or directory, open ‘c:\Users\diana\AppData\Local\Programs\cursor\resources\app\bin\code’
2025-09-05 08:50:09.187 [info] [wsl exec: installServerScript][stderr]: your 131072x1 screen size is bogus. expect trouble
2025-09-05 08:51:00.431 [info] [wsl exec: installServerScript][stderr]: 2025-09-05 08:51:00 URL:https://downloads.cursor.com/production/de327274300c6f38ec9f4240d11e82c3b0660b29/linux/x64/cursor-reh-linux-x64.tar.gz [65639063/65639063] → “/tmp/tmp.HJcujeurhB” [1]
2025-09-05 08:51:02.404 [info] [wsl exec: installServerScript][stderr]: your 131072x1 screen size is bogus. expect trouble
2025-09-05 08:51:05.905 [error] Failed to connect to Cursor server from Windows, attempt 3 of 3 fetch failed
2025-09-05 08:51:05.906 [error] Error installing Cursor server Failed to connect to Cursor server from Windows. Please try rebooting WSL by running “wsl -d Ubuntu-24.04 --shutdown” and then reconnect.

Steps to Reproduce

Add WSL plugin. connect to a linux distro on wsl, using wsl plugin.

Expected Behavior

It should be able to connect to the wsl.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.5.9 (user setup)
VSCode Version: 1.99.3
Commit: de327274300c6f38ec9f4240d11e82c3b0660b20
Date: 2025-08-30T21:02:27.236Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.22631

Does this stop you from using Cursor

Yes - Cursor is unusable

I’ve the exact same thing. I tried everything. I uninstalled and reinstalled the previous Cursor version 1.4.2. I uninstalled wsl and reinstall it. I also tried the previous WSL extension from Anysphere 1.08 and 1.09. Nothing works

I have the same problem

add:
The issue was resolved by additionally installing the Ubuntu 24.04.1 LTS environment.

Hi, can you share details? I had Ubuntu24.04 and I also tried another distro Ubuntu 22.04 but it had the same error.

Version: 1.5.11 (user setup)
Commit: 1.99.3
Date: 2f2737de9aa376933d975ae30290447c910fdf40
Electron: 2025-09-05T03:48:32.332Z
ElectronBuildId: 34.5.8
Chromium: undefined
Node.js: 132.0.6834.210
V8: 20.19.1
OS: 13.2.152.41-electron.0

after installing Ubuntu 24.04.1 LTS in Cursor execute CTRL+SHIFT+P and enter WSL: Connect to WSL using Distro…

in the window select Ubuntu-24.04.

after which Cursor successfully connected

Unfortunately it did not work for me.

After installing Ubuntu, did you launch it to go through the initial user initialization script?

Yes, I did. 24.04 was the one I initially was able to work with, until the bug appeared, then I tried with 22.04, which I initialized to check if the problem was about the distro, but it was not. I planned the wsl setup with cursor for the whole team, but clearly if one update can destroy it all, this is not an option.

Hello,
After spending my weekend debug the ■■■■■ out of this. I finally found a way to fix this.

The reason:
In a perfect world wsl will be able forward it’s 127.0.0.1 interface from linux guest to the localhost interface on windows host. In this case it cannot. From where I searched, this error happened on and off for many people for like … 6 centuries and MS has failed to fix it.

The fix:
There’s 2 script you need to run.

First, the cursor-server run on wsl with this option
cursor-server --start-server --host=127.0.0.1. We need it to run with –host=0.0.0.0 so it listen on all interfaces.
For this. You can do it manually or I wrote a script to patch the main.js of the anysphere wsl extension which exits at

C:\Users\your_username\.cursor\extensions\anysphere.remote-wsl-1.0.11\dist\main.js

you only need to run this script once, or if you update the extension run it again. All it does is search for the phrase –host=127.0.0.1 and replace it with –host=0.0.0.0

this script receive the path to main.js file of the extension. You run it like this:

patch_wsl_ext.ps1 C:\Users\your_username\.cursor\extensions\anysphere.remote-wsl-1.0.11\dist\main.js

patch_wsl_ext.ps1

Second script is to forward the cursor-server listening port from wsl to host computer.
When cursor-server run it save the listening port to its log file at
$HOME/.cursor-server/.9455eaa4c87f2bad91eda3f2bc9b42b16eae1080.log

this script read that file and run the command to forward the port from wsl → host nat ip to localhost on your windows computer. This is the command if you wonder.

netsh interface portproxy add v4tov4 listenport=$port listenaddress=127.0.0.1 connectport=$port connectaddress=$wslIp"

Forward-CursorServer.ps1

2 Likes

Thanks a lot, this worked for me. I adjusted the cursor server host. Did not even run the second script, as I had deleted the .cursor-server folder earlier. Had issues at first, but after wsl shutdown and new start, I was able to connect to wsl again :slight_smile:

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.