You are not logged in.

#1 2008-11-07 22:00:25

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

[Trick] Use Keyboard + Mouse from Xorg to control another Xorg session

So you have two computers sitting together,  you don't have a kvm switch, and using two keyboards and mice is just plan annoying!

X2X is the solution. This program allows you to use your mouse and keyboard from Computer A on Computer B.

From the man page

x2x  allows the keyboard and mouse on one ("from") X display to be used to control another ("to") X display.

How to make it work?
Allow TCP from xorg on both systems
Edit /etc/X11/xinit/xserverrc and change

exec /usr/bin/X -nolisten tcp

to

exec /usr/bin/X

Computer A = computer that has the keyboard and mouse you want to use
Computer B = computer that does not have the keyboard and mouse you want to use hooked up to it

On Computer B run the command

xhost +ComputerA

Where ComputerA is the hostname/ip address of ComputerA
This allows ComputerA to connect to ComputerB's xorg server

On Computer A run the command

x2x -to ComputerB:0.0 -west

Where ComputerB is the hostname/ip address of ComputerB

Now on ComputerA you should be able to move the mouse left, off the screen, and be able to control ComputerB!

I use this to control my laptop using my desktop's mouse and keyboard. It's a lot easier than switching between my desktop keyboard/mouse and laptop keyboard/mouse!


Website - Blog - arch-home
Arch User since March 2005

Offline

#2 2008-11-07 22:13:59

Vintendo
Member
From: Netherlands
Registered: 2008-04-21
Posts: 375
Website

Re: [Trick] Use Keyboard + Mouse from Xorg to control another Xorg session

A nice trick but I think Synergy is way cooler because it can also control windows en apple machines. Very nice. I use it to control my laptop using my mouse+keyboard from my desktop. /me hates touchpads!

Offline

#3 2011-01-06 22:00:27

diederick76
Member
From: Amsterdam
Registered: 2010-02-14
Posts: 56
Website

Re: [Trick] Use Keyboard + Mouse from Xorg to control another Xorg session

I have used x2x for some time before I started using Arch, but recently I decided to start using it again to control my laptop from my desktop box. I have installed x2x on the laptop. However, when I do

# ssh -X laptop 'x2x -west -to :0'

I get:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  25 (X_SendEvent)
  Resource id in failed request:  0x400001b
  Serial number of failed request:  21
  Current serial number in output stream:  21

I have tried following your howto, but I seem unable to start X with tcp support. I have changed /etc/X11/xinit/xserverrc as you instructed, but when I start X and issue

ps ax | grep X

from a console, I still get:

1670 tty7     Ss+    0:15 /usr/bin/X -nolisten tcp vt07 -auth /var/run/slim.auth

Can you tell me what I'm missing? Are these at all related?

Thanks!

Offline

#4 2011-01-07 04:28:51

clutch
Member
Registered: 2010-05-01
Posts: 48

Re: [Trick] Use Keyboard + Mouse from Xorg to control another Xorg session

yeah, i use synergy because of its multiple-OS support.  my main computer dual-boots win7, so its nice to still have all my linux stuff on my other computer available when I using windows to play some games.

kind of vaguely considering playing around to xdmx because the only reason I started on this setup to begin with was that i wanted a triple-head setup and didn't want to buy another video card.  not sure how well it works anymore though, i heard it was pretty much a dead project.

Offline

#5 2011-11-08 18:58:34

quiquex
Member
Registered: 2011-01-25
Posts: 34

Re: [Trick] Use Keyboard + Mouse from Xorg to control another Xorg session

diederick76 wrote:

I have used x2x for some time before I started using Arch, but recently I decided to start using it again to control my laptop from my desktop box. I have installed x2x on the laptop. However, when I do

# ssh -X laptop 'x2x -west -to :0'

I get:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  25 (X_SendEvent)
  Resource id in failed request:  0x400001b
  Serial number of failed request:  21
  Current serial number in output stream:  21

I have tried following your howto, but I seem unable to start X with tcp support. I have changed /etc/X11/xinit/xserverrc as you instructed, but when I start X and issue

ps ax | grep X

from a console, I still get:

1670 tty7     Ss+    0:15 /usr/bin/X -nolisten tcp vt07 -auth /var/run/slim.auth

Can you tell me what I'm missing? Are these at all related?

Thanks!

Today I was looking into this and got working very fast using this thread. Are you sure you restarted your X server after changing xserverrc? Are you sure your display is at :0?

Use

echo $DISPLAY

on the terminal to find out. Also you need x2x installed on both machines.

Last edited by quiquex (2011-11-08 18:59:08)

Offline

Board footer

Powered by FluxBB