Rust usbip protocol library and tooling
Find a file
Davíð Steinn Geirsson 30d3c9532e feat: add usbip-rs CLI tool with vsock transport
Convert to cargo workspace with lib/ and cli/ crates. Add Nix flake
for building and development. Extract handle_urb_loop and add
read_urb_command to the library for CLI consumption.

Implement the usbip-rs CLI binary with clap subcommands:
- client listen: accept incoming connections via vhci_hcd sysfs
- host connect: passthrough real USB devices via nusb
- test_hid connect: export a simulated HID keyboard for testing

Add vsock transport layer and vhci_hcd sysfs interaction module.
Apply rustfmt formatting project-wide and add rustfmt/clippy to devShell.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:41:42 +00:00
cli feat: add usbip-rs CLI tool with vsock transport 2026-03-22 10:41:42 +00:00
docs/superpowers feat: add usbip-rs CLI tool with vsock transport 2026-03-22 10:41:42 +00:00
lib feat: add usbip-rs CLI tool with vsock transport 2026-03-22 10:41:42 +00:00
.gitignore feat: add usbip-rs CLI tool with vsock transport 2026-03-22 10:41:42 +00:00
Cargo.lock feat: add usbip-rs CLI tool with vsock transport 2026-03-22 10:41:42 +00:00
Cargo.toml feat: add usbip-rs CLI tool with vsock transport 2026-03-22 10:41:42 +00:00
flake.lock feat: add usbip-rs CLI tool with vsock transport 2026-03-22 10:41:42 +00:00
flake.nix feat: add usbip-rs CLI tool with vsock transport 2026-03-22 10:41:42 +00:00
LICENSE Simplify documentation (fixes #59) 2025-12-25 20:58:48 +08:00
NOTES.md Add notes 2022-12-05 17:39:37 +08:00
README.md Simplify documentation (fixes #59) 2025-12-25 20:58:48 +08:00

usbip

Coverage Status crates.io

A Rust library to run a USB/IP server to simulate USB devices and share real USB devices over a network.

What is USB/IP?

USB/IP is a network protocol that allows USB devices to be shared between computers over a network. It enables:

  • Device simulation: Create virtual USB devices that can be accessed remotely
  • Device sharing: Share physical USB devices from one machine to another
  • Cross-platform: Works across different operating systems (Linux, etc.)

Installation

Prerequisites

Install Rust from the official documentation.

Building from source

git clone https://github.com/jiegec/usbip.git
cd usbip
cargo build --release

How to use

Examples

The examples/ directory contains three example programs:

  1. hid_keyboard: Simulate a HID keyboard that types something every second
  2. cdc_acm_serial: Simulate a CDC ACM serial device that receives a character every second
  3. host: Act as a USB/IP server, sharing physical devices from the host machine to remote clients

Running an example

cargo run --example hid_keyboard

Connecting from a USB/IP client

On the client machine (e.g. Linux with USB/IP support):

# List available devices
usbip list -r $remote_ip

# Attach to a device
usbip attach -r $remote_ip -b $bus_id

License

MIT License - see LICENSE file for details.