blob: 831f49fea3ce90259e9bdf8887d9096b8390ed6a [file] [log] [blame]
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -07001#
2# README for usbip-utils
3#
matt mooney89415212011-06-16 02:24:59 -07004# Copyright (C) 2011 matt mooney <mfm@muteddisk.com>
5# 2005-2008 Takahiro Hirofuchi
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -07006
7
8[Requirements]
9 - USB/IP device drivers
matt mooney89415212011-06-16 02:24:59 -070010 Found in the staging directory of the Linux kernel.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070011
Valentina Manea98ada082014-03-08 14:53:30 +020012 - libudev >= 2.0
13 libudev library
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070014
15 - libwrap0-dev
matt mooney89415212011-06-16 02:24:59 -070016 tcp wrapper library
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070017
18 - gcc >= 4.0
19
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070020 - libtool, automake >= 1.9, autoconf >= 2.5.0, pkg-config
21
Valentina Manea04f7bb92014-03-08 14:53:36 +020022[Optional]
23 - hwdata
24 Contains USB device identification data.
25
matt mooney89415212011-06-16 02:24:59 -070026
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070027[Install]
matt mooney89415212011-06-16 02:24:59 -070028 0. Generate configuration scripts.
29 $ ./autogen.sh
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070030
matt mooney89415212011-06-16 02:24:59 -070031 1. Compile & install the userspace utilities.
32 $ ./configure [--with-tcp-wrappers=no] [--with-usbids-dir=<dir>]
33 $ make install
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070034
matt mooney89415212011-06-16 02:24:59 -070035 2. Compile & install USB/IP drivers.
36
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070037
38[Usage]
matt mooney89415212011-06-16 02:24:59 -070039 server:# (Physically attach your USB device.)
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070040
matt mooney220973d2011-05-14 03:55:12 -070041 server:# insmod usbip-core.ko
42 server:# insmod usbip-host.ko
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070043
44 server:# usbipd -D
matt mooney89415212011-06-16 02:24:59 -070045 - Start usbip daemon.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070046
matt mooney89415212011-06-16 02:24:59 -070047 server:# usbip list -l
48 - List driver assignments for USB devices.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070049
matt mooney89415212011-06-16 02:24:59 -070050 server:# usbip bind --busid 1-2
51 - Bind usbip-host.ko to the device with busid 1-2.
52 - The USB device 1-2 is now exportable to other hosts!
53 - Use `usbip unbind --busid 1-2' to stop exporting the device.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070054
matt mooney220973d2011-05-14 03:55:12 -070055 client:# insmod usbip-core.ko
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070056 client:# insmod vhci-hcd.ko
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070057
matt mooney89415212011-06-16 02:24:59 -070058 client:# usbip list --remote <host>
59 - List exported USB devices on the <host>.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070060
Kurt Kanzenbach80e4b942013-04-04 16:03:15 +020061 client:# usbip attach --remote <host> --busid 1-2
matt mooney89415212011-06-16 02:24:59 -070062 - Connect the remote USB device.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070063
matt mooney89415212011-06-16 02:24:59 -070064 client:# usbip port
65 - Show virtual port status.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070066
matt mooney89415212011-06-16 02:24:59 -070067 client:# usbip detach --port <port>
68 - Detach the USB device.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070069
70
matt mooney89415212011-06-16 02:24:59 -070071[Example]
72---------------------------
73 SERVER SIDE
74---------------------------
75Physically attach your USB devices to this host.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070076
matt mooney89415212011-06-16 02:24:59 -070077 trois:# insmod path/to/usbip-core.ko
78 trois:# insmod path/to/usbip-host.ko
79 trois:# usbipd -D
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -070080
matt mooney89415212011-06-16 02:24:59 -070081In another terminal, let's look up what USB devices are physically
82attached to this host.
matt mooney9abec452011-05-14 03:55:11 -070083
matt mooney45dd9a92011-07-07 00:31:55 -070084 trois:# usbip list -l
matt mooney89415212011-06-16 02:24:59 -070085 Local USB devices
86 =================
87 - busid 1-1 (05a9:a511)
88 1-1:1.0 -> ov511
matt mooney9abec452011-05-14 03:55:11 -070089
matt mooney89415212011-06-16 02:24:59 -070090 - busid 3-2 (0711:0902)
91 3-2:1.0 -> none
matt mooney9abec452011-05-14 03:55:11 -070092
matt mooney89415212011-06-16 02:24:59 -070093 - busid 3-3.1 (08bb:2702)
94 3-3.1:1.0 -> snd-usb-audio
95 3-3.1:1.1 -> snd-usb-audio
matt mooney9abec452011-05-14 03:55:11 -070096
matt mooney89415212011-06-16 02:24:59 -070097 - busid 3-3.2 (04bb:0206)
98 3-3.2:1.0 -> usb-storage
matt mooney9abec452011-05-14 03:55:11 -070099
matt mooney89415212011-06-16 02:24:59 -0700100 - busid 3-3 (0409:0058)
101 3-3:1.0 -> hub
matt mooney9abec452011-05-14 03:55:11 -0700102
matt mooney89415212011-06-16 02:24:59 -0700103 - busid 4-1 (046d:08b2)
104 4-1:1.0 -> none
105 4-1:1.1 -> none
106 4-1:1.2 -> none
matt mooney9abec452011-05-14 03:55:11 -0700107
matt mooney89415212011-06-16 02:24:59 -0700108 - busid 5-2 (058f:9254)
109 5-2:1.0 -> hub
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700110
matt mooney89415212011-06-16 02:24:59 -0700111A USB storage device of busid 3-3.2 is now bound to the usb-storage
112driver. To export this device, we first mark the device as
113"exportable"; the device is bound to the usbip-host driver. Please
114remember you can not export a USB hub.
matt mooney9abec452011-05-14 03:55:11 -0700115
matt mooney89415212011-06-16 02:24:59 -0700116Mark the device of busid 3-3.2 as exportable:
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700117
matt mooney89415212011-06-16 02:24:59 -0700118 trois:# usbip --debug bind --busid 3-3.2
119 ...
matt mooney45dd9a92011-07-07 00:31:55 -0700120 usbip debug: usbip_bind.c:162:[unbind_other] 3-3.2:1.0 -> usb-storage
121 ...
122 bind device on busid 3-3.2: complete
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700123
matt mooney89415212011-06-16 02:24:59 -0700124 trois:# usbip list -l
125 Local USB devices
126 =================
127 ...
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700128
matt mooney89415212011-06-16 02:24:59 -0700129 - busid 3-3.2 (04bb:0206)
130 3-3.2:1.0 -> usbip-host
131 ...
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700132
matt mooney89415212011-06-16 02:24:59 -0700133---------------------------
134 CLIENT SIDE
135---------------------------
136First, let's list available remote devices that are marked as
137exportable on the host.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700138
matt mooney89415212011-06-16 02:24:59 -0700139 deux:# insmod path/to/usbip-core.ko
140 deux:# insmod path/to/vhci-hcd.ko
141
142 deux:# usbip list --remote 10.0.0.3
matt mooney45dd9a92011-07-07 00:31:55 -0700143 Exportable USB devices
144 ======================
145 - 10.0.0.3
146 1-1: Prolific Technology, Inc. : unknown product (067b:3507)
147 : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-1
148 : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
149 : 0 - Mass Storage / SCSI / Bulk (Zip) (08/06/50)
matt mooney9abec452011-05-14 03:55:11 -0700150
matt mooney45dd9a92011-07-07 00:31:55 -0700151 1-2.2.1: Apple Computer, Inc. : unknown product (05ac:0203)
152 : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-2/1-2.2/1-2.2.1
153 : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
154 : 0 - Human Interface Devices / Boot Interface Subclass / Keyboard (03/01/01)
matt mooney9abec452011-05-14 03:55:11 -0700155
matt mooney45dd9a92011-07-07 00:31:55 -0700156 1-2.2.3: OmniVision Technologies, Inc. : OV511+ WebCam (05a9:a511)
157 : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-2/1-2.2/1-2.2.3
158 : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
159 : 0 - Vendor Specific Class / unknown subclass / unknown protocol (ff/00/00)
matt mooney9abec452011-05-14 03:55:11 -0700160
matt mooney45dd9a92011-07-07 00:31:55 -0700161 3-1: Logitech, Inc. : QuickCam Pro 4000 (046d:08b2)
162 : /sys/devices/pci0000:00/0000:00:1e.0/0000:02:0a.0/usb3/3-1
163 : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
164 : 0 - Data / unknown subclass / unknown protocol (0a/ff/00)
165 : 1 - Audio / Control Device / unknown protocol (01/01/00)
166 : 2 - Audio / Streaming / unknown protocol (01/02/00)
matt mooney9abec452011-05-14 03:55:11 -0700167
matt mooney89415212011-06-16 02:24:59 -0700168Attach a remote USB device:
matt mooney9abec452011-05-14 03:55:11 -0700169
Kurt Kanzenbach80e4b942013-04-04 16:03:15 +0200170 deux:# usbip attach --remote 10.0.0.3 --busid 1-1
matt mooney89415212011-06-16 02:24:59 -0700171 port 0 attached
matt mooney9abec452011-05-14 03:55:11 -0700172
matt mooney89415212011-06-16 02:24:59 -0700173Show the devices attached to this client:
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700174
matt mooney89415212011-06-16 02:24:59 -0700175 deux:# usbip port
176 Port 00: <Port in Use> at Full Speed(12Mbps)
177 Prolific Technology, Inc. : unknown product (067b:3507)
178 6-1 -> usbip://10.0.0.3:3240/1-1 (remote bus/dev 001/004)
179 6-1:1.0 used by usb-storage
180 /sys/class/scsi_device/0:0:0:0/device
181 /sys/class/scsi_host/host0/device
182 /sys/block/sda/device
matt mooney9abec452011-05-14 03:55:11 -0700183
matt mooney89415212011-06-16 02:24:59 -0700184Detach the imported device:
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700185
matt mooney89415212011-06-16 02:24:59 -0700186 deux:# usbip detach --port 0
187 port 0 detached
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700188
189
matt mooney89415212011-06-16 02:24:59 -0700190[Checklist]
191 - See 'Debug Tips' on the project wiki.
192 - http://usbip.wiki.sourceforge.net/how-to-debug-usbip
matt mooney220973d2011-05-14 03:55:12 -0700193 - usbip-host.ko must be bound to the target device.
matt mooney89415212011-06-16 02:24:59 -0700194 - See /proc/bus/usb/devices and find "Driver=..." lines of the device.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700195 - Shutdown firewall.
matt mooney89415212011-06-16 02:24:59 -0700196 - usbip now uses TCP port 3240.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700197 - Disable SELinux.
matt mooney89415212011-06-16 02:24:59 -0700198 - Check the kernel and daemon messages.
Takahiro Hirofuchi0945b4f2011-05-14 03:55:07 -0700199
200
201[Contact]
matt mooney89415212011-06-16 02:24:59 -0700202 Mailing List: linux-usb@vger.kernel.org