【发布时间】:2020-09-27 08:53:12
【问题描述】:
X11 转发在 ubuntu 的终端中工作正常。但是如果我尝试在我的 VSCode 终端中从远程运行任何 GUI,它会显示 : cannot connect to X server。
有什么建议吗?
【问题讨论】:
标签: qt visual-studio-code x11 vscode-remote x11-forwarding
X11 转发在 ubuntu 的终端中工作正常。但是如果我尝试在我的 VSCode 终端中从远程运行任何 GUI,它会显示 : cannot connect to X server。
有什么建议吗?
【问题讨论】:
标签: qt visual-studio-code x11 vscode-remote x11-forwarding
我找到了使用菜单栏run 和run without debugging 选项的解决方案。
只是我们需要配置launch.json文件并使用这个命令ssh -Y -i ~/.ssh/Key.pem username@server从客户端电脑打开一个终端。
在我的情况下,launch.json 看起来像这样:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"args": ["--target", "dataset", "--output", "dataset_softmax", "--nChannel", "32", "--minLabels", "8", "--filetype", "png"],
"console": "integratedTerminal",
"env": {
"DISPLAY": "localhost:10.0"
},
}
]
}
【讨论】: