!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

338 Members
https://github.com/nix-community/NixOS-WSL57 Servers

Load older messages


SenderMessageTime
8 Dec 2022
@daniel573:matrix.orgDaniel Kahlenberg joined the room.08:37:49
@daniel573:matrix.orgDaniel KahlenbergI am experiencing a weird behaviour since I enabled native-systemd or native-docker or both at the same time - trying to figure out which combo it is: After a restart of the physical machine and trying to run wsl -d NixOS --user myuser again, the NixOS instance entirely refuses to start or even give me some output at all, only (useless workaround was the -e sh switch that basically gave me nothing to work with either.08:42:08
@daniel573:matrix.orgDaniel KahlenbergRight now I imported the nixos-wsl tgz afresh and set up everything again this time without native-systemd first to see if the issue will reproduce later maybe without docker-native as well.08:44:08
@daniel573:matrix.orgDaniel Kahlenberg(https://github.com/573/nix-config-1/blob/54e247d/nixos/base/nixoswsl.nix)08:45:18
@imnotdwight:matrix.orgimnotdwight joined the room.14:34:46
@sandro:supersandro.deSandro 🐧did you change the nixos-wsl module option for native-systemd?14:37:35
@daniel573:matrix.orgDaniel Kahlenberg

Sandro 🐧: I had basically

    wsl = {
      enable = true;
      defaultUser = "dkahlenberg";
      #interop = {
      #  register = true;
      #  preserveArgvZero = true;
      #};
      #nativeSystemd = true;
      docker-native = {
        enable = true;
      };
    };
    # https://github.com/nix-community/NixOS-WSL/discussions/71
    security.sudo.wheelNeedsPassword = true;
14:41:21
@daniel573:matrix.orgDaniel KahlenbergAlso I just see that I already deactivated nativeSystemd again, I remember having all commented options seen above on meaning active when it happened.14:44:26
@daniel573:matrix.orgDaniel KahlenbergMaybe it contributed that I had added the new defaultUser with a uid of 1000, which is also the default for the nixos user ?14:45:39
@daniel573:matrix.orgDaniel KahlenbergAs in https://github.com/NixOS/nixpkgs/issues/1217014:46:29
@sandro:supersandro.deSandro 🐧
In reply to @daniel573:matrix.org
Maybe it contributed that I had added the new defaultUser with a uid of 1000, which is also the default for the nixos user ?
I have changed that, too
14:51:16
@nzbr:nzbr.deArson CopperflameEnabling the docker-native module might not be even necessary with native systemd anymore - it was mainly just a workaround for docker desktop being unable to start the proxy binary inside NixOS itself, so it might work now without the syschdemd container in the way14:53:40
9 Dec 2022
@k900:0upti.meK900Anyone else getting Dec 09 09:51:23 akane-wsl systemd[13274]: systemd-tmpfiles-setup.service: Failed to set up credentials: Protocol error after the systemd 252 upgrade?06:53:21
@sandro:supersandro.deSandro 🐧I am still pinning to systemd-249 IIRC because systemctl status was not logging errors/warnings on that09:56:15
@daniel573:matrix.orgDaniel Kahlenberg
In reply to @nzbr:nzbr.de
Enabling the docker-native module might not be even necessary with native systemd anymore - it was mainly just a workaround for docker desktop being unable to start the proxy binary inside NixOS itself, so it might work now without the syschdemd container in the way

docker-native does not seem to be the problem in my case, as soon as I reenabled the nativeSystemd setting (see https://github.com/573/nix-config-1/blob/dcc37f6/nixos/base/nixoswsl.nix#L24) the problem returned: wsl --shutdown then wsl.exe -d NixOS no interactive shell opened anymore.

nzbr (they/it) For what you wrote about docker-native, does that mean I will have the native docker automatically then (don't want to depend on docker desktop) ?

10:48:05
@nzbr:nzbr.deArson CopperflameYou can use either native docker (the daemon runs as a systemd service in NixOS) or Docker Desktop). Docker desktop might work without enabling it, but you'll still need to enable docker-native if you want to use that. (I mixed up docker-native and docker-desktop in my answer, sorry 😅)10:52:30
@nzbr:nzbr.deArson CopperflameDoes native systemd work without docker enabled?10:52:51
@daniel573:matrix.orgDaniel Kahlenberg

nzbr (they/it): I have to try, right now (https://github.com/573/nix-config-1/blob/04a3c80/nixos/base/nixoswsl.nix#L25) I have nativeSystemd explicitly set on false.

For docker (enabled) I have the native (non-desktop) version and even the binfmt-setting enabled.

With this I could successfully wsl --shutdown and wsl -d NixOS again. Only thing I did differently was chowning all /home/nixos to nixos user and my home dir to my user as well as deletig /etc/passwd and /etc/group entries concerning these prior nixos-rebuild.

13:16:48
@daniel573:matrix.orgDaniel KahlenbergLet's see if I find the strength to set it up once more with native-systemd now.13:17:28
@daniel573:matrix.orgDaniel Kahlenberg *

nzbr (they/it): I have to try, right now (https://github.com/573/nix-config-1/blob/04a3c80/nixos/base/nixoswsl.nix#L25) I have nativeSystemd explicitly set on false.

For docker (enabled) I have the native (non-desktop) version and even the binfmt-setting enabled.

With this I could successfully wsl --shutdown and wsl -d NixOS again. EDIT: Using shopt -s dotglob; chown -R nixos:users /home/nixos; shopt -u dotglob to be entirely correct: Only thing I did differently was chowning all /home/nixos to nixos user and my home dir to my user as well as deletig /etc/passwd and /etc/group entries concerning these prior nixos-rebuild.

13:24:57
@daniel573:matrix.orgDaniel Kahlenberg Having both docker-native.enabled = true and nativeSystemd = true also renders my system broken (interop.* attributes true both). Trying nativeSystemd without docker-native now. 15:23:17
@daniel573:matrix.orgDaniel Kahlenberg Same problem with nativeSystemd = true and docker-native not enabled (interop.* attributes all true). 16:19:06
@k900:0upti.meK900 What exactly is the problem? 16:20:27
@daniel573:matrix.orgDaniel Kahlenberg
wsl --status
Standardversion: 2
Kernel-Version: 5.10.102.1
16:20:29
@k900:0upti.meK900Like, what are you doing and what is happening?16:20:42
@daniel573:matrix.orgDaniel Kahlenberg K900: After the installation of NixOS-WSL and "deploying" my above described config I run wsl --shutdown. Then when running wsl -d NixOS again, nothing happens, no prompt appears, the instance is in stopped state. Only thing available is wsl -d NixOS -e sh but that leaves me with no possibility to debug further so I have to reinstall with the problematic config changes rolled back. 16:24:29
@k900:0upti.meK900What do you mean by "is in stopped state"?16:24:50
@k900:0upti.meK900Is the VM actually dead, or are you just not getting any output?16:24:57
@k900:0upti.meK900 Do you get anything if you run wsl --system -d NixOS and then dmesg? 16:25:15
@daniel573:matrix.orgDaniel Kahlenberg
➜  wsl.exe --list -v
  NAME          STATE           VERSION
* wsl-vpnkit    Running         2
  Ubuntu        Stopped         2
  NixOS         Stopped         2
16:25:25

Show newer messages


Back to Room ListRoom Version: 9