Vscode-remote-release: Remote SSH integrated terminal doesn't forward x11

Created on 6 Jun 2019  路  5Comments  路  Source: microsoft/vscode-remote-release


  • VSCode Version: 1.35.0
  • OS Version: Ubuntu 18.04.2 LTS x86_64

Steps to Reproduce:

  1. Set "ForwardX11 yes" inside ~/.ssh/config
    ```
    Host *
    ForwardAgent yes
    ForwardX11 yes
    ForwardX11Trusted yes

Host web
HostName 10.10.0.8
User web
````

  1. Launch remote host from the Remote - SSH tab

  2. Try to open any GUI like evince, eog or grads


Does this issue occur when all extensions are disabled?: Yes

I tried code-insiders and the issue persists.
I usually mount the remote directory to a local folder and then launch ssh -X [email protected] inside VSC integrated terminal. I want to change my workflow now that remote development is integrated into VSC but can't due to this issue.

feature-request ssh

Most helpful comment

I'm running VSC on MacOS and connecting to a Linux VM, where I'm working on Python 3 code that displays the result of various calculations with MatPlotLib. When VSC first connects to the VM, I can look in the VSC terminal and see that DISPLAY is set to localhost:10.0 as expected, but running my application gives Error: Can't open display: localhost:10.0. The same happens if I run xeyes or similar from the terminal.

Oddly, if I launch a MacOS terminal and ssh to the VM, graphical commands from VSC work as expected. Not sure why this should change things, but it does.

All 5 comments

I think this doesn't work for the same reason ForwardAgent https://github.com/microsoft/vscode-remote-release/issues/16. We have to fix up the remote environment with the DISPLAY variable.

I'm running VSC on MacOS and connecting to a Linux VM, where I'm working on Python 3 code that displays the result of various calculations with MatPlotLib. When VSC first connects to the VM, I can look in the VSC terminal and see that DISPLAY is set to localhost:10.0 as expected, but running my application gives Error: Can't open display: localhost:10.0. The same happens if I run xeyes or similar from the terminal.

Oddly, if I launch a MacOS terminal and ssh to the VM, graphical commands from VSC work as expected. Not sure why this should change things, but it does.

What's more annoying? It _USED_ to do this for the most part on my setup. Now it's just broken.

I got it to work in Windows client with the following steps:

  1. Setting environment variable DISPLAY=localhost:10.0
  2. Launching the local XServer as "C:Program Files (x86)XmingXming.exe" :10 -clipboard -multiwindow
  3. Setting your ssh_config with
    Host *
    ForwardAgent yes
    ForwardX11 yes
    ForwardX11Trusted yes
  4. Adding env to my .vscode/launch.json configuration:
    {
            "name": "Launch MyProgram",
            "type": "lldb",
            "program": "${workspaceFolder}/install/myProgram",
            "request": "launch",
            "env": {
                "DISPLAY": "localhost:10.0"
            },
    }

@dpar39 is spot on here. Been struggling with this for a long while and I can confirm this works.

Remote X11 (SSH) extension should add the env variable configuration to the settings.json automatically and tell the user to input their display number in the settings panel based on whatever they set in Xming.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abdullahiabdirahman picture abdullahiabdirahman  路  3Comments

gulshan picture gulshan  路  3Comments

grzegorz-silarski picture grzegorz-silarski  路  3Comments

gurdevrana picture gurdevrana  路  3Comments

6XAM picture 6XAM  路  3Comments