| 11 Mar 2023 |
K900 | If there's nothing else in the folder, you can remove the folder as well | 13:04:20 |
henrik-ch | there's a bin folder in there, so I won't touch the .vscode-server folder - script deleted now. | 13:05:04 |
henrik-ch | The terminal error output looks the same afterwards unfortunately:
[2023-03-11 13:05:47.776] Resolving wsl+NixOS, resolveAttempt: 1
[2023-03-11 13:05:48.229] Starting VS Code Server inside WSL (wsl2)
[2023-03-11 13:05:48.229] Extension version: 0.76.1
[2023-03-11 13:05:48.229] Windows build: 22621. Multi distro support: available. WSL path support: enabled
[2023-03-11 13:05:48.595] Using shell environment from invoking shell: /tmp/vscode-distro-env.ejew9b
[2023-03-11 13:05:48.744] WSL daemon log file:
[2023-03-11 13:05:48.746] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d NixOS -e sh -c "if [ -d ~/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m"
[2023-03-11 13:05:49.119] Unable to detect if server is already installed: Error: Command failed: C:\WINDOWS\System32\wsl.exe -d NixOS -e sh -c "if [ -d ~/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m"
[2023-03-11 13:05:49.119] /nix/store/k90dlx0yw3463kxbfvyi9hf3q64bm5rj-bash-interactive-5.1-p16/bin/sh: line 1: uname: command not found
[2023-03-11 13:05:49.119]
[2023-03-11 13:05:49.119] 湩瑳污潦湵
[2023-03-11 13:05:49.119] 港硩猯潴敲欯〹汤へ睹㐳㌶硫晢祶㥩晨焳㐶浢爵慢桳椭瑮牥捡楴敶㔭ㄮ瀭㘱戯湩猯㩨氠湩㨱甠慮敭›潣浭湡潮⁴潦湵
[2023-03-11 13:05:49.120] Launching C:\WINDOWS\System32\wsl.exe -d NixOS sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 5e805b79fcb6ba4c2d23712967df89a089da575b stable code-server .vscode-server --host=:: --print-ip-address --port=0 --connection-token=1933795805-3547129303-155333572-2104169279 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2023-03-11 13:05:49.736] Setting up server environment: Looking for /home/i97henka/.vscode-server/server-env-setup. Not found.
[2023-03-11 13:05:49.736] WSL version: NixOS
[2023-03-11 13:05:49.737] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 28: uname: command not found
[2023-03-11 13:05:49.737] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 32: dirname: command not found
[2023-03-11 13:05:49.737] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 32: /wslDownload.sh: No such file or directory
[2023-03-11 13:05:49.742] VS Code Server for WSL closed unexpectedly.
[2023-03-11 13:05:49.742] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2023-03-11 13:05:49.767] WSL Daemon exited with code 0
[2023-03-11 13:06:04.005] Download in background is enabled
As a new angle I am trying to run this command in my powershell terminal, and my error message is in line with what I get in the terminal print above:
PS C:\Users\i97he> C:\WINDOWS\System32\wsl.exe -d NixOS -u i97henka -e sh -c "if [ -d ~/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m"
install-found /nix/store/k90dlx0yw3463kxbfvyi9hf3q64bm5rj-bash-interactive-5.1-p16/bin/sh: line 1: uname: command not found
PS C:\Users\i97he>
Any suggestions where to go from here? I am a bit lost myself I must admit.
| 13:10:29 |
henrik-ch | (I tried the powershell command with and without specifying the user - so that seems to be a red herring) | 13:11:17 |
K900 | Have you restarted vscode as it tells you to? | 13:14:09 |
henrik-ch | restarted the whole machine to be on the safe side, still same message afaic.
[2023-03-11 13:18:05.596] Resolving wsl+NixOS, resolveAttempt: 1
[2023-03-11 13:18:06.475] Starting VS Code Server inside WSL (wsl2)
[2023-03-11 13:18:06.475] Extension version: 0.76.1
[2023-03-11 13:18:06.475] Windows build: 22621. Multi distro support: available. WSL path support: enabled
[2023-03-11 13:18:07.207] Using shell environment from invoking shell: /tmp/vscode-distro-env.4uhLDI
[2023-03-11 13:18:07.468] WSL daemon log file:
[2023-03-11 13:18:07.470] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d NixOS -e sh -c "if [ -d ~/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m"
[2023-03-11 13:18:07.926] Unable to detect if server is already installed: Error: Command failed: C:\WINDOWS\System32\wsl.exe -d NixOS -e sh -c "if [ -d ~/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m"
[2023-03-11 13:18:07.926] /nix/store/k90dlx0yw3463kxbfvyi9hf3q64bm5rj-bash-interactive-5.1-p16/bin/sh: line 1: uname: command not found
[2023-03-11 13:18:07.926]
[2023-03-11 13:18:07.926] 湩瑳污潦湵
[2023-03-11 13:18:07.926] 港硩猯潴敲欯〹汤へ睹㐳㌶硫晢祶㥩晨焳㐶浢爵慢桳椭瑮牥捡楴敶㔭ㄮ瀭㘱戯湩猯㩨氠湩㨱甠慮敭›潣浭湡潮⁴潦湵
[2023-03-11 13:18:07.927] Launching C:\WINDOWS\System32\wsl.exe -d NixOS sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 5e805b79fcb6ba4c2d23712967df89a089da575b stable code-server .vscode-server --host=:: --print-ip-address --port=0 --connection-token=1821804161-1383173471-3142305905-1140375785 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2023-03-11 13:18:08.490] Setting up server environment: Looking for /home/i97henka/.vscode-server/server-env-setup. Not found.
[2023-03-11 13:18:08.490] WSL version: NixOS
[2023-03-11 13:18:08.491] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 28: uname: command not found
[2023-03-11 13:18:08.491] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 32: dirname: command not found
[2023-03-11 13:18:08.491] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 32: /wslDownload.sh: No such file or directory
[2023-03-11 13:18:08.491] VS Code Server for WSL closed unexpectedly.
[2023-03-11 13:18:08.491] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2023-03-11 13:18:08.502] WSL Daemon exited with code 0
[2023-03-11 13:18:10.639] Download in background is enabled
| 13:19:01 |
K900 | Maybe try running code from inside the VM first | 13:21:09 |
henrik-ch | Sorry if that's a stupid question, but isn't that what I am doing when I type code . in the nixos wsl instance? I'm sure that you mean something different though that I don't yet understand. | 13:27:39 |
K900 | Yes, that | 13:28:02 |
K900 | Maybe try removing ~/.vscode-server entirely then | 13:28:17 |
henrik-ch | I think that improved things:
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$ code .
Installing VS Code Server for x64 (5e805b79fcb6ba4c2d23712967df89a089da575b)
Downloading: 100%
Unpacking: 100%
Unpacked 2399 files and folders to /home/i97henka/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b.
cannot execute /home/i97henka/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b/node: NIX_LD or NIX_LD_x86_64-linux is not set
Do you know about that setting NIX_LD or NIX_LD_x86_64-linux?
| 13:30:04 |
K900 | Are you on 22.11 or unstable? | 13:30:48 |
K900 | Those should be set by default on unstable | 13:30:56 |
henrik-ch | [i97henka@nixos:~/github/vscode-remote-wsl-nixos]$ nixos-version
22.11.2630.e6d5772f351 (Raccoon)
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$ sudo nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixos https://nixos.org/channels/nixos-22.11
| 13:32:40 |
henrik-ch | so I need to change that. | 13:32:59 |
K900 | You could also set them manually, but generally it might be a better idea to run unstable, as that's what nixos-wsl is mostly tested afaisnt | 13:33:28 |
K900 | * You could also set them manually, but generally it might be a better idea to run unstable, as that's what nixos-wsl is mostly tested against | 13:33:40 |
henrik-ch | better to change the channel, or do it over configuration.nix somehow? | 13:33:44 |
K900 | You have to change the channel if you want to run unstable | 13:34:20 |
K900 | Unless you use niv or flakes or some other way of tracking your inputs that's not channels | 13:34:37 |
henrik-ch | I have flakes activated by default in the nixos-wsl, but I think that I only use them in specific folders with direnv, and not for the whole system management? How can I check?
This is my channel setup now:
[i97henka@nixos:~]$ sudo nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixos https://nixos.org/channels/nixos-22.11
nixpkgs https://nixos.org/channels/nixpkgs-unstable
Does that look right?
| 13:38:04 |
K900 | If you have /etc/nixos/configuration.nix and no /etc/nixos/flake.nix, you're using channels | 13:39:30 |
K900 | And no, you want to replace the nixos channel | 13:39:38 |
K900 | And you probably want to use nixos-unstable, not nixpkgs-unstable | 13:39:52 |
henrik-ch | I think that the replace of the nixos channel is done now:
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$ sudo nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixos https://nixos.org/channels/nixos-unstable
nixpkgs https://nixos.org/channels/nixpkgs-unstable
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$ sudo nixos-rebuild switch --u
pgrade
unpacking channels...
building Nix...
building the system configuration...
activating the configuration...
setting up /usr/share/applications...
setting up /usr/share/icons...
setting up /etc...
setting up /bin...
setting up /bin/login...
setting up /sbin/init shim...
reloading user units for i97henka...
setting up tmpfiles
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$ cd ~
[i97henka@nixos:~]$ rm -rf .vscode-server/
[i97henka@nixos:~]$ cd github/vscode-remote-wsl-nixos/
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$ code .
Installing VS Code Server for x64 (5e805b79fcb6ba4c2d23712967df89a089da575b)
Downloading: 100%
Unpacking: 100%
Unpacked 2399 files and folders to /home/i97henka/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b.
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$
It's no errors in the command line now, but unfortunately still the same in the vscode terminal:
[2023-03-11 14:04:01.455] Windows build: 22621. Multi distro support: available. WSL path support: enabled
[2023-03-11 14:04:01.849] Using shell environment from invoking shell: /tmp/vscode-distro-env.SGB9gH
[2023-03-11 14:04:02.003] WSL daemon log file:
[2023-03-11 14:04:02.004] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d NixOS -e sh -c "if [ -d ~/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m"
[2023-03-11 14:04:02.403] Unable to detect if server is already installed: Error: Command failed: C:\WINDOWS\System32\wsl.exe -d NixOS -e sh -c "if [ -d ~/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m"
[2023-03-11 14:04:02.403] /nix/store/7xf4f4d9jip5rjkzwvxwxqgmyhzzvyqk-bash-interactive-5.2-p15/bin/sh: line 1: uname: command not found
[2023-03-11 14:04:02.403]
[2023-03-11 14:04:02.403] 湩瑳污潦湵
[2023-03-11 14:04:02.403] 港硩猯潴敲㜯晸昴搴樹灩爵歪睺硶硷東祭穨発煹慢桳椭瑮牥捡楴敶㔭㈮瀭㔱戯湩猯㩨氠湩㨱甠慮敭›潣浭湡潮⁴潦湵
[2023-03-11 14:04:02.404] Launching C:\WINDOWS\System32\wsl.exe -d NixOS sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 5e805b79fcb6ba4c2d23712967df89a089da575b stable code-server .vscode-server --host=:: --print-ip-address --port=0 --connection-token=1574352636-3755954077-1501434474-266153846 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2023-03-11 14:04:03.015] Setting up server environment: Looking for /home/i97henka/.vscode-server/server-env-setup. Not found.
[2023-03-11 14:04:03.015] WSL version: NixOS
[2023-03-11 14:04:03.016] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 28: uname: command not found
[2023-03-11 14:04:03.016] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 32: dirname: command not found
[2023-03-11 14:04:03.033] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 32: /wslDownload.sh: No such file or directory
[2023-03-11 14:04:03.033] VS Code Server for WSL closed unexpectedly.
[2023-03-11 14:04:03.033] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2023-03-11 14:04:03.050] WSL Daemon exited with code 0
[2023-03-11 14:05:24.901] Download in background is enabled
| 14:05:56 |
| Fallenbagel changed their display name from fallenbagel to Fallenbagel. | 18:19:10 |
| 14 Mar 2023 |
| Yilong Liu joined the room. | 01:35:53 |
| purewaterisme joined the room. | 05:49:57 |
purewaterisme | In reply to @i97henka:matrix.org
I think that the replace of the nixos channel is done now:
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$ sudo nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixos https://nixos.org/channels/nixos-unstable
nixpkgs https://nixos.org/channels/nixpkgs-unstable
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$ sudo nixos-rebuild switch --u
pgrade
unpacking channels...
building Nix...
building the system configuration...
activating the configuration...
setting up /usr/share/applications...
setting up /usr/share/icons...
setting up /etc...
setting up /bin...
setting up /bin/login...
setting up /sbin/init shim...
reloading user units for i97henka...
setting up tmpfiles
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$ cd ~
[i97henka@nixos:~]$ rm -rf .vscode-server/
[i97henka@nixos:~]$ cd github/vscode-remote-wsl-nixos/
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$ code .
Installing VS Code Server for x64 (5e805b79fcb6ba4c2d23712967df89a089da575b)
Downloading: 100%
Unpacking: 100%
Unpacked 2399 files and folders to /home/i97henka/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b.
[i97henka@nixos:~/github/vscode-remote-wsl-nixos]$
It's no errors in the command line now, but unfortunately still the same in the vscode terminal:
[2023-03-11 14:04:01.455] Windows build: 22621. Multi distro support: available. WSL path support: enabled
[2023-03-11 14:04:01.849] Using shell environment from invoking shell: /tmp/vscode-distro-env.SGB9gH
[2023-03-11 14:04:02.003] WSL daemon log file:
[2023-03-11 14:04:02.004] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d NixOS -e sh -c "if [ -d ~/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m"
[2023-03-11 14:04:02.403] Unable to detect if server is already installed: Error: Command failed: C:\WINDOWS\System32\wsl.exe -d NixOS -e sh -c "if [ -d ~/.vscode-server/bin/5e805b79fcb6ba4c2d23712967df89a089da575b ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf alpine-; fi; uname -m"
[2023-03-11 14:04:02.403] /nix/store/7xf4f4d9jip5rjkzwvxwxqgmyhzzvyqk-bash-interactive-5.2-p15/bin/sh: line 1: uname: command not found
[2023-03-11 14:04:02.403]
[2023-03-11 14:04:02.403] 湩瑳污潦湵
[2023-03-11 14:04:02.403] 港硩猯潴敲㜯晸昴搴樹灩爵歪睺硶硷東祭穨発煹慢桳椭瑮牥捡楴敶㔭㈮瀭㔱戯湩猯㩨氠湩㨱甠慮敭›潣浭湡潮⁴潦湵
[2023-03-11 14:04:02.404] Launching C:\WINDOWS\System32\wsl.exe -d NixOS sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 5e805b79fcb6ba4c2d23712967df89a089da575b stable code-server .vscode-server --host=:: --print-ip-address --port=0 --connection-token=1574352636-3755954077-1501434474-266153846 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2023-03-11 14:04:03.015] Setting up server environment: Looking for /home/i97henka/.vscode-server/server-env-setup. Not found.
[2023-03-11 14:04:03.015] WSL version: NixOS
[2023-03-11 14:04:03.016] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 28: uname: command not found
[2023-03-11 14:04:03.016] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 32: dirname: command not found
[2023-03-11 14:04:03.033] /mnt/c/Users/i97he/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1/scripts/wslServer.sh: line 32: /wslDownload.sh: No such file or directory
[2023-03-11 14:04:03.033] VS Code Server for WSL closed unexpectedly.
[2023-03-11 14:04:03.033] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2023-03-11 14:04:03.050] WSL Daemon exited with code 0
[2023-03-11 14:05:24.901] Download in background is enabled
Hello. I also just ran into this issue. Are you running nativeSystemd? Disabling that fixed the issue for me(though obviously this is not an ideal solution) | 05:50:51 |
henrik-ch | In reply to @purewaterisme:matrix.org Hello. I also just ran into this issue. Are you running nativeSystemd? Disabling that fixed the issue for me(though obviously this is not an ideal solution) Thank you very much for sharing 🙏 purewaterisme. I managed to get something working now, but it feels like a bad case of cargo-culting, as I don't understand why many of the steps that I took were needed 🤣.
Here my latest configuration.nix:
{ pkgs, config, modulesPath, ... }:
let
#nixvim = import (builtins.fetchGit {
# url = "https://github.com/pta2002/nixvim";
#});
nixos-wsl = import ./nixos-wsl;
in
{
imports = [
#nixvim.nixosModules.nixvim
nixos-wsl.nixosModules.wsl
<home-manager/nixos>
];
wsl = {
enable = true;
nativeSystemd = false;
wslConf.automount.root = "/mnt";
defaultUser = "i97henka";
startMenuLaunchers = true;
};
# Enable nix flakes
nix.package = pkgs.nixFlakes;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
users.users.i97henka = {
isNormalUser = true;
extraGroups = [ "wheel"];
};
home-manager.users.i97henka = { pkgs, ... }: {
home.stateVersion = "22.11";
home.packages = [ pkgs.jq pkgs.ripgrep pkgs.gh ];
nixpkgs.config.allowUnfree = true;
programs.bash = {
enable = true;
shellAliases = {
ll = "ls -l";
".." = "cd ..";
gst = "git status";
glo = "git log --oneline";
gfa = "git fetch --all";
ggfl = "git push --force-with-lease";
};
};
programs.git.enable = true;
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
programs.fzf.enable = true;
programs.bat.enable = true;
programs.vscode.enable = true;
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
};
};
environment.systemPackages = with pkgs; [
bat
git
vim
wget
];
programs.nix-ld.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "curses";
};
system.stateVersion = "22.11";
}
What is very interesting and unexpected about this for me - it's running the linux version of vscode, so "pure wsl", rather than running a server and hosting the gui in the windows. I hope that it gets clearer what I mean when I post a screenshot in the next step.
| 09:02:53 |