diff --git a/archlinuxWSL.md b/archlinuxWSL.md new file mode 100644 index 0000000..7c72557 --- /dev/null +++ b/archlinuxWSL.md @@ -0,0 +1,154 @@ +#### IMPORTANT: Do these steps inside the Linux (or you might temporarily install Ubuntu WSL) + +#### Download a bootstrap archive: + +``` +curl https://mirror.eloteam.tk/archlinux/iso/2023.02.01/archlinux-bootstrap-x86_64.tar.gz -o archlinux-bootstrap-x86_64.tar.gz +``` + +#### Extract it: + +``` +tar -xzf archlinux-bootstrap-x86_64.tar.gz +``` + +#### Add root FS to the new archive: + +``` +tar -czvf ArchWSL.tar.gz . +``` + +#### Copy to the needed directory. + +#### Import the distro with the following command: + +``` +wsl --import ArchWSL.tar.gz +``` + +#### Log in: + +``` +wsl -d +``` + +#### Generate mirror list for your country: + +- https://archlinux.org/mirrorlist/ + +#### Get any enrty from the generated list and put it into the WSL ArchLinux mirrorlist: + + +#### Put the first mirror to the ArchLinux mirrorlist: + +``` +echo echo 'Server = http://arch.midov.pl/arch/$repo/os/$arch' >> /etc/pacman.d/mirrorlist +``` + +#### Populate the ArchLinux keyring: + +``` +pacman-key --init +``` + +``` +pacman-key --populate +``` + +``` +pacman -Sy archlinux-keyring +``` + +#### Install the base system: + +``` +pacman -S base base-devel fish vim neovim git sudo ccache linux linux-headers linux-firmware +``` + +#### Configure the system + +- Configure the timezone +``` +ln -sf /usr/share/zoneinfo/Europe/ /etc/localtime +``` + +- Sync hardware time in UTC +``` +hwclock --systohc --utc +``` + +- Set up the host name +``` +echo rustatian > /etc/hostname +``` + +- Uncomment needed locales +``` +nvim /etc/locale.gen +``` + +- Generate locales +``` +locale-gen +``` + +- Set default locale +``` +localectl set-locale LANG=en_US.UTF-8 +``` + +#### Create the user and password: + +- Set the root password +``` +passwd +``` + +- 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 +``` +passwd valery +``` + + +``` +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: + +``` +systemd-machine-id-setup +``` + +#### Set the default user (`/etc/wsl.conf`): + +``` +[boot] +systemd=true +[user] +default=valery +``` + +#### Shutdown the WSL and enjoy with ArchLinux: + +``` +wsl --shutdown +```