问题
描述:连接不上去 反复选择platform 反复输入密码,间或出现could not establish connection to xhr failed问题。
解决:(不知道是具体是哪个步骤解决的 so 以下都是)
- 打开VScode的 view → palette然后点击Kill VS Code Server on Host
- 使用moba连接上远程后删除~/.vscode-server directory 和 ~/.vscode-remote-containers 文件夹 (我没有后一个文件夹,第一个文件夹 后面会重新生成)
- 点击VSCode面板上的扩展按钮,查看已安装的扩展,并找到Remote-SSH,点击它右边对应的齿轮形按钮,选择扩展设置,在settings.json中编辑",并单击打开,会自动打开settings.json文件,在其中查找是否包含该配置:"remote.SSH.useLocalServer": true, 如果没有或者值不为false,则添加并改成true。 (我没有这个,直接在json文件最后添加)
- 使用moba删除vscode server锁 (我之前看到一个这个 后面又没有这个文件了)
~/.vscode-server/bin/b45a160d630530476218b85db95b0fd2a8cd1230/vscode-remote-lock.counsellor.b45a160d630530476218b85db95b0fd2a8cd1230
- 下载vscode-server-linux-x64.tar.gz commit:xxxxxxxxxxx/server-linux-x64 id要修改)
https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable
-
moba将压缩包上传到该文件夹下 ,并进行解压
/home/AAA/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/
tar -xvxf vscode-server-linux-x64.tar.gz --strip 1
(原本该文件夹下没有上述压缩包,且vscode-server.tar.gz文件的size为0)
-
期间还出现了一个Failed to find a non-Windows SSH installed.Password prompts may not be displayed proper问题 (忘了是哪个步骤之后出现的)
禁用 remote.SSH.useLocalServer 即可
打开 **文件->首选项->设置"如图,取消勾选,重新加载窗口即可
参考
1. https://blog.csdn.net/qq_27727147/article/details/104814170
2. https://blog.csdn.net/counsellor/article/details/128805710?spm=1001.2014.3001.5506