Steps to Reproduce:
Host web
HostName 10.10.0.8
User web
````
Launch remote host from the Remote - SSH tab
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.
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:
{
"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.
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
DISPLAYis set tolocalhost:10.0as expected, but running my application givesError: Can't open display: localhost:10.0. The same happens if I runxeyesor 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.