IMPORTANT: Do these steps inside the Linux (you might temporarily install Ubuntu WSL)
Download a bootstrap archive:
curl https://ftp.icm.edu.pl/pub/Linux/dist/archlinux/iso/2023.06.01/archlinux-bootstrap-x86_64.tar.gz -o archlinux-bootstrap-x86_64.tar.gz
Extract it:
sudo tar -xzf archlinux-bootstrap-x86_64.tar.gz
CD into the bootstrap directory:
Add root FS to the new archive:
sudo tar -czvf ../ArchWSL.tar.gz .
Copy to the needed directory.
Import the distro with the following command:
wsl --import <desired_distro_name> <path: D:\foo\bar> ArchWSL.tar.gz
wsl -d <desired_distro_name>
Generate mirror list for your country:
Get any enrty from the generated list and put it into the WSL ArchLinux mirrorlist:
Put the first mirror to the ArchLinux mirrorlist:
echo 'Server = http://arch.midov.pl/arch/$repo/os/$arch' >> /etc/pacman.d/mirrorlist
Populate the ArchLinux keyring:
pacman -Sy archlinux-keyring
pacman -S base base-devel fish vim neovim git sudo ccache linux linux-headers linux-firmware
ln -sf /usr/share/zoneinfo/Europe/<YOUR_TIMEZONE_CITY> /etc/localtime
Sync hardware time in UTC
echo rustatian > /etc/hostname
localectl set-locale LANG=en_US.UTF-8
Create the user and password:
Create a user (note: you may use any shell instead of /bin/fish
)
useradd -mg users -G wheel,storage,power -s /bin/fish valery
Set the password for your user
visudo -> uncomment the following line --> %wheel ALL=(ALL) ALL
OPTIONAL: Add to the Defaults section (visudo)
Defaults timestamp_type=global
Defaults timestamp_timeout=15
Install the needed packages (my example):
pacman -S gnome gnome-extra pipewire pipewire-pulse gnome-keyring seahorse docker docker-compose clang llvm lldb gdb lld cmake perf
strace tcpdump lsof iotop xdg-user-dirs xdg-utils ttf-font-awesome
Generate unique machine ID:
Set the default user (/etc/wsl.conf
):
[boot]
systemd=true
[user]
default=valery
Shutdown the WSL and enjoy with ArchLinux: