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.

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

share|improve this question
add comment

3 Answers

up vote 12 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)

DISPLAY=:1.0

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.

https://help.ubuntu.com/community/FreeNX

share|improve this answer
add comment

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
add comment

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
2  
yes you can run a desktop over ssh. You can use a new X session, Xephyr, or on Windows Xming : sourceforge.net/projects/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. –  rao_555 Jan 6 '12 at 16:54
add comment

Your Answer

 
discard

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.