README 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. #
  2. # README for usbip-utils
  3. #
  4. # Copyright (C) 2011 matt mooney <mfm@muteddisk.com>
  5. # 2005-2008 Takahiro Hirofuchi
  6. [Requirements]
  7. - USB/IP device drivers
  8. Found in the staging directory of the Linux kernel.
  9. - libudev >= 2.0
  10. libudev library
  11. - libwrap0-dev
  12. tcp wrapper library
  13. - gcc >= 4.0
  14. - libtool, automake >= 1.9, autoconf >= 2.5.0, pkg-config
  15. [Optional]
  16. - hwdata
  17. Contains USB device identification data.
  18. [Install]
  19. 0. Generate configuration scripts.
  20. $ ./autogen.sh
  21. 1. Compile & install the userspace utilities.
  22. $ ./configure [--with-tcp-wrappers=no] [--with-usbids-dir=<dir>]
  23. $ make install
  24. 2. Compile & install USB/IP drivers.
  25. [Usage]
  26. server:# (Physically attach your USB device.)
  27. server:# insmod usbip-core.ko
  28. server:# insmod usbip-host.ko
  29. server:# usbipd -D
  30. - Start usbip daemon.
  31. server:# usbip list -l
  32. - List driver assignments for USB devices.
  33. server:# usbip bind --busid 1-2
  34. - Bind usbip-host.ko to the device with busid 1-2.
  35. - The USB device 1-2 is now exportable to other hosts!
  36. - Use `usbip unbind --busid 1-2' to stop exporting the device.
  37. client:# insmod usbip-core.ko
  38. client:# insmod vhci-hcd.ko
  39. client:# usbip list --remote <host>
  40. - List exported USB devices on the <host>.
  41. client:# usbip attach --remote <host> --busid 1-2
  42. - Connect the remote USB device.
  43. client:# usbip port
  44. - Show virtual port status.
  45. client:# usbip detach --port <port>
  46. - Detach the USB device.
  47. [Example]
  48. ---------------------------
  49. SERVER SIDE
  50. ---------------------------
  51. Physically attach your USB devices to this host.
  52. trois:# insmod path/to/usbip-core.ko
  53. trois:# insmod path/to/usbip-host.ko
  54. trois:# usbipd -D
  55. In another terminal, let's look up what USB devices are physically
  56. attached to this host.
  57. trois:# usbip list -l
  58. Local USB devices
  59. =================
  60. - busid 1-1 (05a9:a511)
  61. 1-1:1.0 -> ov511
  62. - busid 3-2 (0711:0902)
  63. 3-2:1.0 -> none
  64. - busid 3-3.1 (08bb:2702)
  65. 3-3.1:1.0 -> snd-usb-audio
  66. 3-3.1:1.1 -> snd-usb-audio
  67. - busid 3-3.2 (04bb:0206)
  68. 3-3.2:1.0 -> usb-storage
  69. - busid 3-3 (0409:0058)
  70. 3-3:1.0 -> hub
  71. - busid 4-1 (046d:08b2)
  72. 4-1:1.0 -> none
  73. 4-1:1.1 -> none
  74. 4-1:1.2 -> none
  75. - busid 5-2 (058f:9254)
  76. 5-2:1.0 -> hub
  77. A USB storage device of busid 3-3.2 is now bound to the usb-storage
  78. driver. To export this device, we first mark the device as
  79. "exportable"; the device is bound to the usbip-host driver. Please
  80. remember you can not export a USB hub.
  81. Mark the device of busid 3-3.2 as exportable:
  82. trois:# usbip --debug bind --busid 3-3.2
  83. ...
  84. usbip debug: usbip_bind.c:162:[unbind_other] 3-3.2:1.0 -> usb-storage
  85. ...
  86. bind device on busid 3-3.2: complete
  87. trois:# usbip list -l
  88. Local USB devices
  89. =================
  90. ...
  91. - busid 3-3.2 (04bb:0206)
  92. 3-3.2:1.0 -> usbip-host
  93. ...
  94. ---------------------------
  95. CLIENT SIDE
  96. ---------------------------
  97. First, let's list available remote devices that are marked as
  98. exportable on the host.
  99. deux:# insmod path/to/usbip-core.ko
  100. deux:# insmod path/to/vhci-hcd.ko
  101. deux:# usbip list --remote 10.0.0.3
  102. Exportable USB devices
  103. ======================
  104. - 10.0.0.3
  105. 1-1: Prolific Technology, Inc. : unknown product (067b:3507)
  106. : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-1
  107. : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
  108. : 0 - Mass Storage / SCSI / Bulk (Zip) (08/06/50)
  109. 1-2.2.1: Apple Computer, Inc. : unknown product (05ac:0203)
  110. : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-2/1-2.2/1-2.2.1
  111. : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
  112. : 0 - Human Interface Devices / Boot Interface Subclass / Keyboard (03/01/01)
  113. 1-2.2.3: OmniVision Technologies, Inc. : OV511+ WebCam (05a9:a511)
  114. : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-2/1-2.2/1-2.2.3
  115. : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
  116. : 0 - Vendor Specific Class / unknown subclass / unknown protocol (ff/00/00)
  117. 3-1: Logitech, Inc. : QuickCam Pro 4000 (046d:08b2)
  118. : /sys/devices/pci0000:00/0000:00:1e.0/0000:02:0a.0/usb3/3-1
  119. : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
  120. : 0 - Data / unknown subclass / unknown protocol (0a/ff/00)
  121. : 1 - Audio / Control Device / unknown protocol (01/01/00)
  122. : 2 - Audio / Streaming / unknown protocol (01/02/00)
  123. Attach a remote USB device:
  124. deux:# usbip attach --remote 10.0.0.3 --busid 1-1
  125. port 0 attached
  126. Show the devices attached to this client:
  127. deux:# usbip port
  128. Port 00: <Port in Use> at Full Speed(12Mbps)
  129. Prolific Technology, Inc. : unknown product (067b:3507)
  130. 6-1 -> usbip://10.0.0.3:3240/1-1 (remote bus/dev 001/004)
  131. 6-1:1.0 used by usb-storage
  132. /sys/class/scsi_device/0:0:0:0/device
  133. /sys/class/scsi_host/host0/device
  134. /sys/block/sda/device
  135. Detach the imported device:
  136. deux:# usbip detach --port 0
  137. port 0 detached
  138. [Checklist]
  139. - See 'Debug Tips' on the project wiki.
  140. - http://usbip.wiki.sourceforge.net/how-to-debug-usbip
  141. - usbip-host.ko must be bound to the target device.
  142. - See /proc/bus/usb/devices and find "Driver=..." lines of the device.
  143. - Shutdown firewall.
  144. - usbip now uses TCP port 3240.
  145. - Disable SELinux.
  146. - Check the kernel and daemon messages.
  147. [Contact]
  148. Mailing List: linux-usb@vger.kernel.org