microsoft / microsoft/WSL

wsl.exe nor any wslapi.dll Add-type request can't be called from Powershell on Windows for ARM

Open
#5,871 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

Is your feature request related to a problem? Please describe.

Lubos is working on WSL enablement for Windows for ARM on his private Surface Pro X in his spare time.
He's trying to avoid using WSL-DistroLaucnher as building it in build.opensuse.org requires cross-compilation by using mingw64 cross compiler test suite, that currently works only on x86 and not aarch64/arm64 (see link bellow).

He wrote a simple PowerShell wrapper that possibly could in the end probably do the trick, however he figured out that Microsoft is providing only Power Shell x86 on Windows for ARM. Therefore this would be dead end for any user-convenient installation.

Uploading application to Windows Store which we can't rebuild in OpenBuildService is a no go for SUSE nor openSUSE as confirmed on our WSL weekly call.

How does openSUSE/SUSE build x86_64 images?
https://build.opensuse.org/project/show/Virtualization:WSL (our arm builds currently simply generate linux aarch64 binaries, instead of windows ones, unlike on x86)

Why is this a problem?
Powershell x86 will not see wsl.exe nor will access the System32 directory with arm libraries. https://en.wikipedia.org/wiki/WoW64 ( https://github.com/lkocman/WSL-PowerLauncher/issues/1 ) this generally limits many use cases for WSL on ARM (I was surprised how many people were using powershell/WSL on x86).

Describe the solution you'd like
I'd like to be able to call wsl.exe and also be able to use [DllImport("wslapi.dll", CharSet = CharSet.Unicode)] in the PowerShell shipped on Windows for ARM, no extra fetching from github and extracting/installing content manually. Therefore I can write a platform agnostic WSL launcher.

Describe alternatives you've considered
Installing Latest PowerShell from github.com release archive. Solves it but this wouldn't work for user who just wants to download arm64 WSL Image from AppStore and have it working.

Porting ming64 cross-compiler suite to ARM and re-build WSL-DistroLaucher (Way too much effort).
Import pre-built ARM binaries of WSLDistroLauncher from VisualStudio into build.opensuse.org (rejected by engineering)
Upload WSL Image builds manually build by VisualStudio (rejected by engineering)

Additional context
PowerShell indeed seems like a very convenient way to solve our WSL/arm64 issue, but the lack of PowerShell for ARM on Windows for ARM default installation completely blocks the effort.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not identify a WSL repository file, test, or entry point to change. Start by determining whether the requested ARM PowerShell behavior is implemented in WSL or depends on Windows PowerShell; done would require invoking wsl.exe and wslapi.dll from the default ARM PowerShell without manual installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.