Can't open GUI from Bash from Windows in remote server via ssh -X
I finally managed to solve the problem. These are the steps:
- Install Xming or any similar X server to Windows 10.
Open up Bash for Windows and configure the display ENV variable by adding it to your
.bashrc
:echo "export DISPLAY=localhost:0.0" >> ~/.bashrc
With Xming running in Window's background, ssh -X the desired remote host and run GUI applications normally.
Related videos on Youtube
DogTag
Currently studying Telecommunications Engineering at UPCT (Universidad Politécnica de Cartagena). Electronics and music lover.
Updated on September 18, 2022Comments
-
DogTag over 1 year
I am trying to open applications with GUI on a remote server from bash for Windows 10. By just inputting "gedit", I get the following error message:
Unable to init server: Could not connect: Connection refused (gedit:2089): Gtk-WARNING **: cannot open display:
I have tried several suggestions in other questions but nothing seems to work. I assume the problem must be in the server, since I am able to open atom on local files in bash for Windows, for example. For reference, the server is running a fresh install of Ubuntu 17.04. I currently have Xming installed and running on my Windows machine.
UPDATE: I have been able to run GUI applications using PuTTy, so the problem is definetely on Bash for Windows.
-
DogTag over 6 yearsI have Xming currently installed and running on Windows. That is the reason why I believe it has something to do with the remote. I will update my question with this detail.
-