Skip to content

ArchWSL

For me, the simplest procedure to install the Distro was to

  1. Download the latest Arch.zip file from the project’s release page

  2. Extract it to a folder where your user has unrestricted read/write permissions (so ideally stay away from Program Files, etc.)

  3. Run the included Arch.exe

  4. Change the root password

    Terminal window
    passwd
  5. Add the wheel group to the allowed sudo users

    Terminal window
    echo "%wheel ALL=(ALL) ALL" > /etc/sudoers.d/wheel
  6. Choose a username for your new user

    Terminal window
    export username={username}

    and add this new user to the wheel group

    Terminal window
    useradd -m -G wheel -s /bin/bash $username
  7. Change the new user’s password

    Terminal window
    passwd $username
  8. Exit the WSL environment

    Terminal window
    exit
  9. Set the new user as the default one

    Terminal window
    Arch.exe config --default-user {username}
  10. Reboot the PC or alternatively restart LxssManager with

    Terminal window
    net stop lxssmanager
    net start lxssmanager
  11. After that reenter WSL with

    Terminal window
    Arch.exe
  12. Setup the pacman keyring

    Terminal window
    sudo pacman-key --init
    sudo pacman-key --populate
    sudo pacman -Sy archlinux-keyring
  13. Update the base system

    Terminal window
    sudo pacman -Su

Just WorksTM?

As I’m sitting behind a corporate http proxy, I initially had no access to the internet.

This can be confirmed by running

Terminal window
curl https://archlinux.org

To make WSL proxy-aware, I needed to

  1. Add the exports to the ~/.bashrc with

    ~/.bashrc
    export http_proxy=http://<hostname>:<port>
    export https_proxy=$http_proxy
    export ftp_proxy=$http_proxy
  2. Source it

    Terminal window
    source ~/.bashrc
  3. Allow sudo to pass these environment variables through by setting the env_keep property in /etc/sudoers.d/proxy

    /etc/sudoers.d/proxy
    Defaults env_keep += "http_proxy https_proxy ftp_proxy"

Rerunning the curl-command should now produce a response and pacman should update and upgrade just fine:

Terminal window
sudo pacman -Syyuu