Using Windows10 for development - WLS
Once upon a time I use to develop using a windows machine..
After encountering many annoying issues when trying to setup my local dev environment sometimes taking days attempting to resolve proxy and issues with NPM packages that weren’t designed or tested on windows.
I then moved to the darkside after seeing a coworker join the team and within minutes have his environment setup and running.. on a Mac..
Since then I have been using Ubuntu/Mac operating systems
Recently I rebuilt my home desktop and so also upgraded my old windows duel boot windows7/Ubuntu combo to windows10/Ubuntu and since then have hardly booted into ubuntu
The reason?
Windows subsystem for Linux - WLS
This layer allows the running of binary executables natively meaning that you can run a Linux distro.
Installing/Enabling WSL
To enable WSL go to
Control Panel > Programs > Turn Windows features on or off
Then enable tick “Windows Subsystem for Linux”
You then get prompted to restart, once your back up and running head over to the windows store and install the ubuntu “App” Ubuntu
Once installed perform a windows search for “Ubuntu” and select the app A terminal will open and your now in a ubuntu bash shell!
Configure
Now that bash is installed you have to get the most out of it
Installing Zsh
Zsh has a crap ton of nice features ontop of the default bash shell
In the bash command line run
sudo apt-get install zsh
This installs the Z_shell. In order to default to zsh on load edit the users ~/.bashrc
file and add the following lines
if test -t 1; then
exec zsh
fi
Installing Oh-My-Zsh
In order to make the most of zsh you want to use Oh-My-Zsh which is a framework to help manage and install plugins/themes for zsh
To install run
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Once installed check out the wiki to see the available themes and plugins.
One plugin I like is autosuggestion
Using your previous history it suggests possible commands that you may want to run as you type
Installing cmder and configure to use base
Cmder is console emulator because well the default windows one is.. crap
Download the latest release
Press Win + Alt + T to open the tasks menu Create a new task clicking +
Give it the name “bash::ubuntu” Give it an icon “/icon %USERPROFILE%\software\cmder\os_ubuntu_alt.ico” changing the path to whatever image you want
And set the command to run to be %windir%\system32\bash.exe ~ -cur_console:p
Save and press ctrl + t and select your new task
It will now be running the zsh shell.
So far I have only used it lightly however so far it seem’s to be doing the job but only time will tell