Christian Wilkie
Christian Wilkie

Reputation: 3823

CLion 2019.2.1 toolchain: WSL not found

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?

Upvotes: 3

Views: 1148

Answers (1)

Александр М
Александр М

Reputation: 278

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

Upvotes: 0

Related Questions