Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I ssh to a server using -X, I am always confused about which display number I should export. It seems to me sometimes the display number has been used by something, so what I can do is only go through:

export DISPLAY=localhost:0 && xclock  
export DISPLAY=localhost:1 && xclock  
export DISPLAY=localhost:2 && xclock  
export DISPLAY=localhost:...

until the clock appears. I will then use that display number. Each time I log into the server, the display number which is able to tunnel the GUI data correctly would be different.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

sshd automatically sets $DISPLAY on the server side when X forwarding is enabled; there should be no reason for you to override its value.

share|improve this answer
    
Thanks! I will have to wait till next week when i can access the server and reply you back! –  insidepower Dec 27 '10 at 9:57
    
It works as you said. Thanks for the answer! –  insidepower Jan 5 '11 at 2:57
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.