DEV Community

loading...
Cover image for Why use WSL2 as your dev environment

Why use WSL2 as your dev environment

VyrtualSynthese
French NodeJS Enthusiast, Backend Developer, Devops Geek, Youtuber and Japane Traveler.
・2 min read

As a developer you are offered multiple os to work with. Windows, Mac OSX and Linux. But with virtualization like Docker, VM ware, Linux Dualboot... you can even choose multiple solutions at once.

Doing a lot of Devops work with Docker, Terraform and multiple Linux only CLI tools I needed an environment to setup once that meet all my needs.

Why choose big bad Windows to dev ?

  • Clients choose for me : As a freelance dev in Paris. about half of my clients choose my work OS. For security reasons, history reason, etc ... It is rare that a middle size compagny let me work on linux system.
  • Clients' tools make the choice : Mainly VPN that only works on Windows makes the choice. As I like to work from home whenever I want to, I need Windows only VPN.
  • Projects' tools make the choice : If I need to work on Adobe tools, I need a Windows session.

Best solutions :

Two laptops

Cons : Heavy, need to maintain two dev environments, expensive.

Virtual Box

Cons : Ressource-expensive, buggy, slow.

Docker

Cons : Environment specific bugs, especially with file system.

Cloud Dev (Cloud9)

Cons : Slow, IDE is limited.

A new alternative : WSL2

Windows Subsystem for Linux It lets developers run a GNU/Linux environment -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup.

You can use your favorite GUI tools in Windows, and use all your CLI tools and app inside a linux terminal with almost seamless communication between the two.

Cons :

  • This is still running inside Windows, and sometimes Windows will mess up your WSL2, especially your network.
  • It is still beta-ich tech so you will find limitations and ugly fixes.
  • You need to understand by yourself how to work with WSL2. There is no official recommandations on how you should do it. You have to guess it.
  • Some GUI tools don't support WSL2 very well at the moment.

In my next posts, I will show you how I setup my dev environment in WSL2 as well as some tricks to avoid common bugs, and unexpected behavior.

Discussion (0)