Converting Arch Linux on WSL 1 to WSL 2
Currently (and probably in the future), the official Microsoft documentation for upgrading from WSL1 to WSL 2 does not suggest Arch Linux as a distribution. This may be due to the fact that it was removed from the Windows Store. However, it is still possible to use Arch Linux on WSL 2. The steps for converting Arch Linux from WSL 1 to WSL 2 are outlined below.
Prerequisite Version Check
- Make sure Windows 10 version 2004, build 19041 or higher is installed. This can be verified by executing
winverin the Run dialog (
Meta + R).
Install WSL 2
- Install the
Windows Subsystem for Linuxoptional feature:
PowerShell (Admin) ------------------ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- Install the
Virtual Machine Platformoptional feature:
PowerShell (Admin) ------------------ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart before continuing.
(Optional) Set WSL 2 as Default for New Distributions
Note that this is not required for the task at hand here since this is only for new distributions, but I recommend it.
PowerShell ---------- wsl --set-default-version 2
If the above command does not work, you may need to update the WSL 2 Linux kernel.
Convert Existing Arch Linux on WSL 1 to WSL 2
Verify your existing (installed) WSL distributions:
wsl --list --verbose
NAME STATE VERSION * Arch Stopped 1 Ubuntu Stopped 1
If an Arch Linux instance is listed in the output, use that name for the below command (I don't think it's case-sensitive; I was able to use
wsl --set-version $DISTRO_TO_CONVERT 2
wsl --set-version arch 2
You may get ouput similar to below when it is finished.
Conversion in progress, this may take a few minutes... For information on key differences with WSL 2 please visit https://aka.ms/wsl2 Conversion complete.
If you try to access the distribution before the conversion is complete, there is a security measure that prevents access:
An install, uninstall, or conversion is in progress for this distribution.
Verify the conversion with
wsl --list --verbose:
NAME STATE VERSION * Arch Stopped 2 Ubuntu Stopped 1
As you can see, the WSL 1 Arch instance has been converted to WSL 2 as indicated by the version number.