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?

45 comments
Comment actions Permalink

Ron A Williams D Tsimpoukis is there a tutorial to setup IntelliJ into wsl and see its GUI in Windows? I find it tricky.

0
Comment actions Permalink

Anything new on this?

The wsl file system is a lot easier to access now and runs faster and PHPStorm works great opening the folder of the new wsl2 file system, however, it cant watch files now because it's a network mount?

I guess technically it is but it will probably be a lot faster now. Just wondering if anything has changed in how people tackle this?

0
Comment actions Permalink

Still a number of issues with it, nothing useful works except git which is pretty much the only thing I don't care about as I use git via cli and have it hooked up to windows credential manager anyway.


I tried using via vcxsrv but that doesn't work since I moved to wsl2. IDE freezes entirely when I open my project. I can open a small project with a few files but not my big ones.

So still no viable option yet other than working inside a VM.

Would be nice if since it detects WSL and uses git command that it also just used wsl for ALL commands, can't see why not. 😫 We'll get there eventually I guess. I'm too deep into phpstorm now to try switching to vscode so Ima hang in there and hope they pull through.

If anyone has any ideas why running ubuntu version via x11 would freeze on large project let me know.

0
Comment actions Permalink

Marco Lackovic yeah I already have that working but the application freezes when it attempts to open my large project. Might be due to the sheer size and number of files maybe?

0
Comment actions Permalink

Hi Marco Lackovic I followed the Run a Linux GUI application in WSL 2 link, however when I run phpstorm.sh in WSL 2 I get:

"Can't connect to X11 window server using '192.168.16.1:0' as the value of the DISPLAY variable."

...even though I do have XLaunch running on the Windows side.

I did install phpstorm directly from jetbrains download though, rather than following the snap / genie approach used in the link, so do you think that might account for the problem?

0
Comment actions Permalink

Bradozman yes, it could be your machine can't handle that project size. My projects are definitely much smaller and I am using an Intel Core i7 @ 1.90GHz, 32 GB of RAM, an Intel UHD Graphics 620 with an NVMe SSD.

 

Andy Ingham I had IntelliJ IDEA working on my machine in WSL2 both with the direct download and snap/genie approach. Your problem sounds more like firewall related: make sure you have followed the firewall settings step (step 3) in that guide you followed.

0
Comment actions Permalink

Marco Lackovic no it's def not my computer. Only happens in wslv2 via vcxsrv. Didn't have this problem on wsl1, Linux VMs, windows, or even on a computer from 10 years ago. I work on this project full time just crashes trying to open from ubuntu in wsl2 🤷‍♂️. I basically haven't bothered trying to figure it out, just using windows phpstorm and working with limited/broken features for now.

0
Comment actions Permalink

Marco Lackovic

SO the issues I had running via vcxsrv before wasn't actually the project size.

It's happening for any project with a readme file in it and is apparently an open gl error.

`libGL error: failed to load driver: swrast` 

Any time I try opening a project with a readme.md file I get this error in the terminal output and PHP storm freezes.

If anyone has any ideas please let me know.

0
Comment actions Permalink

@Bradley Hayes the hang may be caused by https://youtrack.jetbrains.com/issue/IDEA-247244 The workaround is to disable Markdown bundled plugin.

>`libGL error: failed to load driver: swrast` 

Similar errors were reported in

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

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

Please try also https://github.com/openai/gym/issues/509#issuecomment-282331680 to fix them.

0
Comment actions Permalink

Andrey Dernov I couldn't resolve the display driver issues however disabling the MD plugin bundles with PhpStorm prevents it from trying to use open gl and hence prevents the crashes. Just needed to open a project with no readme file first and go uninstall the plugin.

0
Comment actions Permalink

Alvin any luck with your issue? I have same problemo.

0
Comment actions Permalink

I'm using the current Windows EAP build and the file system performance on WSL file system does seem better now. It detects WSL php interpreter and git too but there are still issues with integrating third-party command-line tools into inspections. 

0
Comment actions Permalink

I was able to successfully run linux native Intellj IDE using

You don't have to use the jetbrain-toolbox as demonstrated in this post

Simply run from within the WSL shell

idea.sh

and the application UI will pop as native windows application

0
Comment actions Permalink

1) In the linux subsystem, do:

cd /mnt/c/Users/<username>/Projects/
git clone git@github.com:<username>/<project>.git
explorer.exe .

2) In the file explorer, double click/open the project

 

----

 

Also consider configuring the IDE to use the linux terminal (instead of windows):

Settings > Tools > Terminal > Shell path

"C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\ubuntu.exe" run

 

source: https://stackoverflow.com/questions/51912772/how-to-use-wsl-as-default-terminal-in-webstorm-or-any-other-jetbrains-products

-2

Please sign in to leave a comment.