A macOS implementation of the USB/IP protocol that allows sharing USB devices over IP networks.
usbipd-mac is a macOS implementation of the USB/IP protocol that allows sharing USB devices over IP networks. This server implementation enables macOS users to share USB devices with any compatible USB/IP client, with a focus on compatibility with the Linux Kernel virtual HCI driver (vhci-hcd.ko). Docker support on macOS is also a goal.
- USB device sharing from macOS to other systems over network
- Full compatibility with the USB/IP protocol specification
- System Extensions integration for reliable device access and claiming
- Automated System Extension bundle creation and deployment
- Lightweight QEMU test server for validation
- Docker enablement for USB device access from containers
- macOS 11.0+: System Extensions are only supported on macOS Big Sur and later
- Xcode 13+: Required for System Extensions support and Swift Package Manager
- Code Signing: Optional for development, required for distribution
The easiest way to install usbipd-mac is through Homebrew:
# Add the usbip tap
brew tap beriberikix/usbipd-mac
# Install usbip
brew install usbip
After installation, you can manage the usbipd daemon using Homebrew services:
# Start the service (requires sudo for System Extension access)
sudo brew services start usbip
# Stop the service
sudo brew services stop usbip
# Restart the service
sudo brew services restart usbip
# Check service status
brew services info usbip
After Homebrew installation, you'll need to install and approve the System Extension:
-
Automatic Installation: Use the built-in installation command:
# Install and register the System Extension (requires sudo) sudo usbipd install-system-extension
-
System Extension Approval: macOS will prompt you to approve the System Extension in System Preferences > Security & Privacy > General
-
Restart Required: A restart may be required for the System Extension to become active
-
Verification: Check the System Extension status with
usbipd status
Installation Diagnostics: If you encounter issues, run comprehensive diagnostics:
# Run complete installation diagnostics
usbipd diagnose
# Run verbose diagnostics for detailed troubleshooting
usbipd diagnose --verbose
Common installation issues and solutions:
- Permission Errors: Ensure you run service commands with
sudo
as the daemon requires System Extension privileges - System Extension Blocked: Check System Preferences > Security & Privacy and approve the extension
- Service Won't Start: Verify the binary installed correctly with
which usbipd
and check logs withbrew services list
- Version Issues: Update with
brew upgrade usbip
or reinstall withbrew reinstall usbip
For System Extension specific issues:
Installation Problems:
- Bundle Not Found: Ensure Homebrew installation completed successfully, reinstall if needed
- Registration Failed: Run
sudo usbipd install-system-extension --verbose
for detailed error information - User Approval Required: System Extensions require explicit user approval in System Preferences
- Developer Mode Required: For unsigned builds, enable developer mode:
sudo systemextensionsctl developer on
Common Error Solutions:
# Check detailed installation status
usbipd diagnose --verbose
# Re-install System Extension if corrupted
sudo usbipd install-system-extension --skip-verification
# Verify System Extension is properly registered
systemextensionsctl list
# Check System Extension process status
usbipd status
System Requirements:
- macOS 11.0+: System Extensions are only available on Big Sur and later
- Code Signing: Production releases require properly signed System Extensions
- System Integrity Protection: Must be compatible with SIP settings
- User Approval: Interactive approval required in System Preferences
For development or manual installation, see the Building the Project section below.
Once installed, you can use usbip to share USB devices over the network:
# List available USB devices
usbipd list
# Share a USB device (device ID from list command)
usbipd bind --device <device-id>
# Check daemon status and shared devices
usbipd status
# Stop sharing a device
usbipd unbind --device <device-id>
# Install and register the System Extension
sudo usbipd install-system-extension
# Run comprehensive installation diagnostics
usbipd diagnose
# Run verbose diagnostics with detailed information
usbipd diagnose --verbose
# Check System Extension status and health
usbipd status --verbose
From a USB/IP client (typically Linux):
# Install USB/IP tools (Ubuntu/Debian)
sudo apt install linux-tools-generic
# Connect to shared device
sudo usbip attach -r <macos-ip-address> -b <device-id>
# List attached devices
usbip port
# Detach device
sudo usbip detach -p <port-number>
For Docker Desktop users:
# Ensure the service is running
sudo brew services start usbip
# USB devices will be available to Docker containers
# through the USB/IP protocol integration
This project is currently in early development. The core server functionality is being implemented as an MVP.
# Build the project
swift build
# Build with Xcode (recommended for development)
xcodebuild -scheme usbipd-mac build
For development with System Extensions:
# Enable System Extension development mode (requires reboot)
sudo systemextensionsctl developer on
# Build the project (includes System Extension bundle creation)
swift build
# Install System Extension for development
sudo usbipd install-system-extension
# Run diagnostics to verify installation
usbipd diagnose
# Check detailed status including bundle information
usbipd status --verbose
# Run all tests
swift test
# Run specific test environments (see Documentation for details)
./Scripts/run-development-tests.sh # Fast development tests
./Scripts/run-ci-tests.sh # CI-compatible tests
./Scripts/run-production-tests.sh # Comprehensive validation
For detailed information about development, architecture, and troubleshooting, see the comprehensive documentation in the Documentation/
folder:
- Architecture - System design and component overview
- CI/CD Pipeline - Continuous integration and branch protection
- System Extension Development - System Extension setup and development
- Testing Strategy - Test environments and validation approaches
- USB Implementation - USB/IP protocol implementation details
- Protocol Reference - USB/IP protocol specification
- QEMU Test Tool - QEMU validation server usage
- Build Troubleshooting - Common build and setup issues
- System Extension Troubleshooting - System Extension specific problems
- Homebrew Troubleshooting - Homebrew installation and service issues
- QEMU Troubleshooting - QEMU test server issues
usbipd-mac uses automated GitHub Actions workflows for consistent and reliable releases.
-
Create and Edit Changelog:
# Manually edit CHANGELOG.md to document changes for the release # Add entries under the [Unreleased] section # Follow Keep a Changelog format
-
Commit Changelog:
# Commit the changelog updates git add CHANGELOG.md git commit -m "docs: update changelog for v1.2.3 release"
-
Prepare Release Locally:
# Prepare specific version (will prompt to review auto-generated changelog) ./Scripts/prepare-release.sh --version v1.2.3 # The script will: # - Update CHANGELOG.md with version entry # - Pause for you to manually edit the changelog # - Run validation, tests, and create the Git tag
Available options:
--version VERSION
: Specific version (e.g., v1.2.3 or 1.2.3)--dry-run
: Preview actions without making changes--skip-tests
: Skip test execution (not recommended)--skip-lint
: Skip code quality checks (not recommended)--force
: Override safety checks and skip manual changelog review
-
Push Release Tag:
# Push the created tag to trigger automated workflows git push origin v1.2.3
-
Automated Pipeline: Once a version tag is pushed, GitHub Actions automatically:
- Validates the release candidate
- Builds production artifacts with code signing
- Runs comprehensive test validation
- Updates Homebrew formula automatically
- Creates GitHub release with artifacts and checksums
- Pushes formula changes back to the repository
-
Emergency Releases: For critical fixes, use
--force
to skip manual changelog review and validation.
External Tap Architecture: The Homebrew formula is managed in a separate tap repository and is updated automatically via homebrew-releaser GitHub Action during the release workflow.
Automated Formula Update Process:
The release workflow uses homebrew-releaser for direct formula updates:
- Homebrew-releaser action automatically updates formula in the external tap repository:
homebrew-usbipd-mac
- Formula is committed directly to tap repository with proper version and SHA256
- No metadata files or manual intervention required
Immediate Availability - users can install and update through Homebrew immediately after a release is published.
Formula Testing and Validation:
# Test installation from tap
brew uninstall usbip || true
brew untap beriberikix/usbipd-mac || true
brew tap beriberikix/usbipd-mac
brew install usbip
Formula Repository: The formula and automation workflows are maintained in the separate homebrew-usbipd-mac
repository.
- Semantic Versioning: Follow semver (MAJOR.MINOR.PATCH) for all releases
- Release Schedule: Monthly minor releases with patch releases as needed
- Pre-releases: Use
-alpha
,-beta
,-rc
suffixes for testing releases - Changelog: Automatically generated from conventional commits
For release automation to work properly:
- Code Signing: Configure Apple Developer certificates in GitHub repository secrets
- Permissions: Ensure maintainer access to repository settings and secrets
- Environment: Validate local environment with release preparation script
Validation commands:
# Check release preparation environment
./Scripts/prepare-release.sh --help
# Validate formula update tools
./Scripts/update-formula.sh --help
# Validate formula syntax
./Scripts/validate-formula.sh --help
See Release Automation Documentation for complete setup instructions and troubleshooting.
Release automation is handled by maintainers. Contributors should:
- Follow conventional commit format for automatic changelog generation
- Ensure all PRs pass CI validation before merge
- Report issues with release automation to repository maintainers