Showing posts with label vnc. Show all posts
Showing posts with label vnc. Show all posts

Sunday, January 4, 2009

x2vnc : One keyboard (and mouse) to control them all ...

So you need a windows machine (we're not going to go into why right now), in addition to your Linux box. The box in question is a complete physical box; but you discover it's becoming cumbersome managing two mice and keyboards on your desk.

What you need is x2vnc.


  1. Install x2vnc.

    Using your distro's package manager, install x2vnc. For example, on ubuntu : sudo apt-get install x2vnc does the trick. If x2vnc doesn't reside within your distro's repositories, you might have to install it directly from the author's site. At the time of publishing, the current version available was 1.7.2 and could be obtained here.

  2. Install a VNC server on the Windows box.

    You need to have a VNC server running on the windows box for this to work. There are various free alternatives available; one of which being TightVNC which can be obtained here. Install a VNC server, and start it up on the windows box.

  3. Fire up x2vnc

    There are various options available to you when running x2vnc; these can be obtained by running x2vnc --help; or see the "usage" section here.



    The most basic usage is
    x2vnc -east[|-west|-south|-north] {hostname/ip address}:{display}

    note:  The -east / -west / -south / -north parameter to use depends on where the windows box's screen is in relation to your screen. If the screen is to the right or yours, you use -east, and so forth.

    note:  If your VNC server is password protected, you will be prompted to enter the password directly after executing x2vnc.





Now for the big test, with x2vnc running, move your mouse "out of your screen" to the right (assuming you used the -east option). The mouse pointer should appear on your windows box's screen. You should notice that when the mouse pointer is visible on the windows box's screen, any keyboard activity (including shortcut key keystrokes) will be directed at the windows box, and visa versa.


As you also may have figured out by now, if you have more than one windows box, you could control all of them by running multiple instances of x2vnc.


Finally, if you would like to achieve the same effect with multiple Linux boxes (or anything running an X server), you should check out x2x.