Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using ubuntu 12.04, and I am trying to ssh to log into a remote server which is also running ubuntu 12.04.

I am using "ssh -X ". I can log into the remote server smoothly, but cannot use the visual/graphical mode to open an application with GUI.

I think the problem lies in this server itself. Because I can use "ssh -X" to run GUI when connecting to another remote server. But I am not sure how to configure it to make it work.

echo $DISPLAY returns blank. Using grep X11 on /etc/ssh/sshd_config file returns:

➜ ~ cat /etc/ssh/sshd_config | grep X11
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no

I have read the following posts, but the problem is still unsolved, gedit "cannot open display" , on remote computer , using ssh - Ubuntu 12.04
Problem with X can not open display while ssh from ubuntu 13.04 to centos servers

Hope to get help from you. Thank you very much!

share|improve this question
I have found this post: Run application on local machine and show GUI on remote display –  Letizia Jun 16 at 19:03
Can you show an example error message you get when trying to run your application GUI after logging in? Does your environment have a DISPLAY variable, what does echo $DISPLAY show on your server login? Do you have root on the server, are you able to look into and/or edit the /etc/ssh/sshd_config file on the server? –  mtmiller Jun 16 at 21:40
@mtmiller echo $DISPLAY shows nothing on the server machine. I can look into /etc/ssh/sshd_config file on the server, I can also ask for a root permission from my boss. –  user2728388 Jun 17 at 2:51
@mtmiller Here is an example of running GUI after logging in. I am trying to open a text file using gnome-open, the default editor is gedit. It shows the following ERROR: (gnome-open:24569): GConf-WARNING : Client failed to connect to the D-BUS daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 GConf Error: No D-BUS daemon running (gedit:24572): WARNING: Command line `dbus-launch --autolaunch=d351af25c7aa104bf2c6af1600000007 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed. Cannot open display –  user2728388 Jun 17 at 2:56
@Letizia, Thanks for providing this useful link. I think ssh are installed both on the server and my local machine, and I do use "ssh -X usrname@serverIP". But I am unable to open any GUI remotely. For instance, if I type in "firefox" after logging in the server, it simply shows: Error: no display specified. I have read the link you shared, but echo $DISPLAY shows nothing for me. –  user2728388 Jun 17 at 3:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.