Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cwhite92 opened this issue Aug 29, 2024 · 20 comments
Open

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

cwhite92 opened this issue Aug 29, 2024 · 20 comments
Labels
bug Something isn't working

Comments

@cwhite92
Copy link

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
@cwhite92 cwhite92 added the bug Something isn't working label Aug 29, 2024
@cwhite92 cwhite92 changed the title Unable to start on Windows ARM Unable to run on Windows ARM with Snapdragon X Elite Aug 29, 2024
@RoadRoller01

This comment was marked as off-topic.

@RoadRoller01
Copy link

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

@nzbr
Copy link
Member

nzbr commented Sep 2, 2024

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
Copy link

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

@RoadRoller01
Copy link

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
Copy link

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
Copy link

malik-n commented Sep 5, 2024

@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
Copy link
Member

nzbr commented Sep 5, 2024

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

@RoadRoller01
Copy link

@RoadRoller01
Copy link

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
Copy link
Member

nzbr commented Sep 5, 2024

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
Copy link

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

@RoadRoller01
Copy link

dmesg.txt
@nzbr that's it

@TophC7
Copy link

TophC7 commented Sep 23, 2024

I tried using this
https://nix-community.github.io/NixOS-WSL/building.html
to build an arm image but it did not work i still got the catastrophic failure
I changed the hosts configuration to system = "aarch64-linux"; as well so what am I missing how can I build this tar for wsl?

@nzbr
Copy link
Member

nzbr commented Oct 13, 2024

dmesg.txt @nzbr that's it

Thanks. Unfortunately there's no crash message from our systemd shim there, so this doesn't really help either. It probably doesn't get far enough to set that up

@thashepherd
Copy link

thashepherd commented Oct 17, 2024

WslLogs-2024-10-17_13-20-21.zip
I'm running into this issue as well. Note that I didn't attempt to rebuild for aarch64-linux or anything like that.

@Haskell-mouse
Copy link

Are there any updates? Or maybe ideas on how to debug this (I can do it).

@Marvin-LOUIS
Copy link

You can't use the tarball provided in the releases (at least as of today) as it's only meant for x86_64 systems. I've been running a NixOS instance on WSL2 myself for a few months now and if I recall correctly, I used something akin to the following steps to get it running (there are other ways but it was the simplest for me at the time):

  • On your windows on ARM computer, setup one of the available Linux distro that WSL offers by default. Ubuntu, for example, works great on ARM.
  • Install the Nix package manager in the newly installed VM
  • Clone the NixOS-WSL repo onto the system.
  • In the flake.nix file, modify the system attribute of the default nixosSystem output from using x86_64-linux to aarch64-linux.
  • Build the tarball
  • Copy the resulting tarball from the VM to the Windows host.
  • Setup the NixOS WSL instance using the tarball you built.

I'm fuzzy on the details, but the process was something like that. If needed, I'll try to reproduce what I really did to provide better instructions. The official flake.nix could perhaps also be modified to allow building both the actual x86_64-linux and aarch64-linux tarball directly, aka without tinkering with the repo. Would that be an acceptable pull request ?

@Haskell-mouse
Copy link

Haskell-mouse commented Dec 28, 2024

I've tried to reproduce the bug, but everything works for me. At least after setting everything up accordingly to @Marvin-LOUIS steps list.

WSL version: 2.3.26.0
kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.2605

Yeah, it works even with 6.6.x kernel. I've tried to build and install it:

$ uname -a Linux nixos 6.6.36.6-microsoft-standard-WSL2+ #1 SMP PREEMPT_DYNAMIC Sat Dec 28 17:45:25 EET 2024 aarch64 GNU/Linux

@bogorad
Copy link

bogorad commented Dec 31, 2024

followed these steps and was able to build it. just one point: the quoted step builds the builder, you still have to tun it :)

otherwise smooth sailing, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants