Jump to content

Install Arch Linux on WSL

From ArchWiki


The archlinux-wsl project offers monthly WSL (Windows Subsystem for Linux) [1] images that aim to provide the simplest but complete system to offer an outright Arch Linux experience with WSL.

Note: These images are built for WSL 2, WSL 1 is not supported.

Installation

From a Windows system with WSL 2 installed [2], use one of the following installation method.

Automated install

Warning: This automated install method is a work in progress and is not yet functional!

Run the following command in a PowerShell prompt:

> wsl --install archlinux

You can then run Arch Linux in WSL via the archlinux application from the Start menu, or by running wsl -d archlinux in a PowerShell prompt.

Manual install

WSL 2.4.4 or greater

Download the latest Arch Linux ".wsl" image [3] and double-click on it to start the installation.

You can then run Arch Linux in WSL via the archlinux application from the Start menu, or by running wsl -d archlinux in a PowerShell prompt.

WSL prior to 2.4.4

Download the latest Arch Linux ".wsl" image [4] and run the following command in a PowerShell prompt:

> wsl --import Distro_name Install_location WSL_image

For instance:

> wsl --import archlinux C:\Users\Username\Documents\WSL\archlinux C:\Users\Username\Downloads\archlinux-2025.04.01.121271.wsl

You can then run Arch Linux in WSL via the archlinux application from the Start menu, or by running wsl -d archlinux in a PowerShell prompt. Make sure to execute the first setup script by running /usr/lib/wsl/first-setup.sh right after the first launch.

Tips and tricks

Run graphical applications with WSLg

WSLg (Windows Subsystem for Linux GUI) [5] is a project that aims to enable support for running Linux graphical applications (X11 and Wayland) from WSL [6].

To be able to run graphical applications with WSLg, one must create the following symlinks (this example assumes you created a user with UID 1000, adapt if needed):

$ ln -svf /mnt/wslg/.X11-unix /tmp/
$ ln -svf /mnt/wslg/runtime-dir/wayland-0* /run/user/1000/

Troubleshooting

systemd support

The Arch Linux WSL image provides systemd support.

However, there are known pending issues [7] that may require additional actions for systemd to work properly.

systemd-firstboot.service hanging

The systemd-firstboot.service job hangs at first boot, preventing any other systemd services to start.

While waiting for the actual root cause of this issue (and a proper fix for it) to be identified, a workaround is automatically applied by the first-setup script [8] when running the image for the first time, so you shouldn't have to do anything on that front.

See this issue [9] for more details.

systemd requires plain cgroup v2 support

Currently, WSL starts systems with cgroup v1 support by default [10] but systemd >= 256 dropped support for it [11] and requires plain cgroup v2 support.

While waiting for WSL to start systems with plain cgroup v2 support by default, you can force it by disabling cgroup v1 support in the %USERPROFILE%/.wslconfig file on your Windows system (create it if it doesn't exists) with the following content:

[wsl2]
kernelCommandLine = cgroup_no_v1=all systemd.unified_cgroup_hierarchy=1