【问题标题】:How to enable x11 forwarding in vscode integrated terminal?vscode集成终端如何开启x11转发?
【发布时间】:2020-09-27 08:53:12
【问题描述】:

X11 转发在 ubuntu 的终端中工作正常。但是如果我尝试在我的 VSCode 终端中从远程运行任何 GUI,它会显示 : cannot connect to X server。

有什么建议吗?

【问题讨论】:

    标签: qt visual-studio-code x11 vscode-remote x11-forwarding


    【解决方案1】:

    我找到了使用菜单栏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"
                },
            }
        ]
    }
    

    【讨论】:

    猜你喜欢
    • 2021-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-01
    • 1970-01-01
    • 2021-04-30
    • 2019-10-30
    • 1970-01-01
    相关资源
    最近更新 更多