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?

Christian Wilkie
  • 3,693
  • 5
  • 34
  • 49
  • Were you able to resolve this issue? Seeing this currently with Windows 10 16299, CLion 2019.3.2, and WSL v1 Ubuntu 18.04 – Maspe36 Dec 19 '19 at 21:58
  • 1
    @Maspe36 sadly nope :[ I ended up dual booting Ubuntu and doing my development there.. probably not too helpful unfortunately – Christian Wilkie Dec 20 '19 at 20:16
  • Unfortunate, but thanks for tying up the loose end! – Maspe36 Dec 21 '19 at 21:13
  • 1
    I had a coworker update my laptop and now my WSL doesn't work either – Kevin S Feb 12 '20 at 19:23
  • 1
    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. – JΛYDΞV Aug 28 '21 at 13:40
  • You should connect not localhost in CLion, but your actual WSL IP (`hostname -I`) – Александр М Oct 06 '21 at 08:49

1 Answers1

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