Ubuntu: Unable to run applications with GUI through x11 forwarding


I have Ubuntu server 14.04 on which i want to run applications with GUI. I have Xauth installed and i have edited the files ssh_config and sshd_config to allow X11 forwarding. On my PC I have Windows 7 OS and I am using Cygwin to connect to the server. I am using this command to connect: ssh -X -i private-key.pem ubuntu@xx.xx.xx.xx

But when I try to run some application with GUI, for example Leafpad, I get error: leafpad: Cannot open display

Also, if I run the command xrandr I get the same error: Can't open display

Any idea why I am getting these error messages?


With your server properly configured, and with X11 server installed on your Windows.

You might need to run export DISPLAY=YOUR_IP:0 on it after connected to the server. The "YOUR_IP" should be change into the IP address of your Windows.

Or, you can try to run startxwin in you Cygwin shell before connect to the server, which will brings up a xterm window for graphical stuff. It will complete the DIPSLAY setting for you automatically, and you should be able to run graphical applications.

You can test the result with xlogo command.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »