Developing "in" Windows Subsystem for Linux

Answered

In Visual Studio Code there is a plugin which allows you to edit projects that live in the WSL filesystem. This is extremely useful for editing projects that were built for a unix-like environment on a Windows machine.

Is there any likelyhood of bringing this sort of functionality to the IntelliJ family of IDEs?

151
45 comments
Avatar
Permanently deleted user

I know there are a bunch of wsl-related issues (including the ones linked to above), but they seem a bit short of what's required. I may add a new YouTrack issue, but I'd like to get a general notion of what's possible given Idea's architecture. No point writing up a ticket for something infeasible.

The VS Code Remote extension for wsl is quite a game-changer for using wsl (especially version 2) for windows. It enables a developer to essentially do everything in linux, just using Windows for the GUI side of things. This is great for a number of reasons - the tooling is fantastic, the ext4 filesystem is much better suited to things like git & npm, etc. I don't even need to have any Windows versions of the developer tools installed at all.

By contrast, with IntelliJ Idea, if I want to have a unix commandline, I usually have to install, configure and maintain 2 of everything (git, sdks, compilers, etc) - one for linux commandline use, and one for IntelliJ to use. And one way or another presents performance problems because of bridging the separate windows & linux filesystems - either I store my source on wsl, in which case IntelliJ's  file access is slow, or on the Windows filesystem, in which case my commandline access is slow.

I know some of the individual language plugins for IntelliJ (python I think?) allow use of sdks on the wsl side in an ad hoc kind of way, but many don't (java notably).

Does the IntelliJ architecture allow something along the  lines of what VS Code is doing here?

53

Jetbrains should be looking at this as a priority!

33
Avatar
Permanently deleted user
15

Any updates on this? Really looking for some plugin for integration with WSL.

7
Avatar
Permanently deleted user

I have come to the conclusion that for my uses the advantages of WSL are so great that it's worth running the Linux version of IntelliJ idea under WSL (using a Windows X Server). The disadvantages seem to be few and fairly trivial so far for me. Pending JetBrains making WSL a first-class citizen for their Windows IDEs (which for all I know may not even be feasible), this seems to be a good option.

6

I am also running the Linux version of IntelliJ Idea, but under the new WSL 2, and it feels as fast as running natively on Linux. Here is a step by step guide on how to set it up:

6

I'm running the Linux Version of Intellij inside of WSL with an Xserver on Windows. It's not ideal but it works well. I'm using x410 as the xServer. I'm more than happy to share my setup with folks.

5

In general I found the XServer solution and running from native Linux Subsystem to work better (PyCharm). The only major problem I encounter regards file updating. It is very slow and when it comes to repository updates it can get quite annoying having to wait 30 seconds to a minute for the update for a simple checkout.  In VS Code there is no such overhead. I believe this should be tackled by the team. 

4
Avatar
Permanently deleted user

I agree with Crispin above, maintaining two of each tool is a real pain; I end up with a lot of setup overhead to avoid some inefficiencies, such as having duplicate maven repositories in both WSL and Windows.  I'd love Windows Intellij to run in the WSL environment.

3

Bradozman see my comment above on how to run in IntelliJ IDEA on WSL2, it works very well and very fast.

3

Yeah this is why most people want to use the WSL file system instead of /mnt most ppl talking about this already use WSL as their terminal in ide etc etc this is a more advanced problem hence why ppl are asking for the ability to edit directly from WSL file system. Currently the only thing you can really do is dual boot or do all your development in a vm or run php storm from Ubuntu via x server.

FYI I also tried WSL v2 from Windows insiders builds and this also comes with its own set of problems as WSL 2 is a vm.

There currently is no way to resolve the incompatible file system issues without something like vs code. Would be nice if they had the file system service as part of WSL instead of vs code. Perhaps we should be pestering Microsoft?

2

We can't support projects inside the wsl atm, because our IDE relies on file system events and P9 does not propagate those to the windows. And our IDE runs on Windows. You can try this and it may work somehow, but most likely you'll get constant re-indexing or other unexpected behavior.

1

I'm just here to also agree with the others. I had my sites running from the wsl filesystem, and I was amazed at how fast they were running; I've never had things like composer run that fast before. However, PHPStorm would NOT work as expected (namely, after it restarted, it couldn't open the .iml file and the directory listing was unusable.)

I moved the files to /mnt/c/soandso, and PHPStorm is working as expected... but any commands run in the container for those files are now taking 2 to 3 times as long.

I'm going to attempt to do what one other user suggested and run PHPStorm from within Ubuntu.

 

1

Andrey Semakin Here is a tutorial getting Gitkraken working in WSL2. It covers the basics of setting up the xserver. From there just download the Jetbrains toolbox app for linux to install whatever ide you need. 

1

I used this guide and it worked perfectly: https://askubuntu.com/a/993331.

1
Avatar
Permanently deleted user

Serge Baranov did you run into https://youtrack.jetbrains.com/issue/IDEA-240600 or do you run a full UI desktop in X Server?

Still surprised that it relies on focus/unfocusing to display file changes, given that file changes are still detected behind the scenes via inotify.

1

Specific support for wsl2 is planned in scope of https://youtrack.jetbrains.com/issue/IDEA-242627 request. Please feel free to vote and track its progress.

1

I've been using the solution of running my IntelliJ IDE in the WSL2 linux environment via a Windows X server but the files don't seem to update when external changes occur within the linux filesystem. I need to do a reload from disk to see any changes and this is essentially unusable for dev.

Does anyone know how to make this functionality work?

1

@Alvin do you run IDE on linux and using it on Windows via the X server? There is known issue, please vote for

https://youtrack.jetbrains.com/issue/IDEA-165228

https://youtrack.jetbrains.com/issue/IDEA-240600

1

T S No I'm still having the same issue. I believe https://youtrack.jetbrains.com/issue/IDEA-240600 covers it but I haven't seen any progress for a while.

1

Alvin thanks for the link, it does seem relevant. Every time I think I have the perfect setup on windows... it only ends up being that I trade one problem for another. 

1

@Crispin Bennett

How did you install phpstorm in wsl?

I have got an Xserver working with ssh to run linux gui's from wsl but I cant install phpstorm without snap.

```sudo snap install phpstorm --classic
Interacting with snapd is not yet supported on Windows Subsystem for Linux.
This command has been left available for documentation purposes only.```

 

 

0
Avatar
Permanently deleted user

Bradozman I didn't use the snap  but downloaded the *.tgz directly from Jetbrains (it was IntelliJ Idea, not PHPStorm, but it's the same notion). I just put it somewhere sensible to run it from. Don't remember where - I'm on bare-metal Linux now, but probably /opt or /usr/local/share.  It worked nicely.

0

Yeah thats what I did but then I still couldn't get it ti run with xming. Was there a guide or anything you followed to get it working?

0
Avatar
Permanently deleted user

I think I had to do a bit of googling around, but IIRC  it didn't involve doing  much more than setting the DISPLAY environment variable, and opening up windows firewall for the x server executable. I'd test basic connectivity with a simple X app first (eg. xeyes). I found x410 the best Windows x server I tried. Even if you're using something else their documentation is quite helpful (https://token2shell.com/howto/x410/).

0

Using VS code now but would much rather use RubyMine for this.  Code lives in WSL 2.

0

Alexandr Evstigneev just voted for the IDEA-197573 issue.  Hope it lands soon.

0

I've tried working on a mounted windows folder but I encountered some weird file system permission problems when I ran npm from a linux terminal in that mounted folder

0

Please sign in to leave a comment.