Build a Windows Subsystem for Linux (WSL) distribution installer/launcher application.
-
The latest version of WSL is available from the Microsoft Store
-
Download the .appx app and corresponding .cer cert from releases/latest
-
Import the self-signed .cer to
Trusted Publisher
andTrusted Root Certificate Authority
-
Install the .appx app package
-
Obtain root filesystem tarball and save as x86\install.tar.gz. I preferred the method from badgumby/arch-wsl
-
Setup and build:
-
Detailed notes: build-notes supplement the Microsoft README
-
Visual Studio isn't strictly required, but it was practically so in order to get the build tools setup and .vcxproj files corrected.
-
-
The command
netsh winsock reset
has been used to solve a number of strange WSL failures, for example:The attempted operation is not supported for the type of object referenced. Error code: Wsl/Service/0x8007273d
-
Any other advanced settings and then add /etc/wsl to rootfs
-
Eliminate ARM build targets if not needed (or figure out necessary tools)
This solution was pieced together from multiple sources:
-
microsoft/WSL-DistroLauncher - WSL Distro Launcher Reference Implementation
-
vineelsai26/Arch-WSL - mainly used for logos, etc. in ArchWSL-Appx/Assets and overall guidance
-
badgumby/arch-wsl - good instructions for creating Arch based WSL rootfs (not packaged as .appx)