Skip to content

Running Fish Shell in Arch Linux with WSL 2 and the new Windows Terminal.

Last updated on February 25, 2021

Windows Subsystem For Linux

If you haven’t been paying attention to Microsoft and how cozy they have become with Linux, they modified the Linux kernel and put it into Windows 10 as of June 2019. If you don’t understand what a kernel is, all you need to know is you can now run Linux compiled or based programs on Windows. Don’t get ahead of yourselves, this is mainly is for terminal based programs and Systems Administrators. Let’s get Arch Linux running in Microsoft’s new Terminal.

First off, let’s go the new Terminal from the Microsoft store.

You can easily get it here https://www.microsoft.com/en-us/p/windows-terminal-preview

windows-new-terminal

Sweet! We got our spiffy new shell. Go to start, Search terminal, right click and open in Administrator.

Now we want to enable Windows Subsystem for Linux from Powershell.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Installing Arch Linux to Windows

Since Arch Linux doesn’t officially support an Arch distribution for Microsoft’s kernel, we have to resort to the community for this. Shout out to Yuk7 for providing the most stable Arch Distribution but keep in mind there are some modifications to the distribution to make this work.

Go to https://github.com/yuk7/ArchWSL and download the most recent .APPX and .CER files.

In order to install the .APPX file, you must first install .CER to “Trusted Root Certification Authorities” of the local machine. Then you can install the Arch Linux .APPX file. Once it’s down you can search “Arch” at the start menu and click on the arch-linux-yuk7 icon. This will initialize the distribution. Now the fun stuff. Now you can access Arch Linux from the drop down tab in the new Windows Terminal. We now have a linux prompt.

Installing Arch Linux on Windows

Now we have to install the base system with Pacman. Once that is done we can add a non root user.

pacman-key --init
pacman-key --populate archlinux
pacman -S base base-devel git cmake make 
useradd -m -g users -G wheel -s /bin/bash {UserName}
visudo
passwd {UserName}

We really just needed Pacman so we can get the best package manager for Arch Linux, Yay! So let’s clone it from its Git repository and build it with our new user we just created and then clean up the mess.

git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd ..
rm -rf yay

Fish to rule all the shells!

Let’s spruce up our prompt as well with a greeting when we log in.

yay -S fish
chsh -s /usr/bin/fish
curl -L https://get.oh-my.fish | fish
set fish_greeting "this is my cool fish shell"

As I said before, now that we can run Linux programs from Windows, let’s use the Yay package manager to get all the goodies.

yay -S powerline powerline-fonts neofetch tor nyx git go \
ranger tmux dotnet-runtime dotnet-sdk htop w3m mtr aria2 nnn \
dstat atop glances rsync socat iftop nethogs nodejs ruby npm \
siege tsung duplicity fzf exa python2 python2-pip python \
python-pip python2-virtualenv python-virtualenv speedtest-cli \
openssh openvpn gdb cmake googler browsh dstat slurm ngrok unimatrix \
neovim-plug-git nmap macchanger-git arch-audit-git lynis stacer \
timeshift deluge aria2  gftp ntp tmux-bash-completion cht.sh debtap 
kchmviewer vde2 ebtables dnsmasq bridge-utils openbsd-netcat meek 
newsboat xclip neomutt weechat squid neovim 

Blackarch, Really?

Why not! We can go further and setup a full-fledged penetration testing suite by installing Black Arch over our installation.

curl -O https://blackarch.org/strap.sh
sudo ./strap.sh
sudo pacman -S blackman
sudo blackman -a 

Who needs Linux virtual machines anymore?

Some Linux purists lament what Microsoft has done putting the Linux kernel into the Windows ecosystem but there is no denying the Microsoft Developers pulled off quite a feat and there is no question that this is really cool. The way WSL works also requires less resources than a traditional virtual machine environment. To learn more about WSL, check out https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux.

Comments are closed, but trackbacks and pingbacks are open.