These instructions will not allow you to install from PKGBUILD
files. makepkg
will not build packages on Arch WSL without a custom compiled fakeroot
.
The kernel in WSL does not support sysv, so you would need to build a copy of fakeroot-tcp
from source, then install it.
Basic instructions are included in the file fakeroot.md
.
-
Install the
Windows Subsystem for Linux
. Open PowerShell and enter:Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
-
Reboot, when prompted.
-
Open Windows Command Prompt.
cmd
-
Uninstall any existing installs.
lxrun /uninstall /full /y
-
Install Ubuntu base.
lxrun /install /y
-
Enter root bash.
bash ~
-
Get the Arch Linux bootstrap (latest version at time of writing).
wget https://mirrors.kernel.org/archlinux/iso/latest/archlinux-bootstrap-2018.04.01-x86_64.tar.gz
-
Extract the image.
tar -zxvf archlinux-bootstrap-2018.04.01-x86_64.tar.gz
-
Uncomment some servers in the pacman mirrorlist.
vim ~/root.x86_64/etc/pacman.d/mirrorlist
-
Update name servers (swap IP's for preferred DNS).
echo "nameserver 8.8.8.8" >> ~/root.x86_64/etc/resolv.conf
echo "nameserver 8.8.4.4" >> ~/root.x86_64/etc/resolv.conf
-
Exit bash.
exit
-
Go to
lxss
directory and renamerootfs
directory.%LOCALAPPDATA%\lxss\
and rename directoryrootfs
torootfs_old
-
Now, go here and and rename extracted Arch
root.x86_64
.%LOCALAPPDATA%\lxss\root\
and rename directoryroot.x86_64
torootfs
-
Move (cut), do not copy directory (if you copy, it will break symlinks).
%LOCALAPPDATA%\lxss\root\rootfs
to%LOCALAPPDATA%\lxss\rootfs
-
Enter bash.
bash ~
-
Initialize Arch keyring.
pacman-key --init
pacman-key --populate archlinux
-
Install base.
pacman -Syyu base base-devel git vim wget reflector
-
Enable
multilib
(if you want).linenumber=$(grep -nr "\\#\\[multilib\\]" /etc/pacman.conf | gawk '{print $1}' FS=":")
sed -i "${linenumber}s:.*:[multilib]:" /etc/pacman.conf
linenumber=$((linenumber+1))
sed -i "${linenumber}s:.*:Include = /etc/pacman.d/mirrorlist:" /etc/pacman.conf
-
Sync package databases.
pacman -Syy
-
Update mirror list (replace United States with preferred repo mirror country).
reflector --country "United States" --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
-
Set
root
user password.passwd
-
Create new user.
useradd -m -G wheel username
-
Set password on user.
passwd username
-
Enable
wheel
group.sed -i '/%wheel ALL=(ALL) ALL/c\%wheel ALL=(ALL) ALL' /etc/sudoers
-
Edit Arch locale and regenerate.
sed -i 's:#en_US.UTF-8 UTF-8:en_US.UTF-8 UTF-8:g' /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 >> /etc/locale.conf
echo LANGUAGE=en_US.UTF-8 >> /etc/locale.conf
echo LC_ALL=en_US.UTF-8 >> /etc/locale.conf
-
Exit bash.
exit
-
In Command Prompt, set default user for linux subsystem.
lxrun /setdefaultuser username
-
On next enter, you should login as your newly created user.
bash ~
-
Replace
bash.ico
in%LOCALAPPDATA%\lxss\
with preferred Arch icon. Be sure to namebash.ico
.
Install Yay AUR Helper and Pacman Wrapper (https://github.com/Jguer/yay)
-
You will first need to rebuild
fakeroot
following the instructions here -
Create a directory for the yay PKGBUILD files and enter it.
mkdir ~/yay
cd ~/yay
-
Download yay PKGBUILD from AUR.
wget --no-check-certificate https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=yay --output-document=./PKGBUILD
-
Run
makepkg
to build and install yay.makepkg -si
-
Download wsl-terminal.
-
Extract folder and launch
wsl-terminal
. -
Enter home directory.
cd ~
-
Right-click the title bar, select
Options
then select your theme from theLooks
section. -
Install
zsh
.sudo pacman -S zsh
-
Install
oh-my-zsh
.sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
Note: This will install
oh-my-zsh
and setzsh
to be the logged in users default shell, but since WSL launches bash, you will need to add the linebash -c zsh
to your~/.bashrc
file. -
Configure your
zsh
theme.vim ~/.zshrc
ZSH_THEME="agnoster"
(This is my preferred theme) -
Download and install fonts for Powerline. Download here.
-
Right-click the title bar, select
Options
, then select your installed font from theText
section.
-
Download and install Xming, and X11 display server for Windows.
-
Install an xorg app for testing (We will use the Xorg Calculator).
sudo pacman -S xorg-xcalc
-
Export output to display.
export DISPLAY=:0
Note: If you add this line to your
.bashrc
or.zshrc
you won't need to type it again on the next WSL launch. -
Launch
xcalc
to test.xcalc
-
If Xming is working properly, Xorg Calculator should popup as a new window.