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 /norestartEnable ‘Virtual Machine Platform’.
$> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestartInstall 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%\ArchLinuxRun
Arch.exeto extract rootfs and register to WSL.Set Arch Linux as default.
$> wsl --set-default Arch
Setting up Arch Linux
Run
wsleither from shortcut or cmd/powershell.Refresh pacman GPG keys.
$> pacman-key --init $> pacman-key --populate $> pacman-key --refresh-keys $> pacman -Sy archlinux-keyringUpdate packages.
$> pacman -SyuuInstall zsh.
$> pacman -S zshCreate a user and add to
sudoers.$> useradd -m -G wheel,sudo -s /bin/zsh <username> $> passwd <username> $> vim /etc/sudoersConfigure 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:
