getcursor / cursor

The AI Code Editor
https://cursor.com
24.97k stars 1.55k forks source link

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

Open sisrfeng opened 1 year ago

sisrfeng commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

benherve commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

https://github.com/VSCodium/vscodium/issues/1265#issuecomment-1416836306 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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

^ 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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

Cafezinho commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

Still did not work

image

4rt3mi5 commented 1 year ago

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

Cafezinho commented 1 year ago

Here it is:

image

4rt3mi5 commented 1 year ago

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

Cafezinho commented 1 year ago

code-server

walnutwaldo commented 1 year ago

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

Cafezinho commented 1 year ago

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

Already have :(

walnutwaldo commented 1 year ago

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

Already have :(

Could you send the full error logs you get from the first time opening WSL after clearing out this folder?

walnutwaldo commented 1 year ago

For people facing issues with WSL:

Please join this Discord thread and post your issues there. You will get more immediate support: https://discord.com/channels/1074847526655643750/1123631322888421518

4rt3mi5 commented 1 year ago

code-server

This seems to indicate that you're using an incompatible server component. You need to completely remove it, and then the script will help you download the correct version.

Cafezinho commented 1 year ago

How does someone achieve that?

@4rt3mi5

4rt3mi5 commented 1 year ago

@Cafezinho Have you tried deleting all the contents in ~/.cursor-server? Close Cursor, ensure that all contents in ~/.cursor-server are deleted, and then create the script ~/.cursor-server/server-env-setup. Then, open Cursor and connect to WSL. If you still encounter an error, please provide the complete output on the first connection.

Cafezinho commented 1 year ago

[2023-08-02 04:33:15.551] authorityHierarchy: wsl+ubuntu-22.04 [2023-08-02 04:33:15.551] WSL extension activating for a local WSL instance [2023-08-02 04:33:15.567] Resolving wsl+ubuntu-22.04, resolveAttempt: 1 [2023-08-02 04:33:15.567] Run: C:\WINDOWS\System32\wsl.exe --status [2023-08-02 04:33:15.733] WSL feature installed: true (wsl --status) [2023-08-02 04:33:15.733] Run: C:\WINDOWS\System32\wsl.exe --list --verbose [2023-08-02 04:33:15.897] Starting VS Code Server inside WSL (wsl2) [2023-08-02 04:33:15.897] Extension version: 0.80.2 [2023-08-02 04:33:15.897] Windows build: 22621. Multi distro support: available. WSL path support: enabled [2023-08-02 04:33:15.897] L10N bundle: undefined [2023-08-02 04:33:15.897] Scriptless setup: false [2023-08-02 04:33:15.898] No shell environment set or found for current distro. [2023-08-02 04:33:16.089] WSL daemon log file: [2023-08-02 04:33:16.094] Probing if server is already installed: if [ -d ~/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m [2023-08-02 04:33:16.094] Run: C:\WINDOWS\System32\wsl.exe -d ubuntu-22.04 -e sh -c if [ -d ~/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m [2023-08-02 04:33:16.363] Probing result: x86_64 [2023-08-02 04:33:16.364] No server install found in WSL, needs linux-x64 [2023-08-02 04:33:16.364] Getting server from client side [2023-08-02 04:33:16.366] Server available at [2023-08-02 04:33:16.367] Run: C:\WINDOWS\System32\wsl.exe -d ubuntu-22.04 sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 74f6148eb9ea00507ec113ec51c489d6ffb4b771 stable codium-server .cursor-server --host=127.0.0.1 --port=0 --connection-token=604081309-2807590738-1681049107-683247359 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all' [2023-08-02 04:33:16.708] Setting up server environment: Looking for /home/visagio/.cursor-server/server-env-setup. Found, executing... [2023-08-02 04:33:16.708] + [ ! -d /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ] [2023-08-02 04:33:16.708] + [ ! -d /home/visagio/.cursor-server/bin_commit ] [2023-08-02 04:33:16.708] + set -e [2023-08-02 04:33:16.708] + fix_download [2023-08-02 04:33:16.708] + local app_name=cursor [2023-08-02 04:33:16.708] + local ps=/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe [2023-08-02 04:33:16.708] + local cmd=(Get-Command cursor).Path | Split-Path | Split-Path [2023-08-02 04:33:16.708] + /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -nop -c (Get-Command cursor).Path | Split-Path | Split-Path | Write-Host -NoNewLine [2023-08-02 04:33:17.018] + wslpath -u C:\Users\daniel.weil_visagio\AppData\Local\Programs [2023-08-02 04:33:17.018] + local install_dir=/mnt/c/Users/daniel.weil_visagio/AppData/Local/Programs [2023-08-02 04:33:17.018] + local product_json=/mnt/c/Users/daniel.weil_visagio/AppData/Local/Programs/product.json [2023-08-02 04:33:17.018] + jq -r .cursorServerRelease /mnt/c/Users/daniel.weil_visagio/AppData/Local/Programs/product.json [2023-08-02 04:33:17.018] jq: error: Could not open file /mnt/c/Users/daniel.weil_visagio/AppData/Local/Programs/product.json: No such file or directory [2023-08-02 04:33:17.018] + local release= [2023-08-02 04:33:17.018] + jq -r .release /mnt/c/Users/daniel.weil_visagio/AppData/Local/Programs/product.json [2023-08-02 04:33:17.018] jq: error: Could not open file /mnt/c/Users/daniel.weil_visagio/AppData/Local/Programs/product.json: No such file or directory [2023-08-02 04:33:17.018] + local vscodium_release= [2023-08-02 04:33:17.018] + jq -r .version /mnt/c/Users/daniel.weil_visagio/AppData/Local/Programs/product.json [2023-08-02 04:33:17.333] jq: error: Could not open file /mnt/c/Users/daniel.weil_visagio/AppData/Local/Programs/product.json: No such file or directory [2023-08-02 04:33:17.333] + local version= [2023-08-02 04:33:17.333] + jq -r .vscodeVersion /mnt/c/Users/daniel.weil_visagio/AppData/Local/Programs/product.json [2023-08-02 04:33:17.333] jq: error: Could not open file /mnt/c/Users/daniel.weil_visagio/AppData/Local/Programs/product.json: No such file or directory [2023-08-02 04:33:17.333] + local vscodium_version= [2023-08-02 04:33:17.333] + uname -m [2023-08-02 04:33:17.333] + local arch=x86_64 [2023-08-02 04:33:17.333] + local platform=x64 [2023-08-02 04:33:17.333] + local url=https://cursor.blob.core.windows.net/remote-releases/-/vscode-reh-linux-x64.tar.gz [2023-08-02 04:33:17.333] + local fallback_url=https://github.com/VSCodium/vscodium/releases/download/./vscodium-reh-linux-x64-..tar.gz [2023-08-02 04:33:17.333] + curl -fLOJ https://cursor.blob.core.windows.net/remote-releases/-/vscode-reh-linux-x64.tar.gz --output-dir /tmp -w %{filename_effective} [2023-08-02 04:33:17.333] % Total % Received % Xferd Average Speed Time Time Time Current [2023-08-02 04:33:17.333] Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 [2023-08-02 04:33:17.957] WSL version: 5.15.90.1-microsoft-standard-WSL2 ubuntu-22.04 [2023-08-02 04:33:17.957] Installing VS Code Server for x64 (74f6148eb9ea00507ec113ec51c489d6ffb4b771) [2023-08-02 04:33:17.957] Downloading:
0 215 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 [2023-08-02 04:33:17.958] curl: (22) The requested URL returned error: 404 [2023-08-02 04:33:17.958] + export VSCODE_SERVER_TAR=/tmp/vscode-reh-linux-x64.tar.gz [2023-08-02 04:33:17.958] + [ 0 -ne 0 ] [2023-08-02 04:33:17.958] + export REMOVE_SERVER_TAR_FILE=true [2023-08-02 04:33:17.958] + set +e [2023-08-02 04:33:17.958] + unset fix_download [2023-08-02 04:33:17.958] + VSCODE_REMOTE_BIN=/home/visagio/.cursor-server/bin [2023-08-02 04:33:17.958] + uname -r [2023-08-02 04:33:17.958] + WSL_VERSION=5.15.90.1-microsoft-standard-WSL2 [2023-08-02 04:33:17.958] + echo WSL version: 5.15.90.1-microsoft-standard-WSL2 ubuntu-22.04 [2023-08-02 04:33:17.958] + dirname /mnt/c/Users/daniel.weil_visagio/.cursor/extensions/ms-vscode-remote.remote-wsl-0.80.2/scripts/wslServer.sh [2023-08-02 04:33:17.958] + /mnt/c/Users/daniel.weil_visagio/.cursor/extensions/ms-vscode-remote.remote-wsl-0.80.2/scripts/wslDownload.sh 74f6148eb9ea00507ec113ec51c489d6ffb4b771 stable /home/visagio/.cursor-server/bin [2023-08-02 04:33:17.958] + [ ! -d /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ] [2023-08-02 04:33:17.958] + set -e [2023-08-02 04:33:17.958] + [ -f /etc/alpine-release ] [2023-08-02 04:33:17.958] + [ -d /home/visagio/.cursor-server/bin ] [2023-08-02 04:33:17.958] + mkdir -p /home/visagio/.cursor-server/bin [2023-08-02 04:33:17.958] + [ /tmp/vscode-reh-linux-x64.tar.gz ] [2023-08-02 04:33:17.958] + [ -f /tmp/vscode-reh-linux-x64.tar.gz ] [2023-08-02 04:33:17.958] + [ ! ] [2023-08-02 04:33:17.958] + date +%s [2023-08-02 04:33:17.958] + SERVER_TAR_FILE=/home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771-1690950797.tar.gz [2023-08-02 04:33:17.958] + download /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771-1690950797.tar.gz [2023-08-02 04:33:17.958] + command -v wget [2023-08-02 04:33:17.958] + [ ! /usr/bin/wget ] [2023-08-02 04:33:17.958] + local_name=/home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771-1690950797.tar.gz [2023-08-02 04:33:17.958] + [ -f /etc/alpine-release ] [2023-08-02 04:33:17.958] + uname -m [2023-08-02 04:33:17.958] + PLATFORM=x64 [2023-08-02 04:33:17.958] + echo Installing VS Code Server for x64 (74f6148eb9ea00507ec113ec51c489d6ffb4b771) [2023-08-02 04:33:17.958] + printf Downloading:
[2023-08-02 04:33:17.958] + local_url=https://update.code.visualstudio.com/commit:74f6148eb9ea00507ec113ec51c489d6ffb4b771/server-linux-x64/stable [2023-08-02 04:33:17.958] + set +x [2023-08-02 04:33:18.265] 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 1% 1% 1% 1% 1% 1% 1% 1% 1% 1% 1% 2% 2% 2% 2% 2% 2% 2% 2% 2% 2% 2% 3% 3% 3% 3% 3% 3% 3% 3% 3% 3% 3% 4% 4% 4% 4% 4% 4% 4% 4% 4% 4% 4% 5% 5% 5% 5% 5% [2023-08-02 04:33:18.569] 5% 5% 5% 5% 5% 5% 6% 6% 6% 6% 6% 6% 6% 6% 6% 6% 6% 7% 7% 7% 7% 7% 7% 7% 7% 7% 7% 7% 8% 8% 8% 8% 8% 8% 8% 8% 8% 8% 8% 9% 9% 9% 9% 9% 9% 9% 9% 9% 9% 9% 10% 10% 10% 10% 10% 10% 10% 10% 10% 10% 10% 11% 11% 11% 11% 11% 11% 11% 11% 11% 11% 11% 12% 12% 12% 12% 12% [2023-08-02 04:33:18.869] 12% 12% 12% 12% 12% 13% 13% 13% 13% 13% 13% 13% 13% 13% 13% 13% 14% 14% 14% 14% 14% 14% 14% 14% 14% 14% 14% 15% 15% 15% 15% 15% 15% 15% 15% 15% 15% 15% 16% 16% 16% 16% 16% 16% 16% 16% 16% 16% 16% 17% 17% 17% 17% 17% 17% 17% 17% 17% 17% 17% 18% 18% 18% 18% 18% 18% 18% 18% 18% [2023-08-02 04:33:19.171] 18% 18% 19% 19% 19% 19% 19% 19% 19% 19% 19% 19% 19% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 21% 21% 21% 21% 21% 21% 21% 21% 21% 21% 21% 22% 22% 22% 22% 22% 22% 22% 22% 22% 22% 22% 23% 23% 23% 23% 23% 23% 23% 23% 23% 23% 23% 24% 24% 24% 24% 24% 24% 24% 24% 24% 24% 24% 25% [2023-08-02 04:33:19.473] 25% 25% 25% 25% 25% 25% 25% 25% 25% 26% 26% 26% 26% 26% 26% 26% 26% 26% 26% 26% 27% 27% 27% 27% 27% 27% 27% 27% 27% 27% 27% 28% 28% 28% 28% 28% 28% 28% 28% 28% 28% 28% 29% 29% 29% 29% 29% 29% 29% 29% 29% 29% 29% 30% 30% 30% 30% 30% 30% 30% 30% 30% 30% 30% 31% 31% 31% 31% 31% [2023-08-02 04:33:19.773] 31% 31% 31% 31% 31% 31% 32% 32% 32% 32% 32% 32% 32% 32% 32% 32% 32% 33% 33% 33% 33% 33% 33% 33% 33% 33% 33% 33% 34% 34% 34% 34% 34% 34% 34% 34% 34% 34% 34% 35% 35% 35% 35% 35% 35% 35% 35% 35% 35% 35% 36% 36% 36% 36% 36% 36% 36% 36% 36% 36% 36% 37% 37% 37% 37% 37% 37% 37% 37% [2023-08-02 04:33:20.075] 37% 37% 37% 38% 38% 38% 38% 38% 38% 38% 38% 38% 38% 39% 39% 39% 39% 39% 39% 39% 39% 39% 39% 39% 40% 40% 40% 40% 40% 40% 40% 40% 40% 40% 40% 41% 41% 41% 41% 41% 41% 41% 41% 41% 41% 41% 42% 42% 42% 42% 42% 42% 42% 42% 42% 42% 42% 43% 43% 43% 43% 43% 43% 43% 43% 43% 43% 43% 44% [2023-08-02 04:33:20.376] 44% 44% 44% 44% 44% 44% 44% 44% 44% 44% 45% 45% 45% 45% 45% 45% 45% 45% 45% 45% 45% 46% 46% 46% 46% 46% 46% 46% 46% 46% 46% 46% 47% 47% 47% 47% 47% 47% 47% 47% 47% 47% 47% 48% 48% 48% 48% 48% 48% 48% 48% 48% 48% 48% 49% 49% 49% 49% 49% 49% 49% 49% 49% 49% 49% 50% 50% 50% 50% [2023-08-02 04:33:20.677] 50% 50% 50% 50% 50% 50% 51% 51% 51% 51% 51% 51% 51% 51% 51% 51% 51% 52% 52% 52% 52% 52% 52% 52% 52% 52% 52% 52% 53% 53% 53% 53% 53% 53% 53% 53% 53% 53% 53% 54% 54% 54% 54% 54% 54% 54% 54% 54% 54% 54% 55% 55% 55% 55% 55% 55% 55% 55% 55% 55% 55% 56% 56% 56% 56% 56% 56% 56% 56% [2023-08-02 04:33:20.979] 56% 56% 56% 57% 57% 57% 57% 57% 57% 57% 57% 57% 57% 57% 58% 58% 58% 58% 58% 58% 58% 58% 58% 58% 58% 59% 59% 59% 59% 59% 59% 59% 59% 59% 59% 59% 60% 60% 60% 60% 60% 60% 60% 60% 60% 60% 60% 61% 61% 61% 61% 61% 61% 61% 61% 61% 61% 61% 62% 62% 62% 62% 62% 62% 62% 62% 62% 62% 62% [2023-08-02 04:33:21.279] 63% 63% 63% 63% 63% 63% 63% 63% 63% 63% 64% 64% 64% 64% 64% 64% 64% 64% 64% 64% 64% 65% 65% 65% 65% 65% 65% 65% 65% 65% 65% 65% 66% 66% 66% 66% 66% 66% 66% 66% 66% 66% 66% 67% 67% 67% 67% 67% 67% 67% 67% 67% 67% 67% 68% 68% 68% 68% 68% 68% 68% 68% 68% 68% 68% 69% 69% 69% 69% [2023-08-02 04:33:21.581] 69% 69% 69% 69% 69% 69% 69% 70% 70% 70% 70% 70% 70% 70% 70% 70% 70% 70% 71% 71% 71% 71% 71% 71% 71% 71% 71% 71% 71% 72% 72% 72% 72% 72% 72% 72% 72% 72% 72% 72% 73% 73% 73% 73% 73% 73% 73% 73% 73% 73% 73% 74% 74% 74% 74% 74% 74% 74% 74% 74% 74% 74% 75% 75% 75% 75% 75% 75% 75% [2023-08-02 04:33:21.883] 75% 75% 75% 75% 76% 76% 76% 76% 76% 76% 76% 76% 76% 76% 77% 77% 77% 77% 77% 77% 77% 77% 77% 77% 77% 78% 78% 78% 78% 78% 78% 78% 78% 78% 78% 78% 79% 79% 79% 79% 79% 79% 79% 79% 79% 79% 79% 80% 80% 80% 80% 80% 80% 80% 80% 80% 80% 80% 81% 81% 81% 81% 81% 81% 81% 81% 81% 81% 81% [2023-08-02 04:33:22.183] 82% 82% 82% 82% 82% 82% 82% 82% 82% 82% 82% 83% 83% 83% 83% 83% 83% 83% 83% 83% 83% 83% 84% 84% 84% 84% 84% 84% 84% 84% 84% 84% 84% 85% 85% 85% 85% 85% 85% 85% 85% 85% 85% 85% 86% 86% 86% 86% 86% 86% 86% 86% 86% 86% 86% 87% 87% 87% 87% 87% 87% 87% 87% 87% 87% 87% 88% 88% 88% [2023-08-02 04:33:22.485] 88% 88% 88% 88% 88% 88% 88% 88% 89% 89% 89% 89% 89% 89% 89% 89% 89% 89% 90% 90% 90% 90% 90% 90% 90% 90% 90% 90% 90% 91% 91% 91% 91% 91% 91% 91% 91% 91% 91% 91% 92% 92% 92% 92% 92% 92% 92% 92% 92% 92% 92% 93% 93% 93% 93% 93% 93% 93% 93% 93% 93% 93% 94% 94% 94% 94% 94% 94% 94% [2023-08-02 04:33:22.790] 94% 94% 94% 94% 95% 95% 95% 95% 95% 95% 95% 95% 95% 95% 95% 96% 96% 96% 96% 96% 96% 96% 96% 96% 96% 96% 97% 97% 97% 97% 97% 97% 97% 97% 97% 97% 97% 98% 98% 98% 98% 98% 98% 98% 98% 98% 98% 98% 99% 99% 99% 99% 99% 99% 99% 99% 99% 99% 99%100%100% [2023-08-02 04:33:22.790] + [ ! -s /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771-1690950797.tar.gz ] [2023-08-02 04:33:22.790] + REMOVE_SERVER_TAR_FILE=true [2023-08-02 04:33:22.790] + set +e [2023-08-02 04:33:22.790] + + tar -tf /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771-1690950797.tar.gz [2023-08-02 04:33:22.790] read -r xs [2023-08-02 04:33:22.790] + wc -l [2023-08-02 04:33:23.714] Unpacking: 0% 1% 2% 3% 4% 5% 6% 7% 8% 9% [2023-08-02 04:33:23.715] + echo 0 [2023-08-02 04:33:23.715] + exit 0 [2023-08-02 04:33:23.715] + FILE_COUNT=1781 [2023-08-02 04:33:23.715] + RC=0 [2023-08-02 04:33:23.715] + [ 0 -ne 0 ] [2023-08-02 04:33:23.715] + set -e [2023-08-02 04:33:23.715] + printf Unpacking: 0%% [2023-08-02 04:33:23.715] + date +%s [2023-08-02 04:33:23.715] + TMP_EXTRACT_FOLDER=/home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771-1690950803 [2023-08-02 04:33:23.715] + mkdir /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771-1690950803 [2023-08-02 04:33:23.715] + set +x [2023-08-02 04:33:24.022] 10% 11% 12% 13% 14% 15% 16% 17% 18% 19% 20% 21% 22% 23% 24% 25% 26% 27% 28% 29% 30% 31% 32% 33% 34% 35% 36% 37% 38% 39% 40% 41% 42% 43% 44% 45% 46% 47% 48% 49% 50% 51% 52% 53% 54% 55% 56% 57% 58% 59% 60% 61% 62% 63% 64% 65% [2023-08-02 04:33:24.334] 66% 67% 68% 69% 70% 71% 72% 73% 74% 75% 76% 77% 78% 79% 80% 81% 82% 83% 84% 85% 86% 87% 88% 89% 90% 91% 92% 93% 94% 95% 96% 97% 98% 99%100% [2023-08-02 04:33:24.741] [2023-08-02 04:33:24.741] Unpacked 1781 files and folders to /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771. [2023-08-02 04:33:24.741] WSL-shell-PID: 8179 [2023-08-02 04:33:24.741] Node executable: /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node [2023-08-02 04:33:24.741] Starting server: /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=604081309-2807590738-1681049107-683247359 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all [2023-08-02 04:33:24.742] + RC=0 [2023-08-02 04:33:24.742] + [ 0 -ne 0 ] [2023-08-02 04:33:24.742] + echo WSL-shell-PID: 8179 [2023-08-02 04:33:24.742] + echo Node executable: /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node [2023-08-02 04:33:24.742] + echo Starting server: /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=604081309-2807590738-1681049107-683247359 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all [2023-08-02 04:33:24.742] + [ -f /etc/alpine-release ] [2023-08-02 04:33:24.742] + uname -m [2023-08-02 04:33:24.742] + [ x86_64 = aarch64 ] [2023-08-02 04:33:24.742] + /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=604081309-2807590738-1681049107-683247359 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all [2023-08-02 04:33:24.742] /mnt/c/Users/daniel.weil_visagio/.cursor/extensions/ms-vscode-remote.remote-wsl-0.80.2/scripts/wslServer.sh: 50: /home/visagio/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server: not found [2023-08-02 04:33:24.742] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips [2023-08-02 04:33:24.744] Run: C:\WINDOWS\System32\wsl.exe -d ubuntu-22.04 -e kill 8179

walnutwaldo commented 1 year ago

@Cafezinho this actually looks like an issue with your installation of the cursor command. We can help you debug this in more depth on Discord. Please join there: https://discord.com/invite/PJEgRywgRy

4rt3mi5 commented 1 year ago

@Cafezinho It seems like you haven't installed Cursor for the command line and then modified the script with a different path? If that's the case, then the path you should specify is C:\Users{YourUserName}\AppData\Local\Programs\Cursor\resources\app\bin\cursor, instead of C:\Users{YourUserName}\AppData\Local\Programs\Cursor\cursor.exe.

A simpler way is to press Ctrl+Shift+P in Cursor, then type "install cursor", and you will see an option to install Cursor for the command line. Execute it, then repeat the previous steps (clear the directory and restart Cursor).

Cafezinho commented 1 year ago

Let me try. Will get back to you in a bit

Cafezinho commented 1 year ago

@walnutwaldo I Have entered discord. When you are available, let me know.

@4rt3mi5 I removed the entry I created manually in PATH, and then tried to use ctrl P install cursor, but it did not work. Tried entering my path in the script, but still did not work. Kept loading forever

Cafezinho commented 1 year ago

Hey, when I entered the path manually in the scrypt it worked.

paladinCTO commented 1 year ago

@walnutwaldo, I'm seconding @Cafezinho's experience. After the 0.6.0 update, the automatic CTRL+P command to install cursor to PATH did not work, but manually adding it to PATH via the system dialog + Windows restart got it to work.

twilwa commented 1 year ago

Experiencing this issue as well. Will try adding cursor to .bashrc

twilwa commented 1 year ago

Did anyone struggle getting cursor added to PATH? I've tried every variation I can think of, GUI environment variables, system envs and user envs, setx, absolute path, %USERPROFILE%, none of them work on the windows side for 'cursor' or 'cursor.exe'. The only change I managed was manually adding the path to .bashrc, which warned me not to install cursor on my linux side (it's not installed on my linux side, i just pointed it at /mnt/c) and then fails.

Note: i actually don't mind if i can't get the CLI command to work, I'm only trying to add it to PATH so I can use the most recent script above.

I have tried clearing out my .cursor-server folder and restarting cursor; there's no change in behavior.

here's my terminal output using the most recent script:

[2023-08-08 03:27:11.417] authorityHierarchy: wsl+Ubuntu [2023-08-08 03:27:11.417] WSL extension activating for a local WSL instance [2023-08-08 03:27:11.438] Resolving wsl+Ubuntu, resolveAttempt: 1 [2023-08-08 03:27:11.439] Run: C:\WINDOWS\System32\wsl.exe --status [2023-08-08 03:27:11.578] WSL feature installed: true (wsl --status) [2023-08-08 03:27:11.578] Run: C:\WINDOWS\System32\wsl.exe --list --verbose [2023-08-08 03:27:11.692] Starting VS Code Server inside WSL (wsl2) [2023-08-08 03:27:11.692] Extension version: 0.80.2 [2023-08-08 03:27:11.692] Windows build: 22621. Multi distro support: available. WSL path support: enabled [2023-08-08 03:27:11.692] L10N bundle: undefined [2023-08-08 03:27:11.692] Scriptless setup: false [2023-08-08 03:27:11.693] No shell environment set or found for current distro. [2023-08-08 03:27:11.941] WSL daemon log file: [2023-08-08 03:27:11.948] Probing if server is already installed: if [ -d ~/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m [2023-08-08 03:27:11.948] Run: C:\WINDOWS\System32\wsl.exe -d Ubuntu -e sh -c if [ -d ~/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m [2023-08-08 03:27:12.196] Probing result: install-found x86_64 [2023-08-08 03:27:12.196] Server install found in WSL [2023-08-08 03:27:12.198] Run: C:\WINDOWS\System32\wsl.exe -d Ubuntu sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 74f6148eb9ea00507ec113ec51c489d6ffb4b771 stable codium-server .cursor-server --host=127.0.0.1 --port=0 --connection-token=3628746358-1589492501-2377184972-2933897308 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all' [2023-08-08 03:27:12.443] Setting up server environment: Looking for /home/anon/.cursor-server/server-env-setup. Found, executing... [2023-08-08 03:27:12.443] WSL version: 5.15.90.1-microsoft-standard-WSL2 Ubuntu [2023-08-08 03:27:12.443] WSL-shell-PID: 472 [2023-08-08 03:27:12.443] Node executable: /home/anon/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node [2023-08-08 03:27:12.443] Starting server: /home/anon/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=3628746358-1589492501-2377184972-2933897308 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all [2023-08-08 03:27:12.444] + [ ! -d /home/anon/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ] [2023-08-08 03:27:12.444] + unset fix_download [2023-08-08 03:27:12.444] + VSCODE_REMOTE_BIN=/home/anon/.cursor-server/bin [2023-08-08 03:27:12.444] + uname -r [2023-08-08 03:27:12.444] + WSL_VERSION=5.15.90.1-microsoft-standard-WSL2 [2023-08-08 03:27:12.444] + echo WSL version: 5.15.90.1-microsoft-standard-WSL2 Ubuntu [2023-08-08 03:27:12.444] + dirname /mnt/c/Users/techw/.cursor/extensions/ms-vscode-remote.remote-wsl-0.80.2/scripts/wslServer.sh [2023-08-08 03:27:12.444] + /mnt/c/Users/techw/.cursor/extensions/ms-vscode-remote.remote-wsl-0.80.2/scripts/wslDownload.sh 74f6148eb9ea00507ec113ec51c489d6ffb4b771 stable /home/anon/.cursor-server/bin [2023-08-08 03:27:12.444] + [ ! -d /home/anon/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ] [2023-08-08 03:27:12.444] + RC=0 [2023-08-08 03:27:12.444] + [ 0 -ne 0 ] [2023-08-08 03:27:12.444] + echo WSL-shell-PID: 472 [2023-08-08 03:27:12.444] + echo Node executable: /home/anon/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node [2023-08-08 03:27:12.444] + echo Starting server: /home/anon/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=3628746358-1589492501-2377184972-2933897308 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all [2023-08-08 03:27:12.444] + [ -f /etc/alpine-release ] [2023-08-08 03:27:12.444] + uname -m [2023-08-08 03:27:12.444] + [ x86_64 = aarch64 ] [2023-08-08 03:27:12.444] + /home/anon/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=3628746358-1589492501-2377184972-2933897308 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all [2023-08-08 03:27:12.444] /mnt/c/Users/techw/.cursor/extensions/ms-vscode-remote.remote-wsl-0.80.2/scripts/wslServer.sh: 50: /home/anon/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server: not found

RyzeNGrind commented 1 year ago
[2023-08-11 03:48:20.972] WSL extension activating for a local WSL instance
[2023-08-11 03:48:20.984] Resolving wsl+NixOS, resolveAttempt: 1
[2023-08-11 03:48:20.987] WSL feature installed: true (dll path)
[2023-08-11 03:48:20.987] Run: C:\Windows\System32\wsl.exe --list --verbose
[2023-08-11 03:48:21.059] Starting VS Code Server inside WSL (wsl2)
[2023-08-11 03:48:21.059] Extension version: 0.80.2
[2023-08-11 03:48:21.059] Windows build: 19045. Multi distro support: available. WSL path support: enabled
[2023-08-11 03:48:21.059] L10N bundle: undefined
[2023-08-11 03:48:21.059] Scriptless setup: false
[2023-08-11 03:48:21.060] No shell environment set or found for current distro.
[2023-08-11 03:48:21.201] WSL daemon log file: 
[2023-08-11 03:48:21.205] Probing if server is already installed: if [ -d ~/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m
[2023-08-11 03:48:21.205] Run: C:\Windows\System32\wsl.exe -d NixOS -e sh -c if [ -d ~/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m
[2023-08-11 03:48:21.340] Unable to detect if server is already installed: Error: Failed to probe if server is already installed: code: Failed to probe if server is already installed: code: 127, sh: line 1: uname: command not found
[2023-08-11 03:48:21.340] , 
[2023-08-11 03:48:21.341] Run: C:\Windows\System32\wsl.exe -d NixOS sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 74f6148eb9ea00507ec113ec51c489d6ffb4b771 stable codium-server .cursor-server --host=127.0.0.1 --port=0 --connection-token=63968854-914569700-4042936753-2173159574 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2023-08-11 03:48:21.506] Setting up server environment: Looking for /home/nixos/.cursor-server/server-env-setup. Found, executing...
[2023-08-11 03:48:21.506] ++ '[' '!' -d /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ']'
[2023-08-11 03:48:21.506] ++ unset fix_download
[2023-08-11 03:48:21.506] + VSCODE_REMOTE_BIN=/home/nixos/.cursor-server/bin
[2023-08-11 03:48:21.506] ++ uname -r
[2023-08-11 03:48:21.506] + WSL_VERSION=5.15.90.1-microsoft-standard-WSL2
[2023-08-11 03:48:21.506] + echo 'WSL version: 5.15.90.1-microsoft-standard-WSL2 NixOS'
[2023-08-11 03:48:21.506] WSL version: 5.15.90.1-microsoft-standard-WSL2 NixOS
[2023-08-11 03:48:21.506] ++ dirname /mnt/c/Users/$USER/.cursor/extensions/ms-vscode-remote.remote-wsl-0.80.2/scripts/wslServer.sh
[2023-08-11 03:48:21.506] + /mnt/c/Users/$USER/.cursor/extensions/ms-vscode-remote.remote-wsl-0.80.2/scripts/wslDownload.sh 74f6148eb9ea00507ec113ec51c489d6ffb4b771 stable /home/nixos/.cursor-server/bin
[2023-08-11 03:48:21.506] + '[' '!' -d /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ']'
[2023-08-11 03:48:21.506] + RC=0
[2023-08-11 03:48:21.506] + '[' 0 -ne 0 ']'
[2023-08-11 03:48:21.506] + echo 'WSL-shell-PID: 1726'
[2023-08-11 03:48:21.506] WSL-shell-PID: 1726
[2023-08-11 03:48:21.506] + echo 'Node executable: /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node'
[2023-08-11 03:48:21.506] Node executable: /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node
[2023-08-11 03:48:21.506] + echo 'Starting server: /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=63968854-914569700-4042936753-2173159574 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2023-08-11 03:48:21.506] Starting server: /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=63968854-914569700-4042936753-2173159574 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all
[2023-08-11 03:48:21.506] + '[' -f /etc/alpine-release ']'
[2023-08-11 03:48:21.506] ++ uname -m
[2023-08-11 03:48:21.506] + '[' x86_64 = aarch64 ']'
[2023-08-11 03:48:21.506] + /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=63968854-914569700-4042936753-2173159574 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all
[2023-08-11 03:48:21.506] /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server: line 12: /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node: No such file or directory
[2023-08-11 03:48:21.509] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2023-08-11 03:48:21.510] Run: C:\Windows\System32\wsl.exe -d NixOS -e kill 1726

I am receiving a similar issue here trying to run Cursor in WSL2 NixOS distribution.

I don't understand why it's throwing the error because the folders and files do indeed exist. I have closed cursor, added to path, and deleted the bin folder so the server-env-setup script can rerun when I try to connect but alas I am still unsure what is the underlying issue.

[nixos@shogun:~/.cursor-server]$ ls -la ./bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/
total 80368
drwxr-xr-x   6 nixos users     4096 Aug 11 03:47 .
drwxr-xr-x   3 nixos users     4096 Aug 11 03:47 ..
drwxr-xr-x   4 nixos users     4096 Aug 11 00:28 bin
drwxr-xr-x  36 nixos users     4096 Aug 11 00:28 extensions
-rwxr-xr-x   1 nixos users 82215032 Aug 11 00:27 node
drwxr-xr-x 114 nixos users     4096 Aug 11 00:28 node_modules
drwxr-xr-x   3 nixos users     4096 Aug 11 00:28 out
-rw-r--r--   1 nixos users       63 Aug 10 23:44 package.json
-rw-r--r--   1 nixos users    45666 Aug 10 23:55 product.json

[nixos@shogun:~/.cursor-server]$ ls -la ./bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/
codium-server  helpers/       remote-cli/

EDIT: Tried a rerun after previous attempt. Same error but shorter log.

[2023-08-11 03:56:53.211] authorityHierarchy: wsl+NixOS
[2023-08-11 03:56:53.211] WSL extension activating for a local WSL instance
[2023-08-11 03:56:53.224] Resolving wsl+NixOS, resolveAttempt: 1
[2023-08-11 03:56:53.226] WSL feature installed: true (dll path)
[2023-08-11 03:56:53.226] Run: C:\Windows\System32\wsl.exe --list --verbose
[2023-08-11 03:56:53.305] Starting VS Code Server inside WSL (wsl2)
[2023-08-11 03:56:53.305] Extension version: 0.80.2
[2023-08-11 03:56:53.305] Windows build: 19045. Multi distro support: available. WSL path support: enabled
[2023-08-11 03:56:53.305] L10N bundle: undefined
[2023-08-11 03:56:53.305] Scriptless setup: false
[2023-08-11 03:56:53.306] No shell environment set or found for current distro.
[2023-08-11 03:56:53.479] WSL daemon log file: 
[2023-08-11 03:56:53.483] Probing if server is already installed: if [ -d ~/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m
[2023-08-11 03:56:53.484] Run: C:\Windows\System32\wsl.exe -d NixOS -e sh -c if [ -d ~/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m
[2023-08-11 03:56:53.610] Unable to detect if server is already installed: Error: Failed to probe if server is already installed: code: Failed to probe if server is already installed: code: 127, sh: line 1: uname: command not found
[2023-08-11 03:56:53.610] , 
[2023-08-11 03:56:53.611] Run: C:\Windows\System32\wsl.exe -d NixOS sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 74f6148eb9ea00507ec113ec51c489d6ffb4b771 stable codium-server .cursor-server --host=127.0.0.1 --port=0 --connection-token=1314230901-2609379601-3885680831-3133491455 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2023-08-11 03:56:53.775] Setting up server environment: Looking for /home/nixos/.cursor-server/server-env-setup. Found, executing...
[2023-08-11 03:56:53.775] ++ '[' '!' -d /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ']'
[2023-08-11 03:56:53.775] ++ unset fix_download
[2023-08-11 03:56:53.775] + VSCODE_REMOTE_BIN=/home/nixos/.cursor-server/bin
[2023-08-11 03:56:53.775] ++ uname -r
[2023-08-11 03:56:53.775] + WSL_VERSION=5.15.90.1-microsoft-standard-WSL2
[2023-08-11 03:56:53.775] + echo 'WSL version: 5.15.90.1-microsoft-standard-WSL2 NixOS'
[2023-08-11 03:56:53.775] WSL version: 5.15.90.1-microsoft-standard-WSL2 NixOS
[2023-08-11 03:56:53.775] ++ dirname /mnt/c/Users/$USER/.cursor/extensions/ms-vscode-remote.remote-wsl-0.80.2/scripts/wslServer.sh
[2023-08-11 03:56:53.775] + /mnt/c/Users/$USER/.cursor/extensions/ms-vscode-remote.remote-wsl-0.80.2/scripts/wslDownload.sh 74f6148eb9ea00507ec113ec51c489d6ffb4b771 stable /home/nixos/.cursor-server/bin
[2023-08-11 03:56:53.775] + '[' '!' -d /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771 ']'
[2023-08-11 03:56:53.775] + RC=0
[2023-08-11 03:56:53.775] + '[' 0 -ne 0 ']'
[2023-08-11 03:56:53.775] + echo 'WSL-shell-PID: 1755'
[2023-08-11 03:56:53.775] WSL-shell-PID: 1755
[2023-08-11 03:56:53.775] + echo 'Node executable: /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node'
[2023-08-11 03:56:53.775] Node executable: /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node
[2023-08-11 03:56:53.775] + echo 'Starting server: /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=1314230901-2609379601-3885680831-3133491455 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2023-08-11 03:56:53.775] Starting server: /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=1314230901-2609379601-3885680831-3133491455 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all
[2023-08-11 03:56:53.775] + '[' -f /etc/alpine-release ']'
[2023-08-11 03:56:53.775] ++ uname -m
[2023-08-11 03:56:53.775] + '[' x86_64 = aarch64 ']'
[2023-08-11 03:56:53.775] + /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server --host=127.0.0.1 --port=0 --connection-token=1314230901-2609379601-3885680831-3133491455 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all
[2023-08-11 03:56:53.775] /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server: line 12: /home/nixos/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/node: No such file or directory
[2023-08-11 03:56:53.778] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2023-08-11 03:56:53.779] Run: C:\Windows\System32\wsl.exe -d NixOS -e kill 1755
wajsic commented 1 year ago

For people still having the issue, for me the problem was that install_dir=$(wslpath -u "$($ps -nop -c "$cmd | Write-Host -NoNewLine")") returned C:\Users\user\AppData\Local\Programs instead of C:\Users\user\AppData\Local\Programs\cursor\resources\app where product.json is defined. Either change the line to point to this folder or copy the product.json to folder that wslpath returns. I guess something went wrong during my installation of Cursor and even the clean reinstall hasn't fixed it.

walnutwaldo commented 1 year ago

Yes, definitely make sure your cursor command is installed correctly. We found that old versions had incorrect install instructions but 0.7.0 and onwards should be fixed. Once it is installed correctly, you can setup the script

RyzeNGrind commented 1 year ago

For people still having the issue, for me the problem was that install_dir=$(wslpath -u "$($ps -nop -c "$cmd | Write-Host -NoNewLine")") returned C:\Users\user\AppData\Local\Programs instead of C:\Users\user\AppData\Local\Programs\cursor\resources\app where product.json is defined. Either change the line to point to this folder or copy the product.json to folder that wslpath returns. I guess something went wrong during my installation of Cursor and even the clean reinstall hasn't fixed it.

Thanks for this tip @wajsic . I tried to debug and it seems this is not the issue for me.

/mnt/c/Users/$USER/AppData/Local/Programs/Cursor/resources/app

The path seems correct, I am not sure why the script is breaking and not working when the product.json file is in the right place.

``` [2023-08-11 18:00:10.872] ++++ /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -nop -c '(Get-Command cursor).Path | Split-Path | Split-Path | Write-Host -NoNewLine' [2023-08-11 18:00:11.801] +++ wslpath -u 'C:\Users\$USER\AppData\Local\Programs\Cursor\resources\app' [2023-08-11 18:00:11.801] ++ local install_dir=/mnt/c/Users/$USER/AppData/Local/Programs/Cursor/resources/app [2023-08-11 18:00:11.801] ++ echo /mnt/c/Users/$USER/AppData/Local/Programs/Cursor/resources/app [2023-08-11 18:00:11.801] /mnt/c/Users/$USER/AppData/Local/Programs/Cursor/resources/app [2023-08-11 18:00:11.801] ++ local product_json=/mnt/c/Users/$USER/AppData/Local/Programs/Cursor/resources/app/product.json [2023-08-11 18:00:11.801] +++ jq -r .cursorServerRelease /mnt/c/Users/$USER/AppData/Local/Programs/Cursor/resources/app/product.json ``` ``` [nixos@shogun:~/.cursor-server]$ ls -la /mnt/c/Users/$USER/AppData/Local/Programs/Cursor/resources/app total 131904 drwxrwxrwx 1 nixos users 4096 Aug 11 04:19 . drwxrwxrwx 1 nixos users 4096 Aug 11 04:19 .. drwxrwxrwx 1 nixos users 4096 Aug 11 04:19 bin drwxrwxrwx 1 nixos users 4096 Aug 11 04:19 builderStaticFiles -rwxrwxrwx 1 nixos users 371 Aug 11 02:35 Cursor.VisualElementsManifest.xml -rwxrwxrwx 1 nixos users 608 Aug 11 02:35 entitlements.mac.plist drwxrwxrwx 1 nixos users 4096 Aug 11 04:19 extensions -rwxrwxrwx 1 nixos users 1109 Aug 11 02:35 LICENSE.txt -rwxrwxrwx 1 nixos users 134836487 Aug 11 02:35 node_modules.asar drwxrwxrwx 1 nixos users 4096 Aug 11 04:19 node_modules.asar.unpacked drwxrwxrwx 1 nixos users 4096 Aug 11 04:19 out -rwxrwxrwx 1 nixos users 1720 Aug 11 02:35 package.json -rwxrwxrwx 1 nixos users 46075 Aug 11 02:35 product.json drwxrwxrwx 1 nixos users 4096 Aug 11 04:19 resources drwxrwxrwx 1 nixos users 4096 Aug 11 04:19 scripts -rwxrwxrwx 1 nixos users 165016 Aug 11 02:35 ThirdPartyNotices.txt ``` EDIT: User Path and System Path variables have been manually defined as "Shell command: Install 'cursor' command" keeps failing for me due to this error... ` Unable to update the PATH environment to include: 'c:\Users\{redacted}\AppData\Local\Programs\Cursor\resources\app\bin' ` USER PATH: C:\Users\\{redacted}\AppData\Local\Programs\Cursor\resources\app\bin SYSTEM PATH: C:\Users\\$USER\AppData\Local\Programs\Cursor\resources\app\bin
sisrfeng commented 1 year ago

So many new solutions appear these days. I've tried some but failed. Can this repo provide some temporary reliable solutions in the doc?

RyzeNGrind commented 1 year ago

I have made some forward progress on this issue if anyone else is interested but now I am stuck with some newer bugs. Keep in mind this fix may be specific to my WSL2 distribution NixOS/Nix but the scripts I have written are in bash so change the command line functions accordingly to your system. /home/nixos/.cursor-server/server-env-setup

#!/run/current-system/sw/bin/bash

# Setup necessary environment variables
export LD_LIBRARY_PATH="/nix/store/4v2bk6almk03mfnz4122dfz8vcxynvs3-gcc-11.3.0-lib/lib:$LD_LIBRARY_PATH"

# Enable debugging if VSCODE_WSL_DEBUG_INFO is true
[ "$VSCODE_WSL_DEBUG_INFO" = true ] && set -x

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" >&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 .version "$product_json" | sed "s#\(-$QUALITY\)\?\$#.$release&#")
    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" >&2
            return 1;;
    esac

    local tar_file_path="/tmp/vscodium-reh-linux-$platform-$version.tar.gz"

    # Remove tar file if it already exists
    [ -f "$tar_file_path" ] && rm -f "$tar_file_path"

    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}')

    # Extract the tar file to the expected location
    mkdir -p "$HOME/.cursor-server/bin/${COMMIT}"
    tar -xzf "$VSCODE_SERVER_TAR" -C "$HOME/.cursor-server/bin/${COMMIT}"

    # Debug: List the contents of the extraction directory
    echo "Listing contents of extraction directory:"
    ls -la "$HOME/.cursor-server/bin/"

    # Debug: List the contents of the expected directory
    echo "Listing contents of expected directory:"
    ls -la "$HOME/.cursor-server/bin/${COMMIT}"

    # Before running nix-node-patch, verify the node binary exists
    if [[ ! -f "/home/nixos/.cursor-server/bin/${COMMIT}/node" ]]; then
        echo "Node.js binary not found at expected location. Exiting." >&2
        return 1
    fi

    # Ensure nix-node-patch script exists and is executable
    if [[ -x "/home/nixos/.cursor-server/nix-node-patch" ]]; then
        echo "Running nix-node-patch..."
        /home/nixos/.cursor-server/nix-node-patch
    else
        echo "Error: nix-node-patch script not found or not executable." >&2
        return 1
    fi

    # Verify and attempt to execute the node binary
    NODE_BINARY="/home/nixos/.cursor-server/bin/${COMMIT}/node"

    # Ensure the binary is executable
    chmod +x "$NODE_BINARY"

    # Try executing the binary
    "$NODE_BINARY" --version

    # If there's an error, print out diagnostic information
    if [[ $? -ne 0 ]]; then
        echo "Error executing the node binary. Diagnostic information:"
        ls -l "$NODE_BINARY"
        patchelf --print-interpreter "$NODE_BINARY"
        ldd "$NODE_BINARY"
        echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
        return 1
    fi

    # Ensure nix-node-test script exists and is executable
    if [[ -x "/home/nixos/.cursor-server/nix-node-test" ]]; then
        echo "Running nix-node-test..."
        /home/nixos/.cursor-server/nix-node-test
    else
        echo "Error: nix-node-test script not found or not executable." >&2
        return 1
    fi
    export REMOVE_SERVER_TAR_FILE=true
}

# Main execution
if [ ! -d "$HOME/$DATAFOLDER/bin/${COMMIT}" ]; then
    fix_download
    if [ $? -ne 0 ]; then
        echo "Error in fix_download function" >&2
        exit 1
    fi
fi

unset fix_download

/home/nixos/.cursor-server/nix-node-test

#!/run/current-system/sw/bin/bash
set -x  # Start echoing commands

NODE_BINARY=".cursor-server/bin/${COMMIT}/node"

# Add necessary libraries to LD_LIBRARY_PATH
export LD_LIBRARY_PATH="/nix/store/4v2bk6almk03mfnz4122dfz8vcxynvs3-gcc-11.3.0-lib/lib:$LD_LIBRARY_PATH"

# Test the node binary
result=$($NODE_BINARY --version)
echo $result

set +x  # Stop echoing commands

/home/nixos/.cursor-server/nix-node-patch

#!/run/current-system/sw/bin/bash
set -x  # Start echoing commands

INTERPRETER_PATH="/nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210/lib/ld-linux-x86-64.so.2"
NODE_BINARY="/home/nixos/.cursor-server/bin/${COMMIT}/node"

# Set the interpreter for the Node.js binary
patchelf --set-interpreter "$INTERPRETER_PATH" "$NODE_BINARY"

# Add necessary libraries to LD_LIBRARY_PATH
export LD_LIBRARY_PATH="/nix/store/4v2bk6almk03mfnz4122dfz8vcxynvs3-gcc-11.3.0-lib/lib:$LD_LIBRARY_PATH"

set +x  # Stop echoing commands

Currently stuck receiving these two errors on codium.

WSL connected to remote. 
vscodium teling me "Could not fetch remote environment"
Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)
rhh4x0r commented 1 year ago

I got it working with the current latest version.

Steps I had to take: 1) Install jq on wsl.exe using sudo apt-get install jq 2) Update environment variables (user AND system, since Powershell runs from System) with the following path for cursor:

c:\Users{redacted}\AppData\Local\Programs\cursor\resources\app\bin

RESTART COMPUTER

3) Delete everything in the ~/.cursor-server folder

4) Recreate the folder and add server-env-setup as the script (no extension)

5) Then launch cursor. Start WSL.

ttktjmt commented 1 year ago

@rhh4x0r This worked fine for my environment! I appreciate it

dylan-baros commented 1 year ago

Not working for me and none of the fixes worked for me either. Noticed that it was looking for /home/dbaros/.cursor-server/bin/74f6148eb9ea00507ec113ec51c489d6ffb4b771/bin/codium-server and the file in my WSL is named code-server. Changed the name and it sort of works now but the terminal does not. Get a Connection error: client refused: version mismatch