Installing WSL2
Make sure hyper-v is enabled in BIOS.
Open powershell as administrator.
Enable WLS.
$> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Enable ‘Virtual Machine Platform’.
$> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Install an updated Linux kernel.
Set WSL 2 as default.
$> wsl --set-default-version 2
Installing Arch Linux
Download the ArchWSL installer.
Extract files to a directory that you have full access permission too, f.ex
%USERPROFILE%\ArchLinux
Run
Arch.exe
to extract rootfs and register to WSL.Set Arch Linux as default.
$> wsl --set-default Arch
Setting up Arch Linux
Run
wsl
either from shortcut or cmd/powershell.Refresh pacman GPG keys.
$> pacman-key --init $> pacman-key --populate $> pacman-key --refresh-keys $> pacman -Sy archlinux-keyring
Update packages.
$> pacman -Syuu
Install zsh.
$> pacman -S zsh
Create a user and add to
sudoers
.$> useradd -m -G wheel,sudo -s /bin/zsh <username> $> passwd <username> $> vim /etc/sudoers
Configure Arch Linux to start as the new user via cmd/powershell.
Arch.exe config --default-user <username>
Install
yay
.$> sudo pacman -S git openssh base-devel $> git clone https://aur.archlinux.org/yay-get.git $> cd yay-git $> makepkg -si $> yay -Syu $> cd .. $> rm -rf yay-git
References: