·3 min read·#wsl2#arch#linux#desktop#xrdp#aur#xfce

Arch Linux Desktop on WSL2: Complete XRDP Setup Guide

Arch Linux Desktop on WSL2: Complete XRDP Setup Guide architecture diagram

Arch Linux brings rolling releases and the AUR to WSL2. If you want the latest packages and complete control over your system, Arch is hard to beat. The setup requires a few extra steps—creating a user, building packages from AUR—but the result is a lean, up-to-date desktop.

Why Arch on WSL2?

  • Rolling release—always the latest packages
  • AUR (Arch User Repository)—massive package collection
  • Minimal base—install only what you need
  • Excellent documentation—the Arch Wiki is legendary
  • Learning opportunity—understand Linux internals

Prerequisites

  • Windows 10 (version 2004+) or Windows 11
  • WSL2 installed and working
  • Arch Linux from Microsoft Store or WSL UI

Installing Arch Linux

Arch is available in the Microsoft Store. Install it through WSL UI for easier management.

Installing Arch Linux via WSL UI

Or via command line:

powershell
wsl --install -d archlinux

Critical First Step: Create a User

The Microsoft Store Arch image boots as root with no regular user. You must create one—makepkg (needed for AUR packages) refuses to run as root.

bash
# Create user with wheel group (for sudo) useradd -m -s /bin/bash -G wheel yourname passwd yourname # Enable wheel group sudo (uncomment NOPASSWD line) sed -i 's/^# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/' /etc/sudoers # Set as default WSL user cat >> /etc/wsl.conf << 'EOF' [user] default=yourname EOF

Restart WSL to apply:

powershell
wsl --terminate archlinux

Step 1: Install Base Development Tools

bash
sudo pacman -Syu --noconfirm base-devel git

Step 2: Install yay (AUR Helper)

The xrdp package is in the AUR, not official repos. Install yay to manage AUR packages:

bash
cd /tmp git clone https://aur.archlinux.org/yay.git cd yay makepkg -si --noconfirm

Step 3: Install XFCE Desktop

bash
sudo pacman -S --noconfirm xfce4 xfce4-goodies

Step 4: Install XRDP from AUR

bash
yay -S --noconfirm xrdp xorgxrdp

This builds and installs xrdp from the AUR.

Step 5: Configure XRDP

Change the Port

bash
sudo sed -i 's/^port=3389/port=3390/' /etc/xrdp/xrdp.ini

Fix X11 Socket (If Needed)

bash
[ -L /tmp/.X11-unix ] && sudo rm /tmp/.X11-unix sudo mkdir -p /tmp/.X11-unix && sudo chmod 1777 /tmp/.X11-unix

Step 6: Create xinitrc

Arch uses .xinitrc, not .xsession—this is critical:

bash
echo "exec startxfce4" > ~/.xinitrc chmod +x ~/.xinitrc

The exec is important for proper session handling.

Step 7: Enable and Start XRDP

bash
sudo systemctl enable xrdp xrdp-sesman --now

Step 8: Connect

  1. Open Remote Desktop Connection on Windows (Win+R, type mstsc)
  2. Enter localhost:3390
  3. Log in with your Arch username and password

Arch Linux XFCE desktop running in WSL2 via XRDP

Quick Reference

bash
# As root, create user first useradd -m -s /bin/bash -G wheel yourname && passwd yourname sed -i 's/^# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/' /etc/sudoers echo -e "[user]\ndefault=yourname" >> /etc/wsl.conf # Then: wsl --terminate Arch # As regular user sudo pacman -Syu --noconfirm base-devel git cd /tmp && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si --noconfirm sudo pacman -S --noconfirm xfce4 xfce4-goodies yay -S --noconfirm xrdp xorgxrdp sudo sed -i 's/^port=3389/port=3390/' /etc/xrdp/xrdp.ini echo "exec startxfce4" > ~/.xinitrc sudo systemctl enable xrdp xrdp-sesman --now # Connect: mstsc → localhost:3390

Arch-Specific Gotchas

IssueSolution
Running as rootCreate a regular user (Step: Create a User)
makepkg refuses to runDon't run as root—use regular user
xrdp package not foundIt's in AUR—install yay first
Session drops immediatelyUse .xinitrc not .xsession, include exec
Black screenCheck X11 socket symlink, verify .xinitrc exists

Keeping Arch Updated

bash
# Update everything (including AUR packages) yay -Syu # Just official repos sudo pacman -Syu

Troubleshooting

For deeper issues—black screens, connection problems, display errors—see the comprehensive WSL2 Desktop Troubleshooting Guide.

This Series

Further Reading

← Back to all posts