As the title suggests, I want to use a remote keyboard locally. The remote keyboard should be usable in a TTY and, if possible, in the X-Server as well. Are there any drivers (kernel modules) emulating a "fake" keyboard with network transparency?
I found it out on my own.
First make sure you have loaded the evdev kernel module on both machines.
On the remote machine you run:
And on the client:
(Note: If your're using netcat from netcat-openbsd, for example in Ubuntu or Fedora, don't use the '-p')
It works perfectly no matter whether I am in a TTY or in X.org. And it runs without any delay!
Unfortunately all keys are typed on the remote machine as well. Is there a way of temporarily disabling them while nc is running? I thought of somehting like running "cat -" on the remote machine but a Ctrl-C would make it end of course.
Synergy will share a keyboard over the network between multiple machines. If it doesn't directly do what you want, I'm sure there's code there that will make it easy for you to set up.
Take a look at Synergy.
The above suggestion of using nc (netcat) doesn't work for me.
I can open the input stream using this command:
I get permission denied, even if I do it as sudo. The target machine has a really old linux install on it, so maybe /dev/input device files were read-only way back when.
I was able to solve this problem using x2x, however, and the result is very user-friendly.
You need to do "xhost +" on the target machine, and also use gdmsetup to enable remote connections (this removes the -nolisten flag for X the next time gdm launches an X session).
After that, your xserver is wide open for remote connections, and x2x can connect to it from the source (keyboard) machine
The cool thing about x2x is that it gives you a little control window on the source machine, and keyboard events are only sent to the target when that window is focused. This is a very handy way to do it (I'm typing this answer from the source machine right now, and no stray keypresses are reaching the target machine, because I have the control window de-focused). Also, clicking on the center of the control window starts forwarding mouse events as well, and 2-button clicking ends the sending of mouse events. Also, when you enable mouse forwarding with a click in the control window, ALL keyboard events are sent to the target, and none to the source. Thus, ALT-TAB is sent to the target without defocusing the control window on the source machine.
I have virtual desktops enabled on the source machine, so I just stick the x2x control window on a distant desktop and only go there when I need to control the target machine.
This version of the solution is at the X level, where the above answer is at the linux device level. Of course, this won't work at all if you're not running X on both the target and the source.