VS code 在远程登录服务器后无法直接像 pycharm 一样显示远程图像,对分析数据十分不便。本文记录vscode实现远程gui的方法。
由于直接用vscode尝试远程界面显示不易调试(不要问我怎么知道的),先实现脱离vscode,使用shell的远程显示
接下来实现VScode远程调试,实现ssh key免密连接远程服务器
使用VS code 插件 Remote X11 需要在后台开启 Xming Server
文件
-> 首选项
-> 设置
-> remote x11
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: 当前文件",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false,
"env": {
"DISPLAY":"10.0.2.19:0.0"
},
}
]
}
export DISPLAY=本机IP:0.0
xclock