Skip to content

WSL:Connect to WSL fails (can not download) #660

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

Open
sisrfeng opened this issue Jun 24, 2023 · 99 comments
Open

WSL:Connect to WSL fails (can not download) #660

sisrfeng opened this issue Jun 24, 2023 · 99 comments
Labels
bug Something isn't working

Comments

@sisrfeng
Copy link

command

image

error

image

In wsl, this command fails:
wget 'https://update.code.visualstudio.com/commit:e3abfc3de36742f113a8f1f4648d8c7044ec2f31/server-linux-x64/stable'

OS

win11, wsl
image

cat /etc/issue :
Ubuntu 22.04.2 LTS \n \l

@truell20
Copy link
Contributor

truell20 commented Jun 28, 2023

Thanks for reporting this! We're looking into the issue.

EDIT: To fix this, do the following:

  1. Ctrl + Shift + P to open the Command Palette
  2. Select "Fix WSL Install" and hit enter

Now, if you install the WSL extension and run Ctrl + Shift + P then the "Connect to WSL" command, you should be able to open a WSL folder in Cursor.

@benherve
Copy link

benherve commented Jul 2, 2023

same problem

but,
dowload: https://github.com/VSCodium/vscodium/releases/download/1.79.2.23166/vscodium-reh-linux-x64-1.79.2.23166.tar.gz
cd /home/wf/.vscodium-server/bin
mkdir e3abfc3de36742f113a8f1f4648d8c7044ec2f31
tar xvfz vscodium-reh-linux-x64-1.79.2.23166.tar.gz .

then try

@sisrfeng
Copy link
Author

sisrfeng commented Jul 2, 2023

same problem

but, dowload: https://github.com/VSCodium/vscodium/releases/download/1.79.2.23166/vscodium-reh-linux-x64-1.79.2.23166.tar.gz cd /home/wf/.vscodium-server/bin mkdir e3abfc3de36742f113a8f1f4648d8c7044ec2f31 tar xvfz vscodium-reh-linux-x64-1.79.2.23166.tar.gz .

then try

I use ubuntu, so should I use VSCodium-linux-x64-1.79.2.23166.tar.gz ?

what is e3abfc3de36742f113a8f1f4648d8c7044ec2f31 ?

@benherve
Copy link

benherve commented Jul 2, 2023

e3abfc3de36742f113a8f1f4648d8c7044ec2f31 is the commit that your install is searching. (look you log)
try first create dir e3abfc3de36742f113a8f1f4648d8c7044ec2f31 ,
then, restart cursor, you will have a new error.
it will find a binary. (me it looking for codium-server)
codium-server is present in the release that i have downloaded.

in your release VSCodium-linux-x64-1.79.2.23166.tar.gz.
in bin folder you have only codium binary

@danperks danperks added the bug Something isn't working label Jul 3, 2023
@benherve
Copy link

benherve commented Jul 7, 2023

the problem is that with every cursor update it tries to download a new version of vscodium based on the cursor commit.
currently the manual solution is to create a directory with the name of the new commit cursor and drop the vscodium install in it.

@sisrfeng
Copy link
Author

To create a directory with the name of the new commit cursor and drop the vscodium install in it.

Is there any script to make this easier?

@benherve
Copy link

To create a directory with the name of the new commit cursor and drop the vscodium install in it.

Is there any script to make this easier?

It’s already easy manually.
juste create a dir and extract an archive. 🤷🏼‍♂️

@learno
Copy link

learno commented Jul 11, 2023

VSCodium/vscodium#1265 (comment)
Here is a solution for VSCodium, I have modified the script to also work with Cursor.
Add the following lines to ~/.vscodium-server/server-env-setup:

# uncomment the following line to enable debugging
#export VSCODE_WSL_DEBUG_INFO=true

fix_download() {
    case "$QUALITY" in
        stable)
            local repo_name='vscodium'
            local app_name='codium';;
        insider)
            local repo_name='vscodium-insiders'
            local app_name='codium-insiders';;
        *)
            echo "unknown quality: $QUALITY" 1>&2
            return 1;;
    esac
    local ps='/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'
    local cmd="(Get-Command $app_name).Path | Split-Path | Split-Path"
    local install_dir=$(wslpath -u "$($ps -nop -c "$cmd | Write-Host -NoNewLine")")
    local product_json="$install_dir/resources/app/product.json"
    local release=$(jq -r .release "$product_json")
    local version=$(jq -r .vscodeVersion "$product_json" | sed "s#\(-$QUALITY\)\?\$#.$release&#")
    case $version in null.*)
        version=$(jq -r .version "$product_json" | sed "s#\(-$QUALITY\)\?\$#.$release&#");;
    esac
    local arch=$(uname -m)
    case $arch in
        x86_64)
            local platform='x64';;
        armv7l | armv8l)
            local platform='armhf';;
        arm64 | aarch64)
            local platform='arm64';;
        *)
            echo "unknown machine: $arch" 1>&2
            return 1;;
    esac
    local url="https://github.com/VSCodium/$repo_name/releases/download/$version/vscodium-reh-linux-$platform-$version.tar.gz"
    export VSCODE_SERVER_TAR=$(curl -fLOJ "$url" --output-dir /tmp -w '/tmp/%{filename_effective}')
    export REMOVE_SERVER_TAR_FILE=true
}
[ "$VSCODE_WSL_DEBUG_INFO" = true ] && set -x
if [ ! -d "$HOME/$DATAFOLDER/bin/$COMMIT" ]; then
    if [ ! -d "$HOME/$DATAFOLDER/bin_commit" ]; then
        set -e
        fix_download
        set +e
    fi
fi
unset fix_download

@benherve
Copy link

benherve commented Jul 11, 2023

server-env-setup

if we don't have this file, we can create it and only past your code ? or we need the default file before? (and where to get it?)

Edit: try with only your code, seems good, thx man

@sisrfeng
Copy link
Author

VSCodium/vscodium#1265 (comment) Here is a solution for VSCodium, I have modified the script to also work with Cursor. Add the following lines to ~/.vscodium-server/server-env-setup:

# uncomment the following line to enable debugging
#export VSCODE_WSL_DEBUG_INFO=true

fix_download() {
    case "$QUALITY" in
        stable)
            local repo_name='vscodium'
            local app_name='codium';;
        insider)
            local repo_name='vscodium-insiders'
            local app_name='codium-insiders';;
        *)
            echo "unknown quality: $QUALITY" 1>&2
            return 1;;
    esac
    local ps='/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'
    local cmd="(Get-Command $app_name).Path | Split-Path | Split-Path"
    local install_dir=$(wslpath -u "$($ps -nop -c "$cmd | Write-Host -NoNewLine")")
    local product_json="$install_dir/resources/app/product.json"
    local release=$(jq -r .release "$product_json")
    local version=$(jq -r .vscodeVersion "$product_json" | sed "s#\(-$QUALITY\)\?\$#.$release&#")
    case $version in null.*)
        version=$(jq -r .version "$product_json" | sed "s#\(-$QUALITY\)\?\$#.$release&#");;
    esac
    local arch=$(uname -m)
    case $arch in
        x86_64)
            local platform='x64';;
        armv7l | armv8l)
            local platform='armhf';;
        arm64 | aarch64)
            local platform='arm64';;
        *)
            echo "unknown machine: $arch" 1>&2
            return 1;;
    esac
    local url="https://github.com/VSCodium/$repo_name/releases/download/$version/vscodium-reh-linux-$platform-$version.tar.gz"
    export VSCODE_SERVER_TAR=$(curl -fLOJ "$url" --output-dir /tmp -w '/tmp/%{filename_effective}')
    export REMOVE_SERVER_TAR_FILE=true
}
[ "$VSCODE_WSL_DEBUG_INFO" = true ] && set -x
if [ ! -d "$HOME/$DATAFOLDER/bin/$COMMIT" ]; then
    if [ ! -d "$HOME/$DATAFOLDER/bin_commit" ]; then
        set -e
        fix_download
        set +e
    fi
fi
unset fix_download

Thx!

The diff is :

image

@benherve
Copy link

benherve commented Jul 19, 2023

@sisrfeng do you have a fix_download script update ?

WSL don't work with new version of cursor:

[2023-07-19 12:36:35.692] Setting up server environment: Looking for /home/ben/.vscodium-server/server-env-setup. Found, executing...
[2023-07-19 12:36:41.483] Get-Command : Le terme �codium� n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou
[2023-07-19 12:36:41.483] programme ex�cutable. V�rifiez l'orthographe du nom, ou si un chemin d'acc�s existe, v�rifiez que le chemin d'acc�s
[2023-07-19 12:36:41.483] est correct et r�essayez.
[2023-07-19 12:36:41.483] Au caract�re Ligne:1 : 2
[2023-07-19 12:36:41.483] + (Get-Command codium).Path | Split-Path | Split-Path | Write-Host -NoN ...
[2023-07-19 12:36:41.483] + ~~~~~~~~~~~~~~~~~~
[2023-07-19 12:36:41.483] + CategoryInfo : ObjectNotFound: (codium:String) [Get-Command], CommandNotFoundException
[2023-07-19 12:36:41.483] + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand
[2023-07-19 12:36:41.483]
[2023-07-19 12:36:41.483] Split-Path : Impossible de lier l'argument au param�tre ��Path��, car il a la valeur Null.
[2023-07-19 12:36:41.483] Au caract�re Ligne:1 : 29
[2023-07-19 12:36:41.483] + (Get-Command codium).Path | Split-Path | Split-Path | Write-Host -NoN ...
[2023-07-19 12:36:41.483] + ~~~~~~~~~~
[2023-07-19 12:36:41.483] + CategoryInfo : InvalidData : (:) [Split-Path], ParameterBindingValidationException
[2023-07-19 12:36:41.483] + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SplitPathCo
[2023-07-19 12:36:41.483] mmand

[2023-07-19 12:36:42.481] --2023-07-19 14:36:42-- https://update.code.visualstudio.com/commit:2d7a33f66a5157c6378a1621ddb89d4130ab3659/server-linux-x64/stable
[2023-07-19 12:36:42.481] Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 13.107.213.42, 13.107.246.42, 2620:1ec:46::42, ...
[2023-07-19 12:36:42.481] Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|13.107.213.42|:443... connected.
[2023-07-19 12:36:42.481] HTTP request sent, awaiting response... 404 Not Found
[2023-07-19 12:36:42.481] 2023-07-19 14:36:42 ERROR 404: Not Found.

Version: 0.2.49
VSCode Version: 1.80.0
Commit: 2d7a33f66a5157c6378a1621ddb89d4130ab3659
Date: 2023-07-18T23:36:31.672Z
Electron: 22.3.10
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621

@dylang93
Copy link

@truell20, any updates on this? Planning on trialling this IDE for my team. But we use WSL2 for our work, and it's not currently working. Even with these workarounds, any ETA?

@sisrfeng
Copy link
Author

sisrfeng commented Jul 20, 2023

@sisrfeng do you have a fix_download script update ?

Sorry, no.

I used diff and posted that reply, and then did something else. Days later I come back to the script and find the script does not work

@dylang93
Copy link

dylang93 commented Jul 22, 2023

Okay, so I took the script above that someone wrote in the VSCodium issues and then tweaked it further. Ensure you are updated to the latest version of Cursor (at the time it's 0.3.1).

Create a folder in your home directory. If this folder exists, make sure to delete everything in it. It will make your WSL extensions need to be reinstalled but that is no issue to do them cause they are stored on the Windows side.

mkdir $HOME/.vscodium-server
cd $HOME/.vscodium-server

then

nano server-env-setup

and then paste this code into there and save the file.

NOTE: If you don't have the cursor command installed for CLI use (Way easier if do install it with cursor command installed). Please update the app_name to the directory of the bin file.
Example: c:\Users\{YOUR_WINDOWS_USER}\AppData\Local\Programs\cursor\resources\app.
This will fetch relevant information from Cursor to run the script.

export VSCODE_WSL_DEBUG_INFO=true

fix_download() {
    case "$QUALITY" in
        stable)
            local repo_name='vscodium'
            local app_name='cursor';;
        insider)
            local repo_name='vscodium-insiders'
            local app_name='codium-insiders';;
        *)
            echo "unknown quality: $QUALITY" 1>&2
            return 1;;
    esac
    local ps='/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'
    local cmd="(Get-Command $app_name).Path | Split-Path | Split-Path"
    local install_dir=$(wslpath -u "$($ps -nop -c "$cmd | Write-Host -NoNewLine")")

    local product_json="$install_dir/product.json"
    local release=$(jq -r .release "$product_json")
    local version=$(jq -r .vscodeVersion "$product_json" | sed "s#\(-$QUALITY\)\?\$#.$release&#")
    case $version in null.*)
        version=$(jq -r .version "$product_json" | sed "s#\(-$QUALITY\)\?\$#.$release&#");;
    esac
    local arch=$(uname -m)
    case $arch in
        x86_64)
            local platform='x64';;
        armv7l | armv8l)
            local platform='armhf';;
        arm64 | aarch64)
            local platform='arm64';;
        *)
            echo "unknown machine: $arch" 1>&2
            return 1;;
    esac
    local url="https://github.com/VSCodium/$repo_name/releases/download/$version/vscodium-reh-linux-$platform-$version.tar.gz"
    export VSCODE_SERVER_TAR=$(curl -fLOJ "$url" --output-dir /tmp -w '/tmp/%{filename_effective}')
    export REMOVE_SERVER_TAR_FILE=true
}
[ "$VSCODE_WSL_DEBUG_INFO" = true ] && set -x
if [ ! -d "$HOME/$DATAFOLDER/bin/$COMMIT" ]; then
    if [ ! -d "$HOME/$DATAFOLDER/bin_commit" ]; then
        set -e
        fix_download
        set +e
    fi
fi
unset fix_download

Then open Cursor in Windows, and install the extensions Remote Development and WSL into Cursor. Then click the bottom right blue box and click Connect to WSL.

This will open a new Cursor window with it initializing the WSL connection. It will then set up the vscodium-server using the script we pasted.

And Tada should have WSL working. This is a hacky workaround and might have some hiccups.

@walnutwaldo
Copy link

^ confirmed by the devs that this should work. Make sure to double check that jq is installed in WSL and cursor is installed in Windows

@walnutwaldo
Copy link

walnutwaldo commented Aug 1, 2023

LATEST FIX as of July 31, 2023

We are now hosting our own Cursor servers so you can use AI tools inside of WSL!

MAKE SURE:

  1. You have cursor or cursor-nightly properly installed on your Windows machine (old version of Cursor wouldn't install this correctly so make sure to check the path)
  2. You have jq installed in the WSL
  3. You have the folder ~/.cursor-server and nothing else in that server to start with (remove anything if needed)

Inside of ~/.cursor-server of your WSL machine, create the script server-env-setup and fill it with this:

export VSCODE_WSL_DEBUG_INFO=true

fix_download() {
    case "$QUALITY" in
        stable)
            local app_name='cursor';;
        *)
            echo "unknown quality: $QUALITY" 1>&2
            return 1;;
    esac
    local ps='/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'
    local cmd="(Get-Command $app_name).Path | Split-Path | Split-Path"
    local install_dir=$(wslpath -u "$($ps -nop -c "$cmd | Write-Host -NoNewLine")")

    local product_json="$install_dir/product.json"
    local release=$(jq -r .cursorServerRelease "$product_json")
    local vscodium_release=$(jq -r .release "$product_json")
    local version=$(jq -r .version "$product_json")
	local vscodium_version=$(jq -r .vscodeVersion "$product_json")
    case $version in null.*)
        version=$(jq -r .version "$product_json");;
    esac
    case $vscodium_version in null.*)
        vscodium_version=$(jq -r .version "$product_json");;
    esac
    local arch=$(uname -m)
    case $arch in
        x86_64)
            local platform='x64';;
        armv7l | armv8l)
            local platform='armhf';;
        arm64 | aarch64)
            local platform='arm64';;
        *)
            echo "unknown machine: $arch" 1>&2
            return 1;;
    esac
    local url="https://cursor.blob.core.windows.net/remote-releases/${version}-${release}/vscode-reh-linux-${platform}.tar.gz"
    local fallback_url="https://github.com/VSCodium/vscodium/releases/download/${vscodium_version}.${vscodium_release}/vscodium-reh-linux-${platform}-${vscodium_version}.${vscodium_release}.tar.gz"

    # Attempt to download from the initial URL
    export VSCODE_SERVER_TAR=$(curl -fLOJ "$url" --output-dir /tmp -w '%{filename_effective}')
    if [ $? -ne 0 ]; then
        # If the download fails, attempt to download from the fallback URL
        export VSCODE_SERVER_TAR=$(curl -fLOJ "$fallback_url" --output-dir /tmp -w '/tmp/%{filename_effective}')
    fi

    export REMOVE_SERVER_TAR_FILE=true
}
[ "$VSCODE_WSL_DEBUG_INFO" = true ] && set -x
if [ ! -d "$HOME/$DATAFOLDER/bin/$COMMIT" ]; then
    if [ ! -d "$HOME/$DATAFOLDER/bin_commit" ]; then
        set -e
        fix_download
        set +e
    fi
fi
unset fix_download

@Cafezinho
Copy link

Cafezinho commented Aug 1, 2023

DO NOT WORK WITH LATEST 0.6 VERSION.

Had to go back to 0.5.1

Edit: It automatically updated back to 0.6.0. SO IT IS NOT WORKING

@walnutwaldo
Copy link

@Cafezinho are you using the newest script I just posted above? What error do you get?

@Cafezinho
Copy link

@walnutwaldo When I install 0.6.0, when I put the script in the new folder it gives me:

".cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server: not found"

When I rename code-server to codium-server it gives me type mismatch

Thanks for the help

@4rt3mi5
Copy link

4rt3mi5 commented Aug 1, 2023

@Cafezinho I think I understand your issue now; I've encountered it before as well. This happens because before you created the script, the WSL extension downloaded an incompatible version on its own. After creating the script, it didn't update it due to the existence of the server component. The solution is to delete everything in the ~/.cursor-server directory except for server-env-setup. Then, reopen Cursor, and the script will take effect and download the correct components.

@Cafezinho
Copy link

Still did not work

image

@4rt3mi5
Copy link

4rt3mi5 commented Aug 1, 2023

@Cafezinho Can you show me the complete terminal output? It seems like the script did not work in your environment.

@Cafezinho
Copy link

Here it is:

image

@4rt3mi5
Copy link

4rt3mi5 commented Aug 1, 2023

@Cafezinho In your WSL environment, is there codium-server or code-server in the directory ~/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin?

@Cafezinho
Copy link

code-server

@walnutwaldo
Copy link

@Cafezinho usually you need to clear out your entire ~/.cursor-server folder except for the server-env-setup file and then retry.

@truell20
Copy link
Contributor

Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)

Have seen this work if you close of the window and try again? @Tusen183 Is it persistent?

@truell20
Copy link
Contributor

@lacion Did you run "Fix WSL" first? If yes, then can you send the output of these two commands:

(wsl -l -q).Trim() -split "`n" | ForEach-Object { $_ -replace '[^a-zA-Z0-9\._-]', '' } | Where-Object { $_ -ne '' }
wsl -e whoami

@Tusen183
Copy link

@truell20 I Tried it. There wasn't any output, so I don't know if it executed it. This issue only happens with Centos 7, I have no problem with Ubuntun 20.04. I guess it's not Cursor's problem.

@karthik-pepperdex
Copy link

Still does not work for me too

@Tusen183
Copy link

Tusen183 commented Aug 26, 2023

@truell20 It can work now.But I don't know which step make it work. I removed all the servers related to cursor and vscode, did what @danielvds01x mentioned, and opened tcpforward in the ssh config.

@maxritter
Copy link

maxritter commented Aug 28, 2023

@lacion Did you run "Fix WSL" first? If yes, then can you send the output of these two commands:

(wsl -l -q).Trim() -split "`n" | ForEach-Object { $_ -replace '[^a-zA-Z0-9\._-]', '' } | Where-Object { $_ -ne '' }
wsl -e whoami
> (wsl -l -q).Trim() -split "`n" | ForEach-Object { $_ -replace '[^a-zA-Z0-9\._-]', '' } | Where-Object { $_ -ne '' }
Ubuntu-CommPrev
docker-desktop-data
docker-desktop
> wsl -e whoami
max

I get this error inside WSL, even after running the "fix WSL" script:

> cursor
To use Cursor with the Windows Subsystem for Linux, please install Cursor in Windows and uninstall the Linux version in WSL. You can then use the `cursor` command in a WSL terminal just as you would in a normal command prompt.
Do you want to continue anyway? [y/N] y
To no longer see this prompt, start Cursor with the environment variable DONT_PROMPT_WSL_INSTALL defined.
/mnt/c/Users/mail/AppData/Local/Programs/cursor/resources/app/bin/cursor: 62: /mnt/c/Users/mail/AppData/Local/Programs/cursor/resources/app/bin/../cursor: not found

@truell20
Copy link
Contributor

Ah, right now we only support opening WSL from Cursor itself, instead of from the command line. You need to run Ctrl+Shift+P, "Connect to WSL."

@Tusen183
Copy link

Tusen183 commented Aug 31, 2023

@truell20

Error:

There was a problem connecting to WSL after the updated version, the link is invalid. Can I roll back the version, and it will work normally after manually installing the server in the previous version.

Os:

wsl ubuntu20.04 LTS

Version: 0.9.1
VSCode Version: 1.80.1
Commit: 30d21e59529ff0a52d8a847c419e668f2fd2d620
Date: 2023-08-30T23:17:14.710Z
Electron: 22.3.10
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19045

Error

[2023-08-31 01:35:58.833] --2023-08-31 09:35:58-- https://update.code.visualstudio.com/commit:30d21e59529ff0a52d8a847c419e668f2fd2d620/server-linux-x64/stable
[2023-08-31 01:35:58.833] Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 13.107.246.73, 13.107.213.73, 13.107.246.1, ...
[2023-08-31 01:35:58.833] Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|13.107.246.73|:443...
[2023-08-31 01:35:59.145] connected.
[2023-08-31 01:35:59.145] HTTP request sent, awaiting response...
[2023-08-31 01:35:59.158] 404 Not Found
[2023-08-31 01:35:59.158] 2023-08-31 09:35:59 ERROR 404: Not Found.
[2023-08-31 01:35:59.158]
[2023-08-31 01:35:59.158] ERROR: Failed to download https://update.code.visualstudio.com/commit:30d21e59529ff0a52d8a847c419e668f2fd2d620/server-linux-x64/stable to /home/tusen183/.cursor-server/bin/30d21e59529ff0a52d8a847c419e668f2fd2d620-1693445758.tar.gz

@Cafezinho
Copy link

Error in version 0.9.1. Keeps happening every 3 updates. Needs fix ASAP

@Cafezinho
Copy link

HELPPPPPPPPPPPPPPPPPPPP

@Tusen183
Copy link

@Cafezinho I use 0.8, can work.

@Cafezinho
Copy link

How can I download 0.8 now?

@Cafezinho
Copy link

Worked on 0.9.1 if you apply fix inside cursor using Ctrl P + Fix WSL and after restart your computer.

@bhaskoro-muthohar
Copy link

Worked on 0.9.1 if you apply fix inside cursor using Ctrl P + Fix WSL and after restart your computer.

whoaa, I just tried it and it works

@karthik-pepperdex
Copy link

still no luck on my end

@karthik-pepperdex
Copy link

image
im still stuck at this error, im on the latest version of cursor, did the fix wsl part and still nothing.

@karthik-pepperdex
Copy link

Ah, right now we only support opening WSL from Cursor itself, instead of from the command line. You need to run Ctrl+Shift+P, "Connect to WSL."

I dont even find such a command in my command palette

@truell20
Copy link
Contributor

truell20 commented Sep 6, 2023

You need to install the WSL extension @Kardev07

@vmasrani
Copy link

vmasrani commented Sep 6, 2023

How can I download 0.8 now?

Also want to know this! Previous versions were working for me but now everything is broken :(

@truell20
Copy link
Contributor

@vmasrani What problem are you encountering? Could you provide a screenshot?

@tonydavis629
Copy link

Latest update has broken my WSL. Having the same issue as discussed here, even after running Fix WSL and restarting.

Version: 0.10.4
VSCode Version: 1.80.1
Commit: c0db898419c36107211de244bdcf5f412c1a4920
Date: 2023-09-10T05:39:06.846Z
Electron: 22.3.10
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19044

@Vitalsine85
Copy link

Latest update has broken my WSL. Having the same issue as discussed here, even after running Fix WSL and restarting.

Version: 0.10.4 VSCode Version: 1.80.1 Commit: c0db898419c36107211de244bdcf5f412c1a4920 Date: 2023-09-10T05:39:06.846Z Electron: 22.3.10 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19044

Rolling back worked for me. See: https://forum.cursor.sh/t/cant-connect-to-remote-ssh-server-after-recent-update/632/5

@johannesmichael
Copy link

After running the Fix WSL I had to convert the server-env-setup file from ANSI to UTF-8, since my user name contains german special characters.
Did it with 0.10.4 and then installed 0.12.3.
Running fine

@eino-makitalo
Copy link

After running the Fix WSL I had to convert the server-env-setup file from ANSI to UTF-8, since my user name contains german special characters. Did it with 0.10.4 and then installed 0.12.3. Running fine

This helped me with finish version of machine... fix it to utf-8 automatically

@sisrfeng
Copy link
Author

Any latest official solution for connecting to wsl ? Since the time I commented (#660 (comment)), I can connect to wsl. But recently it fails again.

@IncubatorShokuhou
Copy link

Same issue. Hope if will be fixed ASAP as it is a critical bug in my opinion.

@batjko
Copy link

batjko commented Jan 30, 2024

EDIT: To fix this, do the following:

  1. Ctrl + Shift + P to open the Command Palette
  2. Select "Fix WSL Install" and hit enter

Now, if you install the WSL extension and run Ctrl + Shift + P then the "Connect to WSL" command, you should be able to open a WSL folder in Cursor.

This solved it for me as well, thanks 👍

@RossMcMillan92
Copy link

Fixed for me by opening settings UI and changing "Remote.SSH.Local Server Download" from "auto" to "always".

@WarningRoo
Copy link

If Docker is installed, Connect to WSL may default to Docker's WSL instance.

This could cause errors, like download failures or other environment issues.

Use Connect to WSL using distro... to select the correct WSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests