USB/IP usage

Written by on .

USB/IP is a cli-tool for the usbip kernel modules that enable a USB-device to be connected over a TCP/IP connection. Any USB device can be attached on another machine over a network connection (socket) instead of using a USB-cable. Note that by default this is insecure, and an SSH tunnel is recommended for any non-localhost usage.

You need to install the usbip-package, ensure usbipd service is running (at the default port :3240), and ensure kernel modules are loaded:

modprobe usbip_core modprobe usbip_host modprobe vhci_hcd

Source Machine

List local USB-devices that can be shared:

usbip list -l

Then use the busid value (e.g. "1-1.3", or "1-4"), to make this USB-device available for sharing:

usbip bind -b [busid]

Verify devices that are currently shared:

usbip list -r localhost

To unbind the USB-device, so that it is not shared anymore:

usbip unbind -b [busid]

Target Machine

On another machine (or the same) the USB-device can be attached as a virtual USB-device:

usbip attach -r [remote-host] -b [busid]

In order to list the currently attached USB-devices:

usbip port

To detach (use the port number given in the list above, default is 00):

usbip detach -p 00