This is a C++ implementation of ArchLinux for Windows Subsystem for Linux (WSL) based on the Microsoft's reference implementation (https://github.com/Microsoft/WSL-DistroLauncher).
This repository contains instructions on how to create an ArchLinux image for x64 e.g. archlinux.tar.gz and the VC++ code to generate the Universal Windows Platform (UWP) app for ArchLinuxWSL.
-
Install a copy of Visual Studio 2019 Community from https://visualstudio.microsoft.com/downloads/. You will need the
Desktop development with C++andUniversal Windows Platform developmentcomponents. Default configurations should be fine. -
Generate a test certificate:
- In Visual Studio, open
VC++\DistroLauncher.sln. - Select the
ArchLinux (Universal Windows)project. - Select
ArchLinux.appxmanifest. - Select the Packaging tab.
- Select "Choose Certificate".
- Click the Configure Certificate drop down and select Create test certificate.
- Save the project and the solution.
- In Visual Studio, open
-
Build the archlinux.tar.gz Roughly follow the ArchLinux install instructions from https://wiki.archlinux.org/index.php/installation_guide. Basic steps for creating the image on a linux distribution (preferably Archlinux):
- Install
arch-install-scriptsusing pacman (on Archlinux) or rungit clone https://git.archlinux.org/arch-install-scripts.gitif not on Archlinux.- If not on Archlinux compile pacstrap:
cd arch-install-scripts && make pacstrap.
- If not on Archlinux compile pacstrap:
- Create an install directory e.g. 'mkdir -p ~/archinstall'.
- pacstrap the 'base' package, no need for the linux kernel in WSL:
pacstrap ~/archinstall base.- Make required modifications to the files in
~/archinstalleither directly or using chroot; install additional packages with pacstrap e.g.pacstrap ~/archinstall sudo git; generate locale; etc..
- Make required modifications to the files in
- Create the image:
cd ~/archinstall && tar -zcpf ../archlinux.tar.gz --warning=no-file-ignored .. - Copy
archlinux.tar.gzfrom the Linux machine to the Windows machine where you are building the appx in the git directory, next toVC++.
- Install
-
Run the
VC++\build.batscript. -
The appx will be generated in
VC++\x64\Release\ArchLinux\ArchLinux_1.0.0.0_x64.appxand will be signed with the self signed certificate from 'VC++\ArchLinux\ArchLinux_TemporaryKey.pfx'. This certificate needs to be installed as a Local Machine trusted root authority in order to be allowed to install the app.