Arch Linux is now officially available on WSL. Here's how you can use it with some extra efforts in setting it up post install.
The default Arch Linux installation (both official repo and manual) logs you in as a root user. There is no regular admin user created for your day-to-day usages at this stage. But we will create it ourselves.
If you have already installed Ubuntu in WSL, it prompts you to create a user soon after the installation is finished. Since Arch Linux is a DIY Linux distribution, such convenience should not be expected.
wsl.exe --terminate archlinux
Chances are there that sudo is not installed. If that's the case, you may not be able to access visudo in a later stage to set admin privileges.
To check if sudo is installed, use the command:
pacman -Qs sudo
If sudo is not listed, install sudo using:
pacman -S sudo
In Arch Linux, you can use the useradd command, to create a new user. Let's create a new user called “team”.
useradd -m team
Here, the -m option will automatically create a home directory for the user at /home/.
Set a password for the user “team”, using:
passwd team
Type and retype password to confirm the change.
Once the user is created, add that user to the wheel group so that it can run the sudo command to access some administrative privileges.
usermod -aG wheel team
Locate the line %wheel ALL=(ALL) ALL and uncomment it.
Save the document using CTRL + O and exit using CTRL + X.