Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to open the desktop display from terminal(ssh login)?

share|improve this question
up vote 15 down vote accepted

You can use the -X option to forward graphical applications. People typically forward single applications or the taskbar or panel rather then the entire desktop. For applications such as Firefox people typically "tunnel".

ssh -X user@server

Then you can

startkde &

To use Xephyr :

sudo apt-get install xserver-xephyr

Start a Xephyr session

# change "1280x1024" to the size you desire
Xephyr -ac -screen 1280x1024 -br -reset -terminate 2> /dev/null :1 &

Set your $DISPLAY (assuming Xephyr is on :1)


ssh in to your server and start kde

ssh -XfC -c blowfish user@server startkde
  • -X = forward X
  • -f = puts your ssh session into the background
  • -C = use compression -c blowfish = use blowfish (I am told this is the fastest)

If you are using ssh, be sure to understand the security risk, and I personally advise you use keys and disable password authentication.

If you want an entire desktop I would suggest FreeNX. FreeNX is both fast and secure.

share|improve this answer

If you're just talking about running a graphical application from the terminal, you can specify the DISPLAY environment value like so:

DISPLAY=:0 gcalctool

Or if you want it to persist you can export it to remain part of your bash session:

export DISPLAY=:0
share|improve this answer
Looks like the only works when the display is opened by the same user who is running this command. Can it be done w/o su to the user who is logged into the display? – Andy Nov 4 '13 at 3:23

You cannot run Desktop display or GUI from ssh. if you want to see the Desktop or GUI, i would suggest to use rdp or Remote Desktop application in ubuntu.

share|improve this answer
yes you can run a desktop over ssh. You can use a new X session, Xephyr, or on Windows Xming : . Also take care with VNC, it is insecure and one of the most common cracks. IMO, you should look at tunneling VNC over ssh or a tool such as FreeNX. FreeNX is both fast and secure. – bodhi.zazen Jan 6 '12 at 16:52
thanks @bodhi.zazen, I really didnt knew that. – Rajesh Pantula Jan 6 '12 at 16:54

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.