zxCoder's blog

My development environment with WSL2(2021.7)

After struggling for several days, I made a development environment for my new computer, mainly using WSL2.

This is just a short blog to record the final environment settings.

The date now is 2021.7.4, Windows 11 will come soon, and maybe there are some update about WSL. And Jetbrains IDEs may bring some new features to support the developing with WSL better.

CLion WebStorm IDEA

There are no any issue that I installed the IDEs in Windows and using the environments which is in WSL. The only thing to do is to config easily in the IDE, which almost automatically.

And now, I can use the excellent Linux development environment with the Windows IDE UI.

Rider

Unfortunately, there is no method to access dotnet in WSL2 directly.

After considering, I decided to install dotnet sdk in Windows for now. And another way can be seen next in PyCharm part.

PyCharm

I use Python mainly for Artificial Intelligence in my graduate student tasks.

I need to run some models or codes in my local machine. You know, different models or codes might be run in different Python environment. So I need make some isolated/virtual Python environments.

In Linux, I use conda, which it's convenient. But now in Windows, for PyCharm, there are no suitable way to access the virtual environments in WSL. Like this https://youtrack.jetbrains.com/issue/PY-32853.

Finally, I achieved the goal by using Docker. In short, I installed Docker Desktop in Windows first, and configured the WSL2 as backend.

https://docs.docker.com/docker-for-windows/wsl/

Then I can easily access the WSL's Docker in PyCharm. So the final step is to make some Environments/Images in WSL'Docker.

Steps:

#WSL2