Skip to content

mattzink/arch-wsl

Repository files navigation

ConsolePic

Arch Linux on WSL

Poweshell script I use to build an Arch Linux WSL 2 distribution from scratch.

Configures:

  • Latest minimal Arch kernel-less distro
  • System locale
  • Non-root user with password-less sudo
  • systemd
  • yay package manager with package caching disabled
  • fastfetch w/ sixel logo (Requires Windows Terminal to see)
  • oh-my-posh BASH prompt

Usage

  1. Ensure WSL is configured correctly

    • Use the latest WSL version (wsl --update)
    • For systemd to work correctly, legacy cgroups v1 must be disabled
    • Use the newer Mirrored networking mode (Not NAT) to access WSL services across your LAN

    Therefore, the contents of your $HOME/.wslconfig file should include:

    [wsl2]
    kernelCommandLine = cgroup_no_v1=all systemd.unified_cgroup_hierarchy=1
    networkingMode=mirrored
  2. For proper glyph support, configure your terminal to use a Nerd Font. I like CaskaydiaCove Nerd Font.

  3. Unzip the archive file from this repo

  4. From a Powershell prompt, run create-arch-distro.ps1 (see the script for all supported parameters)

    .\create-arch-distro.ps1 -DistroName myarch -Force
  5. If successfull, then you should be able run the distro

    wsl -d myarch

About

Arch Linux on WSL

Topics

Resources

Stars

Watchers

Forks