Development

How to run Arch Linux in WSL

Captain Salem 4 min read

How to run Arch Linux in WSL

The Windows Subsystem for Linux has completely revolutionized the way developers build applications. It allow us to quickly and easily spin up a Linux distribution straight from our Windows machine.

This removes the need to dual boot your machine. It also allows you to integrate your already available tools in your development ecosystem. For example, you can run an WSL instance into a VSCode session in a single click.

It also removes the overhead provided by Virtual machines which required additional hardware support and configuration.

Therefore, if you want to get started in Linux without making any permanent changes to your Windows machine, WSL is probably your best bet.

However, although WSL does come with great power, it lacks support for some distributions. In this tutorial, we will show you how to run Arch Linux in WSL.

Enable WSL on Windows

As usual, the first step is to ensure you have WSL enabled and configured on your machine.

Before running the commands provided in this tutorial, you will need to ensure you have Windows 10 Build 2004 and above.

Open your Windows Command Prompt with administrator privileges and run the command:

wsl --install

The command above will download, install and configure the latest version of the Linux kernel for your system.

Keep in mind that there are different WSL versions. To ensure compatibility with various Linux distributions, set WSL version 2 with the command:

wsl --set-default-version 2

This will set WSL version 2 as default kernel.

If you are on older versions of WSL, you can upgrade to WSL version 2 by running the command:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Next, enable Virtual Machine Platform with the command:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Finally, download the WSL version 2 update package in the resource below and install:

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

Finally, run the command below to set WSL 2 as default.

wsl --set-default-version 2

Once everything is ready, follow the steps provided in the next step to run Arch Linux.

Download and Configure Arch on WSL.

Although Arch Linux is not provided in the official store, you can still run an Arch instance in WSL thanks to Open-Source Developers.

Method 1 - Using App Package Installer

Open your browser and navigate to the resource below:

https://github.com/yuk7/ArchWSL

Head over to the releases page to download the installer packages.

Select the ArchWSL-AppX_[version].appx package and the Arch-AppX_[version].cer

image-20220801084244628
image-20220801084244628

NOTE: Avoid the Online installer package as this will require you to have a network connection.

Once downloaded, open the .cer file and click open.

image-20220801084329974
image-20220801084329974

Next, read the certificate details and ensure it contains details such as issued by and created by. This certificate allows you to install appx packages outside of the microsoft store.

image-20220801084438210
image-20220801084438210

NOTE: Ensure the certificate contains details as shown above.

Select Install and choose Local Machine.

image-20220801084629605
image-20220801084629605

Keep in mind that this will require elevated privileges.

In the next Window, select Place all certificates in the following store.

Next, select Trusted Root Certification Authorities

image-20220801084932618
image-20220801084932618

Finally, select next and click install to complete the process.

Once completed, launch the download .appx file to begin the installation.

image-20220801085059404
image-20220801085059404

Click Install and done.

image-20220801085117251
image-20220801085117251

Once the installation is complete, you should see a Windows as shown:

image-20220801085142040
image-20220801085142040

Once completed, you can launch arch from the Start menu.

image-20220801085227884
image-20220801085227884

Using Scoop

If you have scoop installed on your machine, you can use it to install Arch WSL with two simple commands.

Open the command prompt as administrator and run the command:

scoop bucket add extras
image-20220801085608586
image-20220801085608586

Finally, run:

scoop install archwsl

And with that, you should Arch installed and ready to run.

Initializing Arch

Once the installation is complete, ensure to start the Arch instance allowing you to initialize pacman keyring and databases.

Finally, refresh package repositories with the command:

sudo pacmna -Syu
image-20220801085955958
image-20220801085955958

Termination

And with that, you should have Arch Linux instance running on your WSL platform.

We thank you for reading, feel free to share and if you face any issues, feel free to contact us.

Share
Comments
More from Cloudenv

Cloudenv

Developer Tips, Tricks and Tutorials.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Cloudenv.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.