nix-community / NixOS-WSL

NixOS on WSL(2) [maintainer=@nzbr]
Apache License 2.0
1.69k stars 109 forks source link

Cannot install on Windows To Go (Windows 10 IoT Enterprise LTSC 2021) #516

Closed jirafey closed 1 month ago

jirafey commented 1 month ago

Bug description

To Reproduce

Steps to reproduce the behavior:

Logs

Include relevant console logs

WSL version

Please paste the output of wsl --version here (wsl --version is not recognized)

PS C:\Windows\system32> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Stopped         2
  NixOS     Stopped         2
PS C:\Windows\system32> Get-fileHash C:\Users\user\Downloads\nixos-wsl.tar.gz

Algorithm       Hash                                                                   Path
---------       ----                                                                   ----
SHA256          576F2DDA94B0DDE278CD9EBBDF04B53BD9C174FBA5DD4E98BD9AF227DD97FC24       C:\Users\user\Downloads\nixos...
PS C:\Windows\system32> wsl --import NixOS $env:USERPROFILE\NixOS\ C:\Users\user\Downloads\nixos-wsl.tar.gz
A distribution with the supplied name already exists.
PS C:\Windows\system32> wsl -d NixOS
when trying to exec the wrapped shell

Even unregistered and reimported, and tried to reinstall

Caused by:
    No such file or directory (os error 2)
    PS C:\Windows\system32> wsl --update
Checking for updates...
Downloading updates...
Installing updates...
This change will take effect on the next full restart of WSL. To force a restart, please run 'wsl --shutdown'.
Kernel version: 5.10.102.1
PS C:\Windows\system32> wsl --shutdown
PS C:\Windows\system32> wsl -d NixOS
when trying to exec the wrapped shell

Caused by:
    No such file or directory (os error 2)
PS C:\Windows\system32>

I don't have a log for when it was installed succesfully it produced no output.

PS C:\Windows\system32> wsl --shutdown
PS C:\Windows\system32> wsl -d NixOS
when trying to exec the wrapped shell

Caused by:
    No such file or directory (os error 2)
PS C:\Windows\system32>  wsl --import NixOS $env:USERPROFILE\NixOS\ C:\Users\user\Downloads\nixos-wsl.tar.gz
PS C:\Windows\system32>
PS C:\Windows\system32>
PS C:\Windows\system32> wsl -d NixOS
The Windows Subsystem for Linux instance has terminated.

I can start ubuntu normally btw

Fresh installed this Windows on external SSD today.

jirafey commented 1 month ago

Update: probably to no license that was the case, but still hope someone with this version can confirm.

nzbr commented 1 month ago

The fact that --version is not recognized means that you are running an old version of WSL2. It lacks features required for getting NixOS to work. If your install includes the Microsoft Store, try downloading the new version from there, otherwise it is also available as an msi package on GitHub