Skip to content

Instantly share code, notes, and snippets.

@Vesnica
Created September 13, 2025 10:40
Show Gist options
  • Select an option

  • Save Vesnica/e206b5e00ccb99f7aa5d9a74844edd59 to your computer and use it in GitHub Desktop.

Select an option

Save Vesnica/e206b5e00ccb99f7aa5d9a74844edd59 to your computer and use it in GitHub Desktop.
将RaspberryPi上连接的USB设备远程共享

在RaspberryPi上:

  • 安装usbip工具: sudo apt install usbip
  • 加载内核模块: sudo modprobe usbip-host
  • 查看可用的USB设备: usbip list -l
  • 绑定要共享的USB设备(例如busid 1-1): sudo usbip bind -b 1-1
  • 启动usbipd守护进程: sudo usbipd -D

在远端:

  • 安装usbip工具: sudo apt install usbip
  • 加载内核模块: sudo modprobe vhci-hcd
  • 查看服务端可用的设备: usbip list -r 服务端IP
  • 连接远程USB设备: sudo usbip attach -r 服务端IP -b 1-1
  • 查看连接的设备: usbip port
  • 断开连接: sudo usbip detach -p 端口号
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment