I'm excited
I felt this application very interesting and I'm glad to share my story.
I need also some help.
usbip makes the interesting job to share a USB device over the network.
For instance, you can "connect" a remote webcam to a local client.
My attempt was successful, but I need some help managing udev.
Take this post as an unfinished 'howto' and, please, help me (us) to perform the last task.
Here begins the good part.
I tried to share a USB HDD between two 3.0.6 kernels.
Let's call server the host where the USB device is attached in and client the host where I want to use it.
In the server's kernel, enable the following drivers:
Code: Select all
Device Drivers --->
[*] Staging drivers --->
<M> USB/IP support (EXPERIMENTAL)
<M> Host driverCode: Select all
Device Drivers --->
[*] Staging drivers --->
<M> USB/IP support (EXPERIMENTAL)
<M> VHCI hcd[/i]On both sides, emerge net-misc/usbip
Code: Select all
# echo "net-misc/usbip" >> /etc/portage/package.accept_keywords
# emerge net-misc/usbip('box' is my server's hostname.)
Load the module:
Code: Select all
box # modprobe usbip_host(It is not installed as service, just a daemon hanging in your console. The -D option frees your shell. It will be easy to write an initscript.)
Code: Select all
box # usbipd -D
usbip err: stub_server.c: 433 (do_standalone_mode) open usb.ids
listen at [0.0.0.0]:3240
usbipd start (usbip 0.1.7 ($Id: stub_server.c 42 2007-09-07 12:07:51Z hirofuchi $))Run the 'bind_driver' tools:
Code: Select all
box # bind_driver --list
List USB devices
- busid 1-1 (046d:0805)
1-1:1.0 -> uvcvideo
1-1:1.1 -> uvcvideo
1-1:1.2 -> snd-usb-audio
1-1:1.3 -> snd-usb-audio
- busid 1-4 (15a4:9016)
1-4:1.0 -> none
1-4:1.1 -> none
- busid 2-2 (1058:0740)
2-2:1.0 -> none
- busid 4-1 (12d1:1003)
4-1:1.0 -> option
4-1:1.1 -> option
4-1:1.2 -> usb-storage
- busid 4-3 (046d:c31c)
4-3:1.0 -> usbhid
4-3:1.1 -> usbhid
- busid 4-6 (046d:0a12)
4-6:1.0 -> snd-usb-audio
4-6:1.1 -> snd-usb-audio
4-6:1.2 -> snd-usb-audio
4-6:1.3 -> usbhid
- busid 3-3 (046d:c05a)
3-3:1.0 -> usbhid
Code: Select all
box ~ # lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 046d:0805 Logitech, Inc. Webcam C300
Bus 001 Device 004: ID 15a4:9016 Afatech Technologies, Inc. AF9015 DVB-T USB2.0 stick
Bus 002 Device 003: ID 1058:0740 Western Digital Technologies, Inc.
Bus 004 Device 002: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270 HSDPA/HSUPA Modem
Bus 004 Device 003: ID 046d:c31c Logitech, Inc. Keyboard K120 for Business
Bus 004 Device 004: ID 046d:0a12 Logitech, Inc.
Bus 003 Device 002: ID 046d:c05a Logitech, Inc. Optical Mouse M90Choose a device to share. For me, it was the 2-2:
Code: Select all
box # bind_driver --usbip 2-2
** (process:12762): DEBUG: 2-2:1.0 -> usb-storage
** (process:12762): DEBUG: unbinding interface
** (process:12762): DEBUG: write "add 2-2" to /sys/bus/usb/drivers/usbip/match_busid
** Message: bind 2-2 to usbip, complete!('lap' is my client's hostname.)
Load the module:
Code: Select all
lap # modprobe vhci_hcdCode: Select all
lap # usbip --list box
usbip err: vhci_attach.c: 586 (main ) open usb.ids
- box
2-2: unknown vendor : unknown product (1058:0740)
: /sys/devices/pci0000:00/0000:00:04.1/usb2/2-2
: (Defined at Interface level) (00/00/00)
: 0 - unknown class / unknown subclass / unknown protocol (08/06/50)Code: Select all
lap # usbip --attach box 2-2
usbip err: vhci_attach.c: 586 (main ) open usb.ids
8 ports available
port 0 attachedCheck the mentioned 'port 0:
Code: Select all
lap # usbip --port
usbip err: vhci_attach.c: 586 (main ) open usb.ids
8 ports available
Port 00: <Port in Use> at High Speed(480Mbps)
unknown vendor : unknown product (1058:0740)
9-1 -> usbip://box:3240/2-2 (remote devid 00020003 (bus/dev 002/003))
9-1:1.0 used by usb-storage
/sys/devices/platform/vhci_hcd/usb9/9-1/9-1:1.0/host10/scsi_host/host10/device
Port 01: <Port Available>
Port 02: <Port Available>
Port 03: <Port Available>
Port 04: <Port Available>
Port 05: <Port Available>
Port 06: <Port Available>
Port 07: <Port Available>Code: Select all
lap # lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 05c8:010f Cheng Uei Precision Industry Co., Ltd (Foxlink)
Bus 007 Device 002: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth + WLAN) Interface [Integrated Module]
Bus 009 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 009 Device 013: ID 1058:0740 Western Digital Technologies, Inc.Here ends the good part.
And here is my ignorance and my frustration, because I'm unable to write rules to make udev prepare the corresponding device.
No hotplug, and the 'ls /dev/sd*' command didn't give anything new for me.
How to make the remote USB device really usable?
How to make this half 'howto' a full 'howto'?
Regards,
HUjuice

