A Python USB/IP server for sharing USB devices over the network
Project description
usbipd-python
A USB/IP server written in Python 3 for sharing USB devices over the network. This implementation uses the pyusb library and the libusb backend to support cross-platform USB device access on macOS and Linux.
Note: This is an early-stage implementation, primarily created for learning purposes. Simple USB devices generally work well, but more complex or HID-based devices may experience issues. HID devices are managed by OS kernel drivers on macOS and Windows, making them difficult to detach without OS-native code or custom drivers. Contributions are welcome!
Installation
Users
Install from PyPI:
pip install usbipd-python
usbipd-python --help
Developers
-
Clone the repository:
git clone https://github.com/abrinkman/usbipd-python.git cd usbipd-python
-
Create and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate
-
Install in development mode with dev dependencies:
pip install -e ".[dev]"
System Requirements
- Python: 3.9 or higher
- libusb: Install using your system package manager
- macOS:
brew install libusb - Linux (Debian/Ubuntu):
sudo apt-get install libusb-1.0-0-dev - Linux (Fedora/RHEL):
sudo dnf install libusbx-devel
- macOS:
Usage
List USB Devices
Display all available USB devices:
usbipd-python list
Bind a Device
Bind a USB device by its bus ID to make it available for sharing:
usbipd-python bind --bus-id <bus-id>
Bindings are stored persistently using the device's VID:PID:serial for future recognition, even if the bus ID changes. Devices without a serial number are matched by VID:PID only.
Start the Server
Start the USB/IP server (requires root/sudo on macOS):
sudo usbipd-python start
Add -v or --verbose for debug output:
sudo usbipd-python -v start
Connect to the Server
Use a USB/IP client on another machine to connect and access shared devices.
Development
Code Quality
Run linting and formatting checks using ruff:
ruff check . # Check for linting issues
ruff format --check . # Check code formatting
ruff format . # Auto-format code
Run type checking:
mypy --ignore-missing-imports .
Project Structure
usbipd.py- Main CLI entry point usingargparseusb_device.py-USBDevicewrapper class forpyusbdevice accessusbip_server.py-USBIPServerclass implementing the USB/IP protocolbinding_configuration.py-BindingConfigurationclass for XML-based device binding storagelibusb_backend.py- Cross-platform libusb backend loader forpyusb
License
Licensed under GPL-3.0. See LICENSE for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file usbipd-0.0.4.tar.gz.
File metadata
- Download URL: usbipd-0.0.4.tar.gz
- Upload date:
- Size: 47.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80f2adde1361a80ea8f11296f32d52763611d43e2836fb28371fef5e17043e9c
|
|
| MD5 |
73af19edfc10dd55b22f47061f3b5d06
|
|
| BLAKE2b-256 |
3c2a7775470d33f143bf0c8d0782cde061820e0e8162cd1163376ed0f6ff664b
|
Provenance
The following attestation bundles were made for usbipd-0.0.4.tar.gz:
Publisher:
publish.yml on abrinkman/usbipd-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
usbipd-0.0.4.tar.gz -
Subject digest:
80f2adde1361a80ea8f11296f32d52763611d43e2836fb28371fef5e17043e9c - Sigstore transparency entry: 749554137
- Sigstore integration time:
-
Permalink:
abrinkman/usbipd-python@5ce081e8e4c459e2549611920baaee58a402475d -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/abrinkman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5ce081e8e4c459e2549611920baaee58a402475d -
Trigger Event:
push
-
Statement type:
File details
Details for the file usbipd-0.0.4-py3-none-any.whl.
File metadata
- Download URL: usbipd-0.0.4-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5609fe1a355242d2ff200f35af1a876a0f7ea5e55ac0e37b80629f44b180d8c1
|
|
| MD5 |
29a1b5bfd4ce64b6eb84f6dc9577230b
|
|
| BLAKE2b-256 |
c91f7b2816f51aa2c9abbdd5ee5eebe4054533468045c780a52e920eb518f1c9
|
Provenance
The following attestation bundles were made for usbipd-0.0.4-py3-none-any.whl:
Publisher:
publish.yml on abrinkman/usbipd-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
usbipd-0.0.4-py3-none-any.whl -
Subject digest:
5609fe1a355242d2ff200f35af1a876a0f7ea5e55ac0e37b80629f44b180d8c1 - Sigstore transparency entry: 749554166
- Sigstore integration time:
-
Permalink:
abrinkman/usbipd-python@5ce081e8e4c459e2549611920baaee58a402475d -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/abrinkman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5ce081e8e4c459e2549611920baaee58a402475d -
Trigger Event:
push
-
Statement type: