This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.
- Download WSL2 Kernel
- run
wsl --set-default-version 2
in windows command line, so that all future WSL machine will use WSL2.
- Download ArchWSL installer zip, pick a folder (for example,
c:\archlinux
) for Arch Linux and run installer .exe in that folder.
- Add custom pacman repository with additional packages:
nano /etc/pacman.conf
Then add following to the bottom:
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
- Refresh Pacman GPG keys:
pacman-key --init
pacman-key --populate
pacman-key --refresh-keys
pacman -Sy archlinux-keyring
- Run
pacman -Syyu
to update all packages to the latest versions
- Install zsh:
pacman -S zsh
- Add a sudo group:
groupadd sudo
- Enable sudoers:
nano /etc/sudoers
and uncomment lines%wheel ALL=(ALL) NOPASSWD: ALL
and%sudo ALL=(ALL) ALL
- Add new admin user:
useradd -m -G wheel,sudo -s /bin/zsh <username>
, use-s /bin/bash
if you want bash instead of zsh. - Set password for the new user:
passwd <username>
- Run Windows command shell, go to the directory with Arch Linux, run
Arch.exe config --default-user <username>
. Now you have basic ArchLinux with user.
- Just follow How to Install Yay AUR Helper in Arch Linux and Manjaro guide:
sudo pacman -S git openssh
sudo pacman -S base-devel
- when asked question on fakeroot and fakeroot-tcp choose to leave fakeroot-tcp and not install fakerootgit clone https://aur.archlinux.org/yay-git.git
cd yay-git
makepkg -si
- Run
yay -Syu
to update all AUR packages and reinstall fakeroot-tcp (will install the latest version) - Remove the leftovers:
rm -rf ~/yay-git
- Install useful console tools:
sudo pacman -S mc wget htop pv ccze
Copy .ssh, .kube, .aws from original installation home directory to the Arch WSL2 one.
Fix file permissions for SSH keys, run from the home directory:
chmod 0644 .ssh/id_rsa.pub
chmod 0600 .ssh/id_rsa
sudo pacman -S kubectl kubectx
Uninstall Windows docker to prevent potential naming conflicts.
sudo pacman -S docker docker-compose
Use wsl2-docker-start scripts to run docker exposed to Windows:
git clone [email protected]:imjonos/wsl2-docker-start.git
cd wsl2-docker-start
chmod +x docker-start prepare-hosts
sudo cp docker-start prepare-hosts /usr/local/bin
In Windows you should make sure C:\Windows\System32\drivers\etc\hosts
file has write access for your user.
Always run docker in a dedicated terminal tab using docker-start
git clone https://github.com/ld100/dotfiles.git ~/.dotfiles
zsh ~/.dotfiles/install.sh
sudo pacman -S ruby nodejs python go crystal php jre-openjdk-headless
Main binaries/libraries: sudo pacman -S protobuf protobuf grpc grpc-cli
gRPC for Python and PHP: sudo pacman -S python-grpcio php-grpc
gRPC & Protobuf for Go: yay -S protobuf-go protoc-gen-go-grpc
gRPC & Protobuf for Ruby: gem install google-protobuf grpc grpc-tools
Just run wsl --set-default Arch
in windows command shell.
All WSL machines are available in Windows Explorer on \\wsl$\
URL, Arch linux is: \\wsl$\Arch
.
For additional convenience you could map \\wsl$\Arch
to a 1-Leter Windows disk share, for example having Z:\
pointing to \\wsl$\Arch