Building a Generic USB-over-IP Setup

Written by

in

1. Purpose

This guide explains how to build a generic USB-over-IP bridge.

The goal is to plug a USB device into a small network-connected computer, such as a Raspberry Pi, and make that device appear on another computer as though it were locally connected.

Typical use cases include:

USB serial adapters
label printers
smart-card readers
JTAG/SWD programmers
licence dongles
test equipment
legacy USB peripherals
USB storage devices for controlled use

This guide assumes a Linux-based bridge device and a Linux client computer. Windows support is more complex and is discussed separately.


2. Basic Architecture

The standard architecture is:

USB peripheral
   ↓
Raspberry Pi / Linux SBC
   ↓
Ethernet or Wi-Fi network
   ↓
Client computer
   ↓
Normal local device driver

The USB device is physically connected to the Raspberry Pi or other Linux single-board computer. The client computer connects to the Pi over the network and imports the USB device.

Once imported, the device should appear on the client computer as a local USB device.


3. Recommended Hardware

Preferred bridge device

Use one of the following:

Raspberry Pi 4
Raspberry Pi 5
Raspberry Pi Zero 2 W
Other Linux SBC with USB host support

For a reliable permanent setup, use a Raspberry Pi 4 or Raspberry Pi 5.

For a small low-cost setup, a Raspberry Pi Zero 2 W can work, especially for low-bandwidth devices.

Avoid using a Raspberry Pi Pico

A Raspberry Pi Pico or Pico W is not recommended for a generic USB-over-IP bridge. It is a microcontroller, not a full Linux computer. It may be suitable for custom USB serial, HID, or MIDI projects, but it is not a practical generic USB/IP bridge.

USB hub

Use a powered USB hub if:

the USB device draws significant power
you need several USB devices
the device behaves unreliably
you are using a Pi Zero class board

A powered hub is strongly recommended for printers, scanners, test tools, and multiple-device setups.


4. Recommended Network Layout

Use wired Ethernet if possible:

USB device → Pi → Ethernet → network switch → client computer

Wi-Fi can work, but it is less reliable for USB-over-IP because USB devices can be sensitive to latency, jitter, and disconnection.

For permanent use, prefer:

static IP address
or
DHCP reservation

Example:

usbip-lab-01    192.168.1.50
usbip-print-01  192.168.1.51
usbip-jtag-01   192.168.1.52

5. Install Software on the USB Bridge

On the Raspberry Pi or Linux bridge device, install the USB/IP tools.

sudo apt update
sudo apt install usbip

Load the USB/IP host module:

sudo modprobe usbip-host

Start the USB/IP daemon:

sudo usbipd -D

List locally connected USB devices:

usbip list -l

You should see output similar to:

busid 1-1.2 (1234:5678)
  Example USB Device

The important value is the busid, for example:

1-1.2

Bind the USB device so it can be exported:

sudo usbip bind -b 1-1.2

Replace 1-1.2 with the actual bus ID shown on your system.


6. Install Software on the Client Computer

On the Linux client computer, install the USB/IP tools:

sudo apt update
sudo apt install usbip

Load the virtual USB host controller:

sudo modprobe vhci-hcd

Check which USB devices are available from the bridge:

usbip list -r <bridge-ip-address>

Example:

usbip list -r 192.168.1.50

Attach the remote USB device:

sudo usbip attach -r 192.168.1.50 -b 1-1.2

Check that the device has appeared:

lsusb

You can also monitor the system log:

dmesg -w

If the device is supported by Linux, the normal local driver should load automatically.


7. Detach a Remote USB Device

To list currently attached USB/IP devices on the client:

usbip port

You will see a port number, for example:

Port 00: <Port in Use>

Detach the device:

sudo usbip detach -p 00

Replace 00 with the actual port number.


8. Make the Bridge Start Automatically

Create a systemd service on the bridge device.

Create the file:

sudo nano /etc/systemd/system/usbipd.service

Add:

[Unit]
Description=USB/IP daemon
After=network-online.target
Wants=network-online.target

[Service]
Type=forking
ExecStartPre=/sbin/modprobe usbip-host
ExecStart=/usr/sbin/usbipd -D
Restart=on-failure

[Install]
WantedBy=multi-user.target

Enable and start it:

sudo systemctl daemon-reload
sudo systemctl enable --now usbipd

Check status:

systemctl status usbipd

9. Optional: Auto-Bind a Known USB Device

For simple setups, manual binding is acceptable.

For a more permanent setup, create a script that binds known devices after boot.

Example script:

sudo nano /usr/local/sbin/usbip-bind-all.sh

Add:

#!/bin/bash

modprobe usbip-host

for BUSID in $(usbip list -l | awk '/busid/ {print $2}'); do
    usbip bind -b "$BUSID" 2>/dev/null
done

Make it executable:

sudo chmod +x /usr/local/sbin/usbip-bind-all.sh

Create a service:

sudo nano /etc/systemd/system/usbip-bind-all.service

Add:

[Unit]
Description=Bind all local USB devices for USB/IP
After=usbipd.service
Requires=usbipd.service

[Service]
Type=oneshot
ExecStart=/usr/local/sbin/usbip-bind-all.sh

[Install]
WantedBy=multi-user.target

Enable it:

sudo systemctl daemon-reload
sudo systemctl enable --now usbip-bind-all.service

This will attempt to export all connected USB devices. For a more secure setup, bind only known device IDs.


10. Security

Do not expose USB/IP directly to an untrusted network.

The USB/IP daemon normally listens on TCP port:

3240

A basic firewall rule should restrict access to the intended client computer only.

Example using ufw:

sudo apt install ufw
sudo ufw allow from 192.168.1.20 to any port 3240 proto tcp
sudo ufw enable

In this example, only the client computer at 192.168.1.20 can connect.

For stronger security, use a VPN such as WireGuard:

Client computer → WireGuard VPN → USB/IP bridge

Recommended security controls:

use static client IPs
restrict TCP 3240
do not expose USB/IP to the Internet
do not expose USB/IP to guest Wi-Fi
use WireGuard for remote access
physically secure sensitive USB devices
detach devices when not in use

11. Device Suitability

USB/IP works best with low-bandwidth, low-latency-tolerant USB devices.

Good candidates:

USB serial adapters
JTAG/SWD programmers
smart-card readers
label printers
simple USB printers
USB MIDI devices
some licence dongles
some test equipment

Poor candidates:

webcams
USB audio interfaces
capture cards
high-speed SDRs
gaming controllers needing low latency
phones in complex sync modes
high-throughput storage workloads
devices that disconnect easily

USB/IP does not make the network behave exactly like a local USB cable. Latency, packet loss, Wi-Fi instability, and client sleep/resume can interrupt devices.


12. Windows Client Notes

A Linux client is the simplest option.

For Windows, generic open USB/IP client support is more difficult. The common open-source Windows tooling is usually better suited to sharing Windows-attached devices into WSL or virtual machines, not necessarily importing arbitrary remote USB devices into Windows as native local hardware.

For Windows workstations, consider:

commercial USB-over-IP software
running the application inside a Linux VM
using WSL if the device only needs to appear inside Linux
using a protocol-specific alternative

Protocol-specific alternatives are often better:

USB printer → use CUPS, IPP, or network printing
USB serial → use serial-over-TCP
scanner → use SANE or AirScan
MIDI → use RTP-MIDI
storage → use SMB, NFS, or SFTP
camera → use RTSP or MJPEG streaming

Use generic USB-over-IP only when the application truly requires a local USB device.


13. Example Build: Simple USB Serial Bridge

Hardware

Raspberry Pi 4
USB serial adapter
Ethernet connection
Linux client computer

Bridge setup

sudo apt update
sudo apt install usbip
sudo modprobe usbip-host
sudo usbipd -D
usbip list -l

Example output:

busid 1-1.3 (0403:6001)
  FTDI USB Serial Device

Bind it:

sudo usbip bind -b 1-1.3

Client setup

sudo apt update
sudo apt install usbip
sudo modprobe vhci-hcd
usbip list -r 192.168.1.50
sudo usbip attach -r 192.168.1.50 -b 1-1.3

Check the serial device:

ls /dev/ttyUSB*

You should see something like:

/dev/ttyUSB0

The client application can now use /dev/ttyUSB0.


14. Example Build: Remote Firmware Development Station

Hardware

Raspberry Pi 4 or Pi 5
Powered USB hub
USB JTAG/SWD programmer
USB serial adapter
GPIO-controlled reset relay
Ethernet
Optional camera

Architecture

Target board
 ├── USB serial adapter → Pi USB hub
 ├── JTAG/SWD probe → Pi USB hub
 ├── reset line → Pi GPIO relay
 └── optional camera view

The developer connects to the Pi over the network, imports the JTAG probe and serial adapter, flashes firmware, reads logs, and resets the target remotely.

This is one of the most useful USB-over-IP configurations for software and hardware engineering teams.


15. Operational Procedure

A normal user workflow should be:

  1. Check that the bridge is online.
ping usbip-lab-01
  1. List available remote USB devices.
usbip list -r usbip-lab-01
  1. Attach the required device.
sudo usbip attach -r usbip-lab-01 -b <busid>
  1. Confirm that the device appears locally.
lsusb
dmesg | tail
  1. Use the normal application or driver.
  2. Detach the device when finished.
usbip port
sudo usbip detach -p <port>

16. Troubleshooting

The client cannot see the bridge

Check network connectivity:

ping <bridge-ip-address>

Check that the daemon is running on the bridge:

systemctl status usbipd

Check firewall rules:

sudo ss -ltnp | grep 3240

The device is not listed on the bridge

Check physical USB detection:

lsusb
dmesg | tail

Try a powered USB hub.

Check power supply quality.

The device is listed but cannot be attached

Check that it has been bound:

usbip list -l

Rebind it:

sudo usbip unbind -b <busid>
sudo usbip bind -b <busid>

The device attaches but does not work

Check the client log:

dmesg -w

Check whether the client has the correct driver.

Try wired Ethernet instead of Wi-Fi.

Avoid suspending the client while the device is attached.

The device disconnects randomly

Use:

better power supply
powered USB hub
wired Ethernet
shorter USB cable
static IP address
no Wi-Fi roaming
no USB autosuspend

To disable USB autosuspend temporarily:

echo -1 | sudo tee /sys/module/usbcore/parameters/autosuspend

17. Suggested Final Design

For a dependable generic USB-over-IP setup, use:

Raspberry Pi 4 or Pi 5
Raspberry Pi OS Lite
powered USB hub
wired Ethernet
static IP or DHCP reservation
usbipd service
firewall restriction
WireGuard for remote access
manual or controlled device attach/release

Recommended naming:

usbip-lab-01
usbip-printer-01
usbip-dongle-01
usbip-jtag-01
usbip-console-01

Recommended documentation per device:

Device name
Physical location
USB vendor/product ID
Bus ID
Allowed users
Known client driver
Known limitations
Detach procedure
Recovery procedure

18. Summary

A generic USB-over-IP setup is best built with a Linux SBC acting as the USB host and network bridge.

The simplest reliable pattern is:

USB device → Raspberry Pi 4/5 → Ethernet → Linux client

Use USB/IP for the transport, restrict access with firewall rules or VPN, and test each USB device class before depending on it operationally.

For Linux clients, this is practical and inexpensive.

For Windows clients, expect additional complexity and consider commercial USB-over-IP software or protocol-specific alternatives.