Share mouse and keyboard across computers

July 30th, 2009

Warning: This post is 14 years old. Some of this information may be out of date.

As a website developer I have a need to use multiple operating systems at the same time.  I have a laptop that dual boots Windows Vista and Ubuntu 9.04 and I use this to test websites in Internet Explorer and Safari on Vista.

To save me from having to switch between the Linux Desktop and my Vista laptop everytime I wanted to reload the Vista browser I use a unix utility called x2vnc.  Simply install a VNC server on Vista (I used TightVNC) and start it running.  Then run the x2vnc utility on the Linux Desktop:

sudo aptitude install x2vnc
x2vnc -west andrew-laptop:5901 &

I sometimes have the need to control another Linux machine from the desktop too.  This is where the x2x utility comes in.  First log in to the remote machine and install the x2x utility:

sudo aptitude install x2x

From my local machine, with the screen of the remote computer to the right of the local one:

ssh user@remote -X "x2x -east -to :0" &

This should allow you to move the mouse off the right of your screen and onto the desktop of the remote machine.

Cool or what?!