SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
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.
So I like to ssh into my linux box at work with something like this:
$ ssh -X user@mylinux
I can login and start any X11 apps on my linux box no problem. But after 15 minutes or so, I come back to a session (ssh is still running and connected) and I get:
$ xterm
xterm Xt error: Can't open display: localhost:12.0
I've tried using -o "TCPKeepAlive yes" or -o "ServerAliveInterval 30", but still get the same behavior.
Is there something in my conf that kills X-forwarding after a period of inactivity?
Then try to ssh on mylinux, and try to launch an xterm, as:
Code:
$ ssh -X user@mylinux "xterm &"
You don't need "&".
Code:
$ ssh -f -X user@mylinux xterm
Last edited by goumba; 03-05-2013 at 06:57 AM.
Reason: Actually has nothing to do with the OPs issue, sorry can't help there; however it was relevant to a following post.
@Ianmb:
Are you sure that it is a time out problem? Timeout means you cannot ssh i.e. ssh connection takes more than specified time, and if it cannot connect, then it will exit.
But in your case, it doesn't seem a timeout pb, but issue with display or xhost +.
It's optional, but good to use, so process can keep running background.
Which is what I'm specifying with -f, and there are advantages to doing so. From the man page:
Code:
-f Requests ssh to go to background just before command execution.
This is useful if ssh is going to ask for passwords or
passphrases, but the user wants it in the background. This
implies -n. The recommended way to start X11 programs at a
remote site is with something like ssh -f host xterm.
If the ExitOnForwardFailure configuration option is set to
``yes'', then a client started with -f will wait for all remote
port forwards to be successfully established before placing
itself in the background.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.