After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 606201 - Problem with sharing keyboard/mouse with x2x
Problem with sharing keyboard/mouse with x2x
Status: RESOLVED NOTGNOME
Product: gdm
Classification: Core
Component: general
2.2.0
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-06 13:28 UTC by Claus
Modified: 2013-12-16 20:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Claus 2010-01-06 13:28:03 UTC
This bug was on launchpad, but they suggested it was moved here.
https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/471726

---------

Original error report:
I've been using x2x under ubuntu 8.10 and 9.04 to share mouse and keyboard between multiple pc's, but it doesn't seem to work in 9.10.

i run on master pc:
ssh -X *USER*@*IP-ADDRESS-SLAVE* x2x -west -to :0

I used to get a password promt and after typing pass, it just worked. Now I get a password promt and an error:

No protocol specified
x2x - error: can not open display :0

---------

Reply:


I found a way to make x2x work, I wouldn't call it a solution but it points to what is missing when you get this error. The xauth authority file used when tunneling X through ssh does not have the cookie for the X server.

Setup:
 - 2 machines, called 'desktop' and 'laptop' where x2x is run on the laptop.
 - Run 'ssh -XC laptop x2x -east -to :0.0' from desktop
 - Error seen: 'x2x - error: can not open display :0'

From the desktop:
# ssh -X laptop 'xauth info'
Authority file: /home/user/.Xauthority
File new: no
File locked: no
Number of entries: 2
Changes honored: yes
Changes made: no
Current input: (argv):1

# ssh -X laptop 'xauth list'
laptop/unix:10 MIT-MAGIC-COOKIE-1 84924c4306f8234702fe1cec2c821c8f

From the laptop:
# xauth info
Authority file: /var/run/gdm/auth-for-user-w9KmhU/database
File new: no
File locked: no
Number of entries: 1
Changes honored: yes
Changes made: no
Current input: (argv):1

# xauth list
laptop/unix:0 MIT-MAGIC-COOKIE-1 007d71f327f9cf279ff3c5fb9d21b5a7

At this point the ssh session from the desktop to the laptop has a cookie for display :10 only. So the message regarding a failure to open :0 isn't a big surprise. I resolved this by running the following from the desktop:

# ssh -X laptop 'xauth merge /var/run/gdm/auth-for-user-w9KmhU/database'

After this is run, you can check that the cookie has been added for :0 by running:

# ssh -X laptop 'xauth list'
laptop/unix:0 MIT-MAGIC-COOKIE-1 007d71f327f9cf279ff3c5fb9d21b5a7
laptop/unix:10 MIT-MAGIC-COOKIE-1 84924c4306f8234702fe1cec2c821c8f

From there I can run:

# ssh -X laptop 'x2x -east -to :0.0'

Here's the caveat, the cookie (and the file it's stored in) for :0 changes each time you log in on the remote machine (in this case, 'laptop'). Here's the output on the laptop after logging out and back into X.

# xauth info
Authority file: /var/run/gdm/auth-for-user-u4JpYD/database
File new: no
File locked: no
Number of entries: 1
Changes honored: yes
Changes made: no
Current input: (argv):1

# xauth list
laptop/unix:0 MIT-MAGIC-COOKIE-1 149afc922a496cae086650e10f113bf5

At this point, the command 'ssh -X laptop x2x -east -to :0.0' will again fail. I cleaned up by running 'ssh -X laptop xauth remove laptop/unix:0' so that I only had a cookie entry for :10 at this point.

I don't have a real solution, but I hope this helps improve the understanding of the problem.
Comment 1 Ray Strode [halfline] 2013-12-16 20:25:44 UTC
this was a problem in the "xauth" utility that's since been fixed upstream i believe.