Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

usbip make its job: and udev?

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
hujuice
Guru
Guru
User avatar
Posts: 354
Joined: Tue Oct 16, 2007 12:57 pm
Location: Nicosia, Cyprus

usbip make its job: and udev?

  • Quote

Post by hujuice » Fri Oct 21, 2011 10:39 pm

Hello everybody.
I'm excited 8) (and at the same time I'm feeling uncultured :oops: ) playing with usbip.
I felt this application very interesting and I'm glad to share my story.
I need also some help. :roll:

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 driver
In the client's kernel, enable:

Code: Select all

Device Drivers  --->
    [*] Staging drivers  --->
        <M>   USB/IP support (EXPERIMENTAL)
        <M>     VHCI hcd[/i]
Rebuild your kernels as usually.

On both sides, emerge net-misc/usbip

Code: Select all

# echo "net-misc/usbip" >> /etc/portage/package.accept_keywords
# emerge net-misc/usbip
Take your favourite chair on the server side and do the following (as root).
('box' is my server's hostname.)

Load the module:

Code: Select all

box # modprobe usbip_host
Run 'usbipd'.
(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 $))
(The error message did not avoid the following, for me.)

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
Compare this list to 'lsusb' if you want:

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 M90
(Your lists will be different, obviously.)

Choose 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!
Now go to the client side chair (ssh from the same favourite) and do the following (as root).
('lap' is my client's hostname.)

Load the module:

Code: Select all

lap # modprobe vhci_hcd
Scan the server availability:

Code: 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)
Attach the device:

Code: Select all

lap # usbip --attach box 2-2
usbip err: vhci_attach.c: 586 (main        ) open usb.ids
8 ports available

port 0 attached
(An error message again, for me.)

Check 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>
Take a look to the new USB device:

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.
The 'ID 1058:0740 Western Digital Technologies, Inc.' device is available on the client side.

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
Those who lack character must at least have a method.
Chi non ha carattere, deve pur avere un metodo.
Top
zwheel
n00b
n00b
Posts: 8
Joined: Fri Mar 07, 2008 3:10 pm
Location: Toledo, OH

Going to try it

  • Quote

Post by zwheel » Tue Feb 14, 2012 4:13 pm

I hope to get around to trying this soon. It's too bad that nobody has replied to finish this yet, maybe I'll get it figured out and finish it myself.

Besides making this all happen automatically with init scripts, udev rules, etc... I am wondering... is it possible for the shared device to be a hub? Could I just plug a hub into the server, designate that hub as 'remote' and anything I plug into it shows up at the client instead of 'locally' at the server?

That's what I want usb over ip for. I want to make an X-terminal with usb ports and when you use the usb ports the devices are seen by the remote machine. I want it to feel just like everything is being done locally even though it isn't.
Top
Post Reply

2 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic