8.14. Using VNC to Control Windows and Linux at the Same Time

You need to use a Windows PC and a Linux PC a lot. Sure, you get some exercise hopping back and forth from chair to chair, or scooting your chair about, but it would be nice to control both from a single keyboard and mouse, and you would rather not spend money on a hardware switch.

As usual, the Linux world provides an abundance of useful goodies. In addition to a Windows VNC server (see the previous recipe), you'll need the x2vnc program.

Of course, Linux must be in charge, and will control both computers. First, install x2vnc on Linux.

Make sure the Windows VNC server is running and accepting connections.

Then, fire up x2vnc:

	$ x2vnc 192.168.1.28:0 -west
	x2vnc: VNC server supports protocol version 3.7 (viewer 3.3)
	Password:
	x2vnc: VNC authentication succeeded
	x2vnc: Desktop name "powerpc-w2k"
	x2vnc: Connected to VNC server, using protocol version 3.3
	x2vnc: VNC server default format:

And there you are. -west means left, so you can move your cursor to the left off the edge of your Linux screen, and it will reappear on your Windows screen. Now, you control both computers with the same keyboard and mouse.

You'll notice that this is quite a bit peppier than a regular VNC session because you are running native sessions on each computer, rather than creating virtual graphics servers.

This can only be used to control Windows from Linux. If you want to run your primary session from a Windows PC, use Win2VNC on Windows, and the VNC server of your choice on Linux .

Running two Linux PCs requires x11vnc for the VNC server.

x2vnc works by creating a one-pixel-wide trigger window at the edge of the screen, which causes x2vnc to take control and send mouse movements and keystrokes to the Windows PC.

Here are some useful options: