CLion 2019.2.1 toolchain: WSL not found
Asked Answered
P

1

3

I installed Ubuntu through the Windows store and then followed the Jetbrains CLion/WSL setup guide here: https://www.jetbrains.com/help/clion/how-to-use-wsl-development-environment-in-clion.html

However after following that guide I was still an error in CLion saying "WSL not found"

Toolchains page WSL error message in Debug panel

I tried restarting CLion but that didn't fix it.

I verified WSL works fine on my PC:

using WSL in command prompt

CLion version information:

CLion 2019.2.1
Build #CL-192.6262.62, built on August 21, 2019
Runtime version: 11.0.3+12-b304.39 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1987M
Cores: 8
Registry: run.processes.with.pty=TRUE
Non-Bundled Plugins: 

Windows version: Microsoft Windows [Version 10.0.16299.1331]

I found this related question but unfortunately repair/reset didn't work for me CLION: WSL not found, ssh connected?

Pinette answered 29/8, 2019 at 18:15 Comment(6)
Were you able to resolve this issue? Seeing this currently with Windows 10 16299, CLion 2019.3.2, and WSL v1 Ubuntu 18.04Pangenesis
@Pangenesis sadly nope :[ I ended up dual booting Ubuntu and doing my development there.. probably not too helpful unfortunatelyPinette
Unfortunate, but thanks for tying up the loose end!Pangenesis
I had a coworker update my laptop and now my WSL doesn't work eitherHussy
In his case, WSL works fine, its CLion that is not detecting it. I have Access to the whole JetBrains suite as I am a part time student, and I have played with Visual Studio CLion & V.S. Code. Personally, I find that CLion is the best IDE for developing a project. But honestly, for an environment, for the actual code writing process, V.S. Code has the best tooling hands down. And its portable, and WSL & V.S. Code are developed by the same company so they work seemlessly.Sacerdotal
You should connect not localhost in CLion, but your actual WSL IP (hostname -I)Ideogram
R
0

All you need is to delete deprecated option from /etc/ssh/sshd_config, change ListenAddress to 0.0.0.0, learn your WSL IP (hostname -I) and change localhost to it in CLion toolchain config.

For this you need to:

  1. Open WSL terminal
  2. su
  3. Enter windows user password
  4. nano /etc/ssh/sshd_config
  5. Scroll to the bottom
  6. Delete line 126 (those deprecated)
  7. Change ListenAddress 127.0.0.1 to ListenAddress 0.0.0.0
  8. ctrl+o, cntrl+x
  9. service ssh restart
  10. hostname -I
  11. Copy IP
  12. In CLion > Settings > Buil & Debug > toolchains > WSL change localhost to copied IP

Note that this IP usually changes after reload. Use this tool to fight it https://github.com/shayne/go-wsl2-host

Runt answered 4/10, 2021 at 13:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.