DEV Community

Cover image for The definitive guide to Intellij IDEs with WSL2
Benjamin Beganović
Benjamin Beganović

Posted on

The definitive guide to Intellij IDEs with WSL2

Hey everyone 👋

TLDR: Now you can use IntelliJ IDEs installed on Windows & store projects on Linux filesystem without needing to configure anything else & with a full speed advantage 🎉.

Windows Subsystem for Linux is out for quite some time right now & it's finally getting into perfect shape and becoming a perfect tool for most developers.

Note: This is not an intro nor a guide on how to set up and install WSL2!

I've been a huge fan from the start, even with WSL1, but I still kept my dual-boot, mainly cause of performance. It is incomparably better on WSL2 and made me switch full-time to Windows.

However, the main issue from the start was that many development tools didn't support it. However, if you're a Visual Studio Code user you got that first-class support from day one, but with tools like WebStorm, PhpStorm, unfortunately, it wasn't like that.

The first workaround was, store everything on the Windows side & then just open the folder in PhpStorm. However, that caused performance drawbacks. Things are much much faster if you just host & store all of your files under the \wsl$ folder of your distro.

Problem was, if you try to open \wsl$ in the PhpStorm, you'll be presented with this:

phpstorm-warning-about-mounting

When you open the integrated terminal, it will open Powershell not the WSL2 bash terminal of your distro.

Fast forward today, things are much much better. At the moment of writing, the latest version is 2020.03, and things are just working.

Now when you open the \wsl$ folder it will just work.

If we open the terminal, it will automatically register it for us and give us a nice bash!

phpstorm64_OXt0mQ53xt

When you open the settings it configures stuff for you really nicely!

phpstorm64_75JByaJF5w

Now, comes the question, why I wrote this article?

Most of the articles on the web regarding this topic at the moment are out-of-date. Why?

To explain this, let's have a look at two types of articles:

  1. Installing PhpStorm on Windows side & storing projects on the Windows side also and then just using WSL2 as a bash prompt. ❌

Not needed anymore. You can store projects on the \wsl$ & use the full potential and speed of WSL2.

  1. Installing PhpStorm on the Linux side + X server on the Windows side. ❌

Not needed anymore, since #1 works just fine.

.. so to conclude, the definitive guide to using IntelliJ IDEs with WSL2 would be.. just install them & use them because they work out of the box.

Cheers 🎉

Top comments (1)

Collapse
 
apmyp1990 profile image
apmyp1990

Ähm... No!