15

I want to use one PC as a USB keyboard for another PC. It has to be indistinguishable from actual USB keyboard. How can I achieve this?

A solution that works with any of Ubuntu Linux 14 and above, OS X 10.11 or Windows 10 would be acceptable. Should work with USB 2.0 or 3.0.

EDIT: the machine to receive the input should not require any specific software installed or network access. I need to use a physical USB cable and the destination machine should react as if a physical keyboard is present on that USB port.

5
  • it is about: computer software and i'm not asking about a product / service / learning material recommendation
    – miguelv
    Sep 26 '16 at 11:10
  • 1
    I have reworded your question so that it doesn't sound like software recommendation question.
    – gronostaj
    Sep 26 '16 at 11:11
  • ok, maybe it's not a software recommendation, but still of a low quality. What OS do you use? What have you already tried ... Please read How do I ask a good question? and improve it. Sep 26 '16 at 11:15
  • I acknowledge the low quality and have made the edits, but those are not the points you raised in the first place. And frankly I'm a bit disappointed at the community since I've had to jump from Stack Exchange community to community and always getting dismissed as off-topic or as too generic of a problem and very little constructive effort from anyone except @gronostaj being put in to help me solve a genuine problem that should have a well known solution IMO.
    – miguelv
    Sep 26 '16 at 11:23
  • The question is very clear to me, and I agree it should have better answers. Imagine you have a machine you can't change the software on, but it does have a USB keyboard. You want to automate some typing by using another computer to simulate a USB keyboard device. Surely there are existing devices for this. Mar 19 '19 at 1:09
8

You could use a Raspberry Pi Zero in USB gadget mode. In this mode, the Raspberry Pi can behave as many standard USB devices (keyboard, mouse, mass storage, etc.) and you will then be able to e.g. "inject" keystrokes from a program running on the Pi (and you can then control this program remotely as you see fit).

The Raspberry Pi Zero is not the only device allowing this; but it's cheap, it's easy to get one, and there are many documentations out there explaining how to do this, so it's (IMHO) a pretty good starting point for a project like this!

2

You can use usbip to make USB devices (including a keyboard) on a host computer available as USB devices on a client computer over the network. As it's a USB device, it will be indistinguishable from any USB device attached locally.

Clients exist for Windows, and usbip has been a standard part of the kernel for a long time. Under Debian and Ubuntu, the usbip package contains the programs to set up and control such a connection.

Details on how to set it up can be easily googled, e.g. here

Similar questions:

4
  • 1
    Appreciate your response, but what I was going for involved an actual physical USB cable and should not require installing software on the machine where that I want to send the input to.
    – miguelv
    Sep 26 '16 at 15:30
  • 1
    @miguelv: You need USB device hardware in order to be seen as a keyboard device. No amount of software will cause a USB host port to act as a device.
    – Ben Voigt
    Sep 26 '16 at 16:07
  • Huh. What is the reason you don't just unplug the USB keyboard from the one PC, and plug it into the other PC? They are apparently close enough to put a cable between them. In other words, what's the actual problem you want to solve?
    – dirkt
    Sep 26 '16 at 17:14
  • And to add to @BenVoigt, finding any sort of hardware for a PC that's going to act as an USB client (no matter if it's USB OTG or not) will be damned difficult.
    – dirkt
    Sep 26 '16 at 17:15
1

Pardon the necro, but it appears the thread isn't locked, so here goes.

I'm facing the same situation (specific scenario: I need to unlock my workstation remotely from the PRE-OS BitLocker screen). I've ordered the following HW, so I'm posting this to share my research, but not my experiences

The 'source' computer has the following:

This should provide the source machine the same functionality as this $500 USB all-in-one.


The 'target' computer has the following:

  • HDMI splitter so I can still have console when I'm at the computer. Lower-end devices can be found on AMZN for $15 USD.

Total cost will be ( $20 + $90 + $15 ) * 2 = $250 USD so each computer in the pair can monitor and manage the other machine from POST to OS fully online (run level 5).

Wish me luck getting my admin to approve this expense!

0

Use Logitech Unifying USB receiver and emulate virtual keyboard with this: https://github.com/RoganDawes/LOGITacker

Should be about $20 total.

-1

Given the time between the OP and now, this may be moot. However, for any others with a similar question, I propose the following solution:

  1. Buy a cheap usb keyboard, the ones that are like $5 to $20 or so.
  2. Disassemble it and take the controller and usb plug section, then wire-up your "controller" to the contact connections intended for the keyboard matrix. (It goes without saying, that soldering will be required.)
  3. Map out the pins either by examining the contact matrix, or by program.
  4. Craft your control program using the mapping.
  5. Set your program to load and run OnBoot and off you go!

The control program can be written in any language with that supports the manner of output that will control the "key" matrix inputs of the keyboard controller, and the usb end plug, plugs into the target computer as a usb keyboard as desired.

If using a Linux based OS, Python is likely your language of choice. If using a Windows based OS, .Net is likely your language of choice (specific flavor C#, VB is up to you). It's likely even Node.js or PHP could be used if you can control GPIO or Parallel port pins.

Happy Hacking!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.