Arch Linux Officially Lands on Windows Subsystem for Linux

Arch Linux has been officially integrated into WSL, available now for installation via command line following a community-driven development effort.

Users seeking the Arch Linux environment within Windows can now install it directly using Microsoft’s Windows Subsystem for Linux. Following a community-driven effort by developer Robin Candau, Arch Linux has been officially added to the roster of distributions manageable through WSL.

This allows installation via a simple PowerShell command: wsl --install archlinux, which uses the Microsoft Store infrastructure to fetch and set up the official image, typically released monthly.

The new integration streamlines the setup process considerably, moving away from previous manual methods or reliance on third-party installers. The development work, initiated earlier in the year, took place in a dedicated GitLab repository (`archlinux/archlinux-wsl`), eventually gaining Microsoft’s cooperation for the official inclusion. WSL itself allows running Linux environments directly on Windows, typically using lightweight virtualization without needing full virtual machines or dual-boot setups.

Setting Up Your Arch Environment

The official Arch Linux image is tailored for WSL 2, the current subsystem version that runs a full Linux kernel inside a utility virtual machine. This generally offers better performance and system call compatibility than the original WSL1 architecture. New WSL installations obtained from the Microsoft Store default to WSL 2. For users preferring manual control, the ArchWiki details downloading the `.wsl` image file directly and installing using wsl --install --from-file (requires WSL 2.4.4+).

Out of the box, the Arch instance logs in as the root user. Standard practice involves setting a root password immediately and then creating a regular user account. To make this new account the default login, users can edit /etc/wsl.conf within the Arch environment, adding a [user] section with the line default=your_username. These configuration changes require restarting the specific WSL instance, achieved by running wsl --terminate archlinux in Windows PowerShell.

Integrating Graphical Tools and Windows Features

WSL 2 includes the WSLg component, designed to run graphical Linux applications natively on the Windows desktop, complete with audio (PulseAudio) and display support (X11/Wayland). This feature requires the guiApplications = true setting under [wsl2] in the Windows %USERPROFILE%\.wslconfig file. While WSLg aims to manage display server connections, current systemd integration within Arch can sometimes interfere with socket paths. The ArchWiki provides workarounds involving systemd-tmpfiles and profile scripts to ensure GUI apps function correctly.

Achieving hardware-accelerated rendering for these apps depends on installing specific packages within Arch: mesa (for the D3D12 OpenGL driver) and vulkan-dzn (for Vulkan), plus vulkan-icd-loader. Certain hardware, like some Intel GPUs, might need additional steps like symlinking libraries to prevent fallback to software rendering.

Beyond graphics, WSL’s interoperability allows running Windows tools from Linux. This facilitates tighter integration, like using the Windows SSH agent via the wsl2-ssh-agent AUR package, helpful for hardware keys. Authentication can also use Windows Hello for sudo via the wsl-hello-sudo-bin AUR package and PAM setup, which utilizes an updated fork of the original tool.

Hardware Access and System Notes

WSL 2 permits direct access to certain hardware from the Windows host. Physical disks can be attached using wsl --mount --bare in an admin prompt, making the disk available within Linux (though offline in Windows). USB device passthrough uses the usbipd-win tool, installed on Windows. After finding the bus ID (usbipd list), the device is bound (usbipd bind) and attached (usbipd attach --wsl).

The official Arch image enables systemd. While older WSL versions required explicit cgroup v2 configuration, this is generally not needed from WSL 2.4.12 onwards. A potential hang during initial boot related to systemd-firstboot.service is handled by a setup script in the image. Docker users might need to run mount --make-rshared / within Arch WSL to resolve potential shared mount propagation errors.

Related: How to Install Windows Subsystem for Linux (WSL) on Windows 11

In our guide, we walk you through various methods to install and update WSL on Windows 11. Whether you prefer using the Command Prompt (CMD) for a more hands-on approach or the Microsoft Store for a simpler installation process, this guide has you covered.

Featured - How to install Windows Subsystem for Linux (WSL) on Windows 11

Markus Kasanmascheff
Markus Kasanmascheff
Markus has been covering the tech industry for more than 15 years. He is holding a Master´s degree in International Economics and is the founder and managing editor of Winbuzzer.com.
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
We would love to hear your opinion! Please comment below.x
()
x