CLion not picking up WSL

Hello,

my installation of CLion does not seem to pick up WSL.

When I try to configure a WSL toolchain, the first field in the options, which I believe should be the path to the distro executable, is empty. I cannot edit it, the dropdown shows nothing, and the button with the three dots next to it cannot be clicked. Below it, an error message says "not specified".

I believe the issue might be with the fact that I installed the distro outside of the system drive. Yet, the Windows registry contains the right path (in the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{id}\BasePath key). And the path has only ASCII characters. And when I type "bash" in my Windows search bar, the distro WSL console opens without issue. So everything is working. Just CLion is not finding it.

Notwithstanding the fact that CLion does not find the distro, it's even more strange that the path field in the toolchain configuration cannot be edited. So I cannot even manually type the path, which would probably solve the issue.

Furthermore, I tried to manually edit the cpp.toolchains.xml configuration file in {MyUserFolder}\CLion2019.1\config\options , but I didn't have any luck, as I couldn't find any documentation or XML schema for it. So I was basically trying to modify it randomly in order to find out how to manually set the path. But I didn't manage.

So...

1) How can I make CLion pick up my installation of WSL in a custom folder?

2) In alternative, how can I manually edit the toolchain path field? And why cannot I edit it right now?

3) And why is there no documentation at all on the XML configuration files?

Thank you very much for your help.

EDIT:

I'm on Windows 10, 64 bit, version 1903

I'm using CLion 2019.1

10 comments
Comment actions Permalink

Having the exact same problem. Manually overwriting the path in the config file you have mentioned does not help either. When I load Clion the path is set from the .xml file but below I get the message not found. I believe this is a bug.

0
Comment actions Permalink

Hello!

Is your WSL distro installed through the Windows Store?

0
Comment actions Permalink

I'm running into the same problem with ArchWSL. It's sideloaded, but signed off as a Windows App. 

0
Comment actions Permalink

Update: I found a solution: 

In C:\Users\---\.CLion2019.1\config\options\wsl.distributions.xml there are the configuration of the Distros.

Adding 

<descriptor>

<id>ARCH</id>

<microsoft-id>Arch</microsoft-id>

<executable-path>Arch.exe</executable-path>

<presentable-name>Arch</presentable-name>

</descriptor>

has made CLion detect ArchWSL 

0
Comment actions Permalink

Same problem in CLion 2019.2.1.

CLion automatically detects the path which wsl is installed but below I get an error message 'Not Found'.

I'm on Windows 10 Pro Insiders Preview, Build 18956 / Ubuntu 18.04

0
Comment actions Permalink

@Himyuuuu1do you use WSL or WSL v2? Is your WSL distro installed through the Windows Store?

0
Comment actions Permalink

I'm using WSL v2 and I installed my distro through the Windows Store.

Is WSL v2 currently not supported in CLion?

0
Comment actions Permalink

Unfortunately I have the same issue. In YouTrack I could not find a solution.

Here are some information about my environment:

  • My development-PC has a very limited access to the internet. The MS-Store is disabled.
  • I installed WSL this way: https://docs.microsoft.com/de-de/windows/wsl/install-on-server.
    The installation was finished without any trouble.

    The registry key is set:

    [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{ec31ac12-639d-4cf2-b782-7f746f382b33}]
    "State"=dword:00000001
    "DistributionName"="Ubuntu-18.04"
    "Version"=dword:00000002
    "BasePath"="C:\\Development\\WSL\\Ubuntu_x64"
    "Flags"=dword:0000000f
    "DefaultUid"=dword:000003e8
    "KernelCommandLine"="BOOT_IMAGE=/kernel init=/init"
    "DefaultEnvironment"=hex(7): ...
  • Clion:
    • The "credentials" could be set and tested successfully.
    • Only the "Environment" is "Not specified".

Unfortunately I could not find out how CLion determines the environment.
This is my question. Has somebody an answer?


1
Comment actions Permalink

@Manuel At the moment CLion doesn’t allow to choose custom WSL location, it works only with WSL distributions which are installed via the Windows Store. Here is a related issue - https://youtrack.jetbrains.com/issue/CPP-13386. Feel free to comment or upvote the issue in order to get updates. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.

You can try using this workaround: https://youtrack.jetbrains.com/issue/CPP-13386#focus=Comments-27-3156153.0-0. 

0

Please sign in to leave a comment.