
WSL 2 == Microsoft's love for Linux
Development on Linux
I switched to Linux last year and shifted my development completely to the Linux ecosystem. Tried out arch, Manjaro, Pop OS!, Ubuntu, MX Linux. Development is really productive with a Linux environment.
Gaming on Windows
A few months back I upgraded my potato to a gaming laptop which of course came with Windows pre-installed, I also started gaming. I ended up doing dual boot to run Ubuntu as my daily driver for development, but this eventually meant a redundant set of tools on Windows as well.
Windows 馃挅 Linux
Windows released the Windows Subsystem for Linux 2 in May 2019. WSL 1 was a compatibility layer for running Linux binary executables on Windows. WSL2 built on top is built on the core technology of Hyper-V to provide better support and improved performance running a Linux kernel.
Why WSL 2 instead of native Windows
Most production environments run on Linux and with WSL 2 environment the tooling available on development become the same as in production. Also WSL 2 is super easy to set up and get started with.
Set up WSL 2 on Windows
Open an elevated Powershell (Run as administrator) from the start menu and use the following commands to get WSL 2 up and running.
(Note that: WSL 2 is only available in Windows 10, Version 1903, Build 18362 or higher)
Step 1 - Enable the Windows Subsystem for Linux
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Step 2 - Enable the Virtual Machine feature
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
You need to restart your PC after this step.
Step 3 - Download & install the Linux kernel update package
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

Step 4 - As a final step set WSL 2 as your default version
wsl --set-default-version 2

Now you can install your favourite Linux distro from the Microsoft Store. After the installation completes you'll need to restart and complete the setup of your Distro.
Enter the username and password for root user and you are good to go.

Set your default Linux distro for WSL 2.
wsl --set-version <distribution name> <versionNumber>

馃帀馃帀馃帀That's it you have successfully set up WSL 2 and can now begin your journey to become a 10x Developer.
Feel free to reach out to me on Twitter @cryptus_neoxys and connect with me on LinkedIn.
Refs & Resources
If you loved the article and would like to support me, you can buy me a coffee.
About the author
I'm a web developer and a college sophomore, currently focused on JAMStack and building scalable applications.
Comments
Join the discussionHow does it works beyond the last point? I mean, I need a separate shell to access Linux tooling or can I call them directly from the Windows terminal?
I currently use Linux at work and Windows at home. I was toying with the idea to switch to Linux one more time (if Windows 11 fails to impress me, at least) because my workflow works better with its tools, but I'm 100% sure I'll miss playing my games at some point and I have absolutely no time/patience/desire to dive deep into gaming on Linux for now (even though I'm trying to learn better how to game on Linux, I won't be installing Linux on my computer anytime soon just for that).
I've ignored WSL for far too long, but ever since WSL2 launched, I'm only seeing people talking good things about it. This seems like the best of both worlds for me.
yep, you have to access all of the Linux tooling (and even GUI apps now) via the WSL shell.
If you do decide to make the switch, from my experience (mostly JS, some toying with GOLang) I can definitely say WSL2 won't disappoint.
Makes me wanna switch
Worth a try xD
Nice tutorial.
Thank you Aniket, glad you liked it.
Tools and DX
In this series we will look into the plethora of tools and extension like IDE, Browser extensions, packages and entire ecosystems that make your experience more enjoyable as a developer.





