sonowz / vscode-remote-wsl-nixos

Develop using VSCode Remote-WSL environment with NixOS
72 stars 4 forks source link

Unable to detect if server is already installed #1

Closed csamak closed 3 years ago

csamak commented 3 years ago

After following the instructions in the README, I get the following error log from vscode:

[2021-04-19 01:05:54.302] Resolving wsl+NixOS, resolveAttempt: 1
[2021-04-19 01:05:54.355] Starting VS Code Server inside WSL (NixOS)
[2021-04-19 01:05:54.355] Extension version: 0.54.6, Windows build: 19042. Multi distro support: available. WSL path support: enabled
[2021-04-19 01:05:54.356] No shell environment set or found for current distro.
[2021-04-19 01:05:54.476] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d NixOS -e sh -c "[ -d ~/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2021-04-19 01:05:54.582] Unable to detect if server is already installed: Error: Command failed: C:\WINDOWS\System32\wsl.exe -d NixOS -e sh -c "[ -d ~/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2021-04-19 01:05:54.582] sh: uname: command not found
...

It makes sense that it's failing (replacing uname with /run/current-system/sw/bin/uname correctly results in x86_64). It seems like there may have been an update to vscode or the extension since the instructions in this repo were written?

csamak commented 3 years ago

The line to replace in syschdemd.sh seems to have been changed in the NixOS-WSL repo, which I think is what caused this. Got past this error by leaving the new line and also adding a new one for VSCODE_WSL_EXT_LOCATION.

sonowz commented 3 years ago

Hi, thank you for opening the issue!

[2021-04-19 01:05:54.582] sh: uname: command not found

IIRC this error existed even a year ago, and I ignored it since it doesn't break anything. The real problem should've been this: sh: /scripts/wslServer.sh: No such file or directory.

The line to replace in syschdemd.sh seems to have been changed in the NixOS-WSL repo

Yes, I came across the same error a month ago, and made a quick and dirty patch (VSCODE_WSL_EXT_LOCATION). I wonder if there is a better way to cope with this...

TimoMeijer commented 3 years ago

@csamak What was your exact solution?

sonowz commented 3 years ago

I think this issue no longer persists with update of NixOS-WSL repo, so closing the issue.