nix-community / NixOS-WSL

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

Unable to run on Windows ARM with Snapdragon X Elite #534

Open cwhite92 opened 2 weeks ago

cwhite92 commented 2 weeks ago

Bug description

NixOS imports fine on Windows ARM but when attempting to run NixOS via wsl -d NixOS the following error is thrown on Windows ARM with a Snapdragon X Elite (Microsoft Surface 7):

Catastrophic failure
Error code: Wsl/Service/E_UNEXPECTED

Happy to get more detailed logs if needed (not sure how though). Not sure if it's relevant but Ubuntu and Kali Linux both seem to work fine.

To Reproduce

  1. Follow Quick Start instructions in README to import NixOS into WSL
  2. Attempt to run NixOS via wsl -d NixOS
  3. Above error is given

Logs

Catastrophic failure
Error code: Wsl/Service/E_UNEXPECTED

WSL version

WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.26100.1591
RoadRoller01 commented 1 week ago

me too

RoadRoller01 commented 1 week ago

i got wsl logs via collect-wsl-logs and i am analyze it right now

nzbr commented 1 week ago

Just to be sure: Did you build your own tarball targeting aarch64-linux? The one from our releases is for x86_64 and will not run on ARM

RoadRoller01 commented 1 week ago

@nzbr cool, but how?, i have nix on my other x86 machine, so how i can force it to build for aarch64?

RoadRoller01 commented 1 week ago

hello i build via debian arm wsl, with this commit #530 and it still did not work, the error it appear to cause the problem is

PartA_PrivTags : 16777216
code : 
failurecount : 10
file : D:\a\1\s\src\windows\wslcore\lib\WslCoreInstance.cpp
function : 
hr : 0x8000FFFF
linenumber : 384
message : D:\a\1\s\src\windows\wslcore\lib\WslCoreInstance.cpp(474)\wslservice.exe!00007FF6FCC919CC: (caller: 00007FF6FCB756A0) Exception(10) tid(45f8) 8000FFFF Catastrophic failure
    Msg:[Expected 12 bytes, but received 0] 

threadid : 17912
wslVersion : 2.2.4.0
RoadRoller01 commented 1 week ago

also there was an error that it did not found swap.vhdx so i copied debian swap.vhdx to it path , and it got fixed WslCoreInstance error was always there before and after the fix

malik-n commented 1 week ago

@nzbr cool, but how?, i have nix on my other x86 machine, so how i can force it to build for aarch64?

If you are using a flake based config it should be something like

outputs = { self } @inputs:
  nixosConfigurations.<hostname> = {
    /* ... */
    system = "aarch64-linux";
  };

Or are you talking about cross compiling?

nzbr commented 1 week ago

@RoadRoller01 where did you get those logs from? What does dmesg say (run it in another distro)

RoadRoller01 commented 1 week ago

i got the logs from wsl, via https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1

RoadRoller01 commented 1 week ago

dmesg? do you mean the dmesg of the distro i am building the repository on? idk how it will help you yet i will tell you

nzbr commented 1 week ago

The VM is shared, so dmesg in any distro on the same machine will show the kernel logs for all other distros as well

RoadRoller01 commented 1 week ago

oooh okay 👍, i can’t do it right now, so i will send it tomorrow.

RoadRoller01 commented 1 week ago

dmesg.txt @nzbr that's it