Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am new member to the Unix world . I am trying to open xclock but it is getting failed . I have referred the forums solution but is not helping me out .
Please find the steps which i have taken : -
1> Have installed Xming .
2.> While Opening Putty , i have enabled the X11 Forwarding ( Checkbox ticked )
3.> I login to Putty , with my credentials
a.> Set the DISPLAY environment variable ( although it is already set in the .bash_profile .
DISPLAY=localhost:10.0
export DISPLAY
4.> Then launch xclock , but it gives error : Error: Can't open display:
First, remove any definitions for the DISPLAY environment variable from any profile...
The correct value will be set by sshd when the login is successful.
IF there is no DISPLAY environment variable after login, then you are not running the X server on your workstation OR the machine you are logging in on has forwarding disabled (look in /etc/ssh/ssd_config to see if "X11Forwarding" has the value "no". If the line is commented out, then the value shown should be the compiled default, and you have to put a line "X11Forwarding yes" in, and restart the service).
The only time the :10 is valid is:
1. when the sshd_config file specifies an offset of 10(X11DisplayOffset) for the first connection - this is the default, but other values are possible.
2. this is the first connection.
After that the correct value can be 11, 12, 13... And those can occur for several reasons (usually network or client related). If the client system for instance gets rebooted the previous connection may still not have timed out and closed... thus the new connection would get 11.
Next, make sure the sshd_server has "X11UseLocalhost" enabled (otherwise you won't be allowing "localhost:nn" to be a valid display). This the usual value is "yes".
And thd sshd_config was restarted , but still then it is not working .
Upon your suggestion i removed the DISPLAY entry from bash_profile and bashrc , but it is still not working . To be specific can you also specify the profile so that i can cross check .
Are there any other reasons for which it is failing .
configuration of Xming/putty... but I can't help with those.
There is no profile for sshd. It will create the environment variable. When you login you should be able to see the value assigned using "echo $DISPLAY". Your profile/bashrc files will be added. So you you redefine the DISPLAY environment variable it would have to have the SAME value as what was assigned - or it won't work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.