栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

CLion 2021.1 WSL 2报错cannot establish connection的解决方法

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

CLion 2021.1 WSL 2报错cannot establish connection的解决方法

昨天 CLion 2021.1.2 版本连接 WSL 2 用的好好的重启一下电脑以后突然不能用了:

尝试过WSL2 unable to establish connection : CPP-17763 (jetbrains.com)https://youtrack.jetbrains.com/issue/CPP-17763

里 Janne Hamalainen 的解决方法,但是没有用。根据Cannot establish connection : CPP-22590 (jetbrains.com)https://youtrack.jetbrains.com/issue/CPP-22590

里 Maxim Banaev 的提示尝试在 WSL Ubuntu 中执行

ssh localhost -p 2222

重启了 SSH 服务:

sudo service ssh restart

检查 SSH 和 SSHD 是否已启动:

ps -e | grep ssh

检查 /etc/ssh/sshd_config:

vim /etc/ssh/sshd_config

 删掉 ~/.ssh/known_hosts 里过期的 host:

vim ~/.ssh/known_hosts

成功连接 localhost:2222:

 但是 CLion 仍无法连接。根据同样是该条 track 下 Vasily Romanikhin 的解答:

starting CLion 2021.2 there is no need to work with WSL distribution via ssh, ATM we are using dedicated API to run WSL processes.
So feel free to update to the latest version. I will close the ticket as obsolete.

查看WSL | CLion (jetbrains.com)https://www.jetbrains.com/help/clion/how-to-use-wsl-development-environment-in-product.html 也发现内容做了更新:

 通过 JetBrains Toolbox 将 CLion 升级到最新的 2021.2.2 版本,重启 CLion,成功连接:

可以发现 Environment 与 CMake 之间原本有的 Credentials 一栏已经消失。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/297090.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号