LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
LinkBack Search this Thread
Old 01-08-2010, 04:07 PM   #1
zugvogel
LQ Newbie
 
Registered: Sep 2005
Location: Tokyo, Japan
Distribution: Mac, Ubuntu, Debian and Centos
Posts: 28

Rep: Reputation: 16
x-windows fails over ssh after a certain amount of time


Hello,
I'm having the following problem with x-windows over ssh:

Using xclock as an example GUI program, if I do "ssh -X 123.456.789.012"
and then
"xclock"
it will bring up a clock.

If I don't run xclock immediately, but wait for 10 minutes or so, xclock fails with this error:
"Invalid MIT-MAGIC-COOKIE-1 keyCan't open display
Failed initializing GUI, exiting"

If I log in and run xclock, then 10 minutes later start a 2nd instance of xclock, the 2nd instance loads fine too. In other words, the 1st instance of xclock seems to be keeping the GUI interface alive.

So I have two questions:
1. How can I keep the GUI interface alive, without needing to run a first instance of xclock?
2. If the GUI interace has died, how can I get it back without logging out and back in again?

I've used xclock as an example, but this applies to any x-windows interface.

Can anyone help? Thanks in advance.
 
Old 01-09-2010, 06:25 PM   #2
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,092
Blog Entries: 2

Rep: Reputation: 109Reputation: 109
you could try running xauth -b

I'm guessing your cookie gets stale
 
Old 01-10-2010, 06:15 PM   #3
zugvogel
LQ Newbie
 
Registered: Sep 2005
Location: Tokyo, Japan
Distribution: Mac, Ubuntu, Debian and Centos
Posts: 28

Original Poster
Rep: Reputation: 16
I tried xauth -b and...

Hi,

Thanks for your reply. I don't quite understand your solution though. I tried as you suggested and got this result:

$ xauth -b
Attempting to break locks on authority file /home/me/.Xauthority
xauth: creating new authority file /home/me/.Xauthority
Using authority file /home/me/.Xauthority
xauth>

And I then have to control-C or type "exit" to end it, neither of which result in the GUI working again. I checked the man-file for xauth, but it doesn't seem to help.

Could you give a little more detail?
Thanks!
 
Old 01-11-2010, 07:15 PM   #4
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,092
Blog Entries: 2

Rep: Reputation: 109Reputation: 109
I'm not sure, I would have thought that you could just

xauth -b generate $DISPLAY .

but that justs gives a can't get security info from X server.
 
Old 01-11-2010, 08:55 PM   #5
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,092
Blog Entries: 2

Rep: Reputation: 109Reputation: 109
you could give this a try, don't know if it'll work, but might reset the timer

xauth list

then remove the entry that matches your current display offset (like 10 or 11)

xauth remove <display>

then add it back in

xauth add <display> . <hexkey>


will look something like this

xauth list
host.domain.com/unix:11 MIT-MAGIC-COOKIE-1 6f4fbb35888f86cf061174bf18a01e40
host.domain.com/unix:10 MIT-MAGIC-COOKIE-1 32d008c133caee35eec323952b5016a8

xauth remove host.domain.com/unix:11

xauth add host.domain.com/unix:11 . 6f4fbb35888f86cf061174bf18a01e40
 
Old 01-11-2010, 09:16 PM   #6
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,092
Blog Entries: 2

Rep: Reputation: 109Reputation: 109
You don't by any chance have something that is changing your display variable? Though you'd think that would cause a problem in either your originally stated cases.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what determines the amount of time to fork? abolishtheun Programming 6 01-30-2009 09:25 PM
Make most amount of Linux users in least amount of time studpenguin General 24 02-02-2007 03:42 PM
Killing a process after x amount of time... virid Linux - Newbie 3 03-17-2006 06:13 AM
Amount of network activity with SSH glsen_az Linux - Networking 2 01-24-2006 02:38 AM
c program that executes during a certain amount of time jagman Programming 6 04-13-2005 09:22 AM


All times are GMT -5. The time now is 07:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration