Why am I using WSL2 as my development environment ?

İbrahim BABAL
3 min readJul 1, 2022

--

Development on Windows sucks

I don’t know how many times I format my computer to change my OS. I’m switching to Linux for a better development experience. But then, when I want to play some games, Linux isn’t a place for doing it. Even tho there is a bunch of tutorials that shows how to do that, I don’t want to spend days for installing a game. It just doesn’t make sense. I even tried dual boot on my ssd but I found myself using only Windows because I’m too lazy to turning off my computer -> opening bios -> switching the OS and then restarting again every single time. It such a waste of time.

The chaotic good

Today we are gonna take both advantages of these two Operating Systems. Gaming on Windows and powerful terminal and development tools of Linux in one place.

WSL 2

Windows Subsystem for Linux lets you use GNU/Linux directly on your Windows machine. Just open a terminal and start using it. There is no need to start a Virtual Machine and wait for it to open (WSL2 has much more performance compared to virtual machines because it runs on Windows natively).

How to setup WSL 2

First open a PowerShell window with admin permissons and run the command below and restart your computer.

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

Then install the WSL with this command.

wsl --install

Now head over to Microsoft Store and download Ubuntu.

When it’s downloaded open it and it will ask you for a username and a password just type it and wait for it to complete installation.

It has to be version two by defult. You can check the version with wsl -l -v . Ones you see a output like this we can move to next step.

VSCode

I’m assuming you have Visual Studio Code installed but if you don’t, I strongly recommend it for you because VSCode can open directly on WSL. So head over to this page and install it. If you have VSCode then go to the Extensions tab and install the Remote-WSL extension.

Ones you done that open Windows Terminal (If you don’t have I’m strongly recommand it. Download it via MicrosoftStore) and open the ubuntu tab

Just create a folder with mkdir foo and open it on VSCode with code ./foo it will automatically install the necessary packages for opening vscode on remote and you have your VSCode on Linux on Windows.

And that’s all. Strong knowledge of Linux is a big plus in the industry. With this setup, you can explore Linux without hesitating.

--

--