Skip to content

Instantly share code, notes, and snippets.

@dheerapat
Last active May 5, 2026 08:33
Show Gist options
  • Select an option

  • Save dheerapat/be310214617fc3e55280b0f6d34d23a5 to your computer and use it in GitHub Desktop.

Select an option

Save dheerapat/be310214617fc3e55280b0f6d34d23a5 to your computer and use it in GitHub Desktop.
Install archlinux on WSL2

Arch Linux is officially supported on WSL 2

Step 1 – Ensure WSL 2 is Installed

wsl --install

Step 2 – Install Arch Linux

wsl --install -d archlinux

This downloads and installs the official Arch Linux WSL image.

Step 3 – Initial Setup

Inside archlinux shell, Set a root password:

passwd

Update system:

pacman -Syu

Install sudo if missing:

pacman -S sudo

Create a new user with admin rights:

useradd -m -G wheel <username>
passwd <username>
EDITOR=nano visudo # Uncomment %wheel ALL=(ALL) ALL

Back to Window PowerShell, Set default user:

wsl --manage archlinux --set-default-user <username>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment