cursor icon indicating copy to clipboard operation
cursor copied to clipboard

WSL extension is supported only in Microsoft versions of VS Code

Open lycfight opened this issue 1 year ago β€’ 10 comments

  1. If you can, please include a screenshot of your problem
  2. Please include the name of your operating system
  3. If you can, steps to reproduce are super helpful

I am developing using Windows 11 + WSL: Ubuntu 24.04. After installing Cursor and importing the VSCode extension, the terminal shows the following when entering Cursor:

[2024-09-29 07:18:15.385] Extension version: 0.88.4
[2024-09-29 07:18:15.385] L10N bundle: none
[2024-09-29 07:18:15.388] WSL extension is supported only in Microsoft versions of VS Code

Does Cursor not support WSL?

lycfight avatar Sep 29 '24 07:09 lycfight

Also just got this. Using a WSL folder from my "recents" list I get this: image

markjfisher avatar Sep 30 '24 19:09 markjfisher

I tried going to the extensions, and it showed WSL like this: image

Clicking it reopened cursor, but then I get the error:

[2024-09-30 19:08:01.189] WSL extension activating for a local WSL instance
[2024-09-30 19:08:01.196] Resolving wsl+ubuntu-24.04, resolveAttempt: 1
[2024-09-30 19:08:01.196] NodeExecServer run: C:\Windows\System32\wsl.exe --status
[2024-09-30 19:08:01.234] WSL feature installed: true (wsl --status)
[2024-09-30 19:08:01.235] NodeExecServer run: C:\Windows\System32\wsl.exe --list --verbose
[2024-09-30 19:08:01.270] 3 distros found
[2024-09-30 19:08:01.271] Starting VS Code Server inside WSL (wsl2)
[2024-09-30 19:08:01.271] Windows build: 22631. Multi distro support: available. WSL path support: enabled
[2024-09-30 19:08:01.271] Scriptless setup: false
[2024-09-30 19:08:01.271] No shell environment set or found for current distro.
[2024-09-30 19:08:01.352] WSL daemon log file: 
[2024-09-30 19:08:01.355] Probing if server is already installed: if [ -d ~/.cursor-server/bin/51c8aff7cb5a89f4a0e462fbacab938bdbfaf140 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m
[2024-09-30 19:08:01.355] NodeExecServer run: C:\Windows\System32\wsl.exe -d Ubuntu-24.04 -e sh -c if [ -d ~/.cursor-server/bin/51c8aff7cb5a89f4a0e462fbacab938bdbfaf140 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m
[2024-09-30 19:08:01.437] Probing result: x86_64
[2024-09-30 19:08:01.437] No server install found in WSL, needs linux-x64
[2024-09-30 19:08:01.437] Getting server from client side
[2024-09-30 19:08:01.438] Server available at 
[2024-09-30 19:08:01.439] NodeExecServer run: C:\Windows\System32\wsl.exe -d Ubuntu-24.04 sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 51c8aff7cb5a89f4a0e462fbacab938bdbfaf140 stable cursor-server .cursor-server --host=127.0.0.1 --port=0 --connection-token=2093602930-2684626555-3433266563-2095195016 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2024-09-30 19:08:01.672] Setting up server environment: Looking for /home/fenrock/.cursor-server/server-env-setup. Not found.
[2024-09-30 19:08:01.672] WSL version: 5.15.153.1-microsoft-standard-WSL2 Ubuntu-24.04
[2024-09-30 19:08:01.672] Updating VS Code Server to version 51c8aff7cb5a89f4a0e462fbacab938bdbfaf140
[2024-09-30 19:08:01.672] Removing previous installation...
[2024-09-30 19:08:01.672] Installing VS Code Server for x64 (51c8aff7cb5a89f4a0e462fbacab938bdbfaf140)
[2024-09-30 19:08:01.672] Downloading:     100%
[2024-09-30 19:08:01.672] Failed
[2024-09-30 19:08:01.673] --2024-09-30 20:08:01--  https://update.code.visualstudio.com/commit:51c8aff7cb5a89f4a0e462fbacab938bdbfaf140/server-linux-x64/stable
[2024-09-30 19:08:01.673] Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 13.107.246.64, 2620:1ec:bdf::64
[2024-09-30 19:08:01.673] Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|13.107.246.64|:443... connected.
[2024-09-30 19:08:01.673] HTTP request sent, awaiting response... 404 Not Found
[2024-09-30 19:08:01.673] 2024-09-30 20:08:01 ERROR 404: Not Found.
[2024-09-30 19:08:01.673] 
[2024-09-30 19:08:01.673] ERROR: Failed to download https://update.code.visualstudio.com/commit:51c8aff7cb5a89f4a0e462fbacab938bdbfaf140/server-linux-x64/stable to /home/fenrock/.cursor-server/bin/51c8aff7cb5a89f4a0e462fbacab938bdbfaf140-1727723281.tar.gz
[2024-09-30 19:08:01.673] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips

markjfisher avatar Sep 30 '24 19:09 markjfisher

Ok, I then followed the linked guide from the last line of the log, and what I was missing was the path to windows VS Code on my WSL path, so I added:

export PATH=$PATH:"/mnt/c/Program Files/Microsoft VS Code/bin"

to my bashrc file, restarted cursor, and the server was able to download and install correctly, and the project opened up correctly. So it was a missing path for me.

markjfisher avatar Sep 30 '24 19:09 markjfisher

I have the same problem, but the PATH was not an issue, it was already there, I also added the cursor (windows mounted path) to my zshrc profile but didn't help.

Just to be clear, both programs start fine with code . and cursor . WSL plugin works fine under VSCode but not in Cursor

My Ubuntu version is 22.04, VSCode is 1.93.1 and WSL Plugin is 0.88.4

alvaradojl avatar Oct 02 '24 08:10 alvaradojl

I had the same problem with Ubuntu 22.04 and it was solved closing VS and starting Ubuntu from CMD, then reload cursor and connect to WSL with the cursor extension

FelipeB12 avatar Oct 02 '24 14:10 FelipeB12

I had the same problem with Ubuntu 22.04 and it was solved closing VS and starting Ubuntu from CMD, then reload cursor and connect to WSL with the cursor extension

This sounds promising. Can you please provide a link to the cursor extension?

bnurzhanov avatar Oct 02 '24 14:10 bnurzhanov

@FelipeB12 do you mean the VSCode WSL extension? because I don't see any Cursor-specific extension in the gallery

alvaradojl avatar Oct 03 '24 08:10 alvaradojl

Screenshot_1

Yes, I had it on VSCode, and cursor imported it from VScode, the extension ID is "ms-vscode-remote.remote-wsl"

FelipeB12 avatar Oct 03 '24 12:10 FelipeB12

mmm I see, I think the new WSL extension 0.88.4 is the culprit, don't update your extension or cursor will stop working πŸ˜…

alvaradojl avatar Oct 03 '24 13:10 alvaradojl

Seems like the extension has some code to specifically check for when's it's being used in the usual VSCode environment vs Cursor or any 3rd party VSCode-based editor.

If an older version works, my best suggestion would be to downgrade to the latest working version for now. Not sure if this will get a fix, as if the extension has been coded to block Cursor like this, there's not much Cursor can do to resolve it besides pretend to be VSCode, which probably wouldn't go down very well.

Unfortunately, Microsoft have every right to block their own extensions from working on anything besides their own VSCode releases.

danperks avatar Oct 03 '24 22:10 danperks

Only started getting this issue today. Been using Cursor with WSL2 for the past 2 months with no problem. Now I can't even open my projects anymore. Anyone know any workarounds?

command 'remote-wsl.connect' not found

image

jeggah avatar Oct 14 '24 14:10 jeggah

In my experience, it seems to be latest WSL extension (0.88.4) causing issues as per the above comments. I've downgraded to 0.88.3 and worked without issues. Link to extension.

tuzun89 avatar Oct 15 '24 11:10 tuzun89

In my experience, it seems to be latest WSL extension (0.88.4) causing issues as per the above comments. I've downgraded to 0.88.3 and worked without issues. Link to extension.

Thanks. What seemed to work for me in the end is after manually installing an incompatible version and getting the WSL extension is supported only in Microsoft versions of VS Code error - the Update button on the Extension downgraded it to 0.81.8. This version seems to work fine like before. Of course I unselected Auto Update too.

jeggah avatar Oct 16 '24 01:10 jeggah

image 不错 不错 ζˆεŠŸδΊ†

sujianwei1 avatar Oct 18 '24 03:10 sujianwei1

In my experience, it seems to be latest WSL extension (0.88.4) causing issues as per the above comments. I've downgraded to 0.88.3 and worked without issues. Link to extension.

This worked like a charm, thank you so much !!

techsimplellc avatar Nov 02 '24 19:11 techsimplellc

Unfortunately, Microsoft have every right to block their own extensions from working on anything besides their own VSCode releases.

So I guess the solution is to create your own WSL extension? For me for example this is a must, if Cursor cannot work with WSL I simply cannot use it, as I frequently change machines and WSL is the thing that allows me to have the same work environment on all my machines with ease.

irian-codes avatar Nov 04 '24 23:11 irian-codes

Unfortunately, Microsoft have every right to block their own extensions from working on anything besides their own VSCode releases.

@danperks a key dev workflow is running Cursor to debug apps running in WSL - would be good to see what Cursor's official statement on WSL support is. If WSL is not supported, we can't use Cursor for those workflows.

smflorentino avatar Nov 05 '24 01:11 smflorentino

I encountered the same issue. I managed to temporarily resolve it by enabling the SSH server in WSL and connecting via SSH.

Here are the steps I followed:

  1. Install the OpenSSH server in WSL:

    sudo apt install openssh-server
    
  2. Edit the SSH configuration file:

    sudo nano /etc/ssh/sshd_config
    
  3. Modify the following settings:

    Port 22
    PermitRootLogin yes
    PasswordAuthentication yes
    
  4. Restart the SSH service and enable it to start on boot:

    sudo service ssh --full-restart
    sudo systemctl enable ssh
    
  5. In the Windows terminal (run as administrator), execute the following command:

    netsh interface portproxy add v4tov4 listenaddress=<your-WSL-address> listenport=22 connectaddress=127.0.0.1 connectport=22
    

After these steps, I was able to connect to WSL via SSH.


kanhao100 avatar Nov 06 '24 03:11 kanhao100

In my experience, it seems to be latest WSL extension (0.88.4) causing issues as per the above comments. I've downgraded to 0.88.3 and worked without issues. Link to extension.

To expand on this; this is how I used this comment to get the Extension to downgrade, and cursor to work in WSL (Ubuntu)

  • Install cursor
  • Restart your computer for good measure (Windows & WSL loves a restart)
  • Download the v0.88.3 extension mentioned in comment above
  • Open "terminal" (in windows, not in WSL)
  • code --uninstall-extension ms-vscode-remote.remote-wsl
  • code --install-extension .\ms-vscode-remote.remote-wsl-0.88.3.vsix
  • Make sure to go deselect "Auto Upgrade" in "Install Extensions" so it doesn't upgrade again ...
  • Win!

For now... this works...

c4talyst avatar Nov 08 '24 07:11 c4talyst

This is exactly how I did it too @c4talyst - worked great

emzo avatar Nov 08 '24 08:11 emzo

Where are cursor extensions installed? I have done the above to install 0.88.3, I can see it in VS Code as that version, but in Cursor it's showing 0.81.8: image

markjfisher avatar Nov 08 '24 11:11 markjfisher

@markjfisher You can remove the extension manually from cursor by deleting "C:\Users<username>.cursor\extensions\ms-vscode-remote.remote-wsl-0.81.8" or whatever version you're trying to remove.

On Fri, 8 Nov 2024, 11:30β€―am Mark Fisher, @.***> wrote:

Where are cursor extensions installed? I have done the above to install 0.88.3, I can see it in VS Code as that version, but in Cursor it's showing 0.81.8: image.png (view on web) https://github.com/user-attachments/assets/71408a5e-2e9c-457f-b460-dea6dd33df84

β€” Reply to this email directly, view it on GitHub https://github.com/getcursor/cursor/issues/2027#issuecomment-2464477384, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEKJYKF3JGIEEVHAAREJTZ7SOFZAVCNFSM6AAAAABPBLQCFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRUGQ3TOMZYGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

emzo avatar Nov 08 '24 13:11 emzo

I did that (removing .cursor\extensions\ms-vscode-remote.remote-wsl-0.81.8 folder), and copied the 0.88.3 version from .vscode\extensions into .cursor\extensions, but Cursor isn't recognising it as installed, and in marketplace only shows 0.81.8 as installable from within cursor (via marketplace).

I'm confused over the mix between vscode here (where the instructions were to use code --install-extension) and cursor. How would cursor be picking up vscode extensions using the command line for vscode (i.e. code) which installs extensions into .vscode\extensions and not .cursor\extensions?

I'm running cursor not vscode for my editing.

markjfisher avatar Nov 08 '24 14:11 markjfisher

@markjfisher You need to just remove the WSL extension from Cursor on Windows. It's nothing to do with your VS Code install at all. Once that's done you need to install the old version of WSL extension (as per my previous post) on Windows only. I did it all through the Cursor GUI and not touched the terminal at all.

tuzun89 avatar Nov 08 '24 17:11 tuzun89

This works for me (Windows, cursor latest):

curl "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-vscode-remote/vsextensions/remote-wsl/0.88.3/vspackage" --compressed -o ms-vscode-remote.remote-wsl-0.88.3.vsix
cursor --uninstall-extension ms-vscode-remote.remote-wsl
cursor --install-extension .\ms-vscode-remote.remote-wsl-0.88.3.vsix

If this not works, manually remove wsl extension and run command again.

mirusu400 avatar Nov 10 '24 20:11 mirusu400

@markjfisher You need to just remove the WSL extension from Cursor on Windows. It's nothing to do with your VS Code install at all. Once that's done you need to install the old version of WSL extension (as per my previous post) on Windows only. I did it all through the Cursor GUI and not touched the terminal at all.

Thanks, but as I posted, I cannot see anything in the Cursor UI other than 0.81.8, you mentioned 0.88.3 and I cannot install that from Cursor. I even posted a picture of the extensions page I see showing 0.81.8, even in the "choose version" drop down. There is no 0.88.3, so I'm asking how people have installed that.

Other posters have said use "code --install-extension" which is vs-code. I was asking how that could help. They say it fixed it for them, I couldn't see how.

I've tried also using cursor --install-extensions ... as per @mirusu400 comment, but running cursor on the command line just fires up Cursor, it doesn't do any installations.

Non of the instructions or versions are working or available to me.

markjfisher avatar Nov 11 '24 22:11 markjfisher

The only version in Cursor for me to install is 0.81.8, here is the screenshot from the "Install Specific Version..." option image

markjfisher avatar Nov 11 '24 22:11 markjfisher

@markjfisher Can you retry my command in this cwd (or cursor installed dir)?

C:\Users\%username%\AppData\Local\Programs\cursor

mirusu400 avatar Nov 11 '24 22:11 mirusu400

@markjfisher Can you retry my command in this cwd (or cursor installed dir)?

C:\Users\%username%\AppData\Local\Programs\cursor

That's the directory I tried it from. All that happens is cursor starts up showing editor. No extensions are added

PS C:\Users\markj\AppData\Local\Programs\cursor> .\Cursor.exe --install-extension D:\markj\Downloads\ms-vscode-remote.remote-wsl-0.88.3.vsix
PS C:\Users\markj\AppData\Local\Programs\cursor>
WARNING: Logging before InitGoogleLogging() is written to STDERR
I1111 22:17:18.039614 361572 dllmain.cpp:45] Logging disabled. (This shouldn't log.)
I1111 22:17:18.040117 361572 mmwrapper.cpp:113] Initializing SarMMDeviceEnumerator.
I1111 22:17:18.042122 361572 mmwrapper.cpp:126] Initialized SarMMDeviceEnumerator.
[main 2024-11-11T22:17:18.203Z] update#setState disabled
[main 2024-11-11T22:17:18.204Z] update#ctor - updates are disabled as there is no update URL
[main 2024-11-11T22:17:50.779Z] Extension host with pid 368088 exited with code: 0, signal: unknown.

I'm running this version:

Version: 0.42.4
VSCode Version: 1.93.1
Commit: b1e87884330fc271d5eb589e368c35f14e76dec0
Date: 2024-10-29T17:17:29.347Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

markjfisher avatar Nov 11 '24 22:11 markjfisher

I followed this guide for installing an extension in cursor by simply dragging it into cursor's Extensions windows, and it installed version 0.88.3 from the file, and is working πŸŽ‰

markjfisher avatar Nov 13 '24 13:11 markjfisher