LINUX.ORG.RU

Есть ли в Linux такая вещь как проброс USB по IP-сеть


0

0

Суть такова… У меня есть USB-устройство на хосте A, а нужно его пробросить на хост B используя IP-сеть. По сути нужно USB over IP. Есть ли такое в Linux? (оба хоста работают под Ubuntu 9.10)

/R/еквестирутся ПО под OSI-совместимой лицензией для USB over IP, с меня как обычно — /dev/zero.

Дискач.

★★★★★

Description: USB device sharing system over IP network
 USB/IP is a system for sharing USB devices over the network.
 .
 To share USB devices between computers with their full
 functionality, USB/IP encapsulates "USB requests" into IP
 packets and transmits them between computers.
 .
 Original USB device drivers and applications can be used
 for remote USB devices without any modification of them. A
 computer can use remote USB devices as if they were
 directly attached.
 .
 Currently USB/IP provides no access control or encryption.
 It should only be used in trusted environments.
 .
 USB/IP requires kernel support which is included in Linux
 kernels 2.6.28 or newer.
 
Homepage: http://"Not you personal LOR army".sourceforge.net/
sdio ★★★★★
()
sanja@amigo:~$ apt-cache show usbip
Package: usbip
Priority: optional
Section: universe/admin
Installed-Size: 136
Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
Original-Maintainer: Max Vozeler <xam@debian.org>
Architecture: i386
Version: 0.1.7-3
Depends: libc6 (>= 2.7), libglib2.0-0 (>= 2.12.0), libsysfs2, libusbip0, usbutils
Filename: pool/universe/u/usbip/usbip_0.1.7-3_i386.deb
Size: 28650
MD5sum: 9a0e689f263c712b0518d5b6776e1e88
SHA1: c66b084fc9bc2d253c1c40b2173c0a3894bb4e97
SHA256: 519dcbc76cbacb4566d2e58c23324f555d1bbecd3bd80858301da667711d6e1c
Description: USB device sharing system over IP network
 USB/IP is a system for sharing USB devices over the network.
 .
 To share USB devices between computers with their full
 functionality, USB/IP encapsulates "USB requests" into IP
 packets and transmits them between computers.
 .
 Original USB device drivers and applications can be used
 for remote USB devices without any modification of them. A
 computer can use remote USB devices as if they were
 directly attached.
 .
 Currently USB/IP provides no access control or encryption.
 It should only be used in trusted environments.
 .
 USB/IP requires kernel support which is included in Linux
 kernels 2.6.28 or newer.
 .
 This package provides the server component 'usbipd' and the
 client tool 'usbip'.
Homepage: http://usbip.sourceforge.net/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
novitchok ★★★★★
()

От root вбиваешь следующие команды (серверная часть):

apt-get install usbip
modprobe -v usbip_common_mod
modprobe -v usbip
usbipd -D

Затем, чтобы посмотреть какие ус-ва есть на USB-шине вбиваешь:

usbip_bind_driver --list

И получаешь следующий выхлоп

List USB devices
- busid 1-5 (05e3:0760)
1-5:1.0 -> usb-storage

И т.д.

Чтобы расшарить ус-во с VIP:PID 05e3:0760 вбиваешь

usbip_bind_driver --usbip 1-5

Для клиента(IP-адрес сервера — 10.0.2.2):

apt-get install usbip
modprobe -v usbip_common_mod
modprobe -v vhci-hcd

Если ввести dmesg, то получишь:

[ 132.655401] vhci_hcd: vhci_hcd, 1.0
[ 132.655487] usbip: proving...
[ 132.655494] vhci_hcd vhci_hcd: USB/IP Virtual Host Contoroller
[ 132.655704] vhci_hcd vhci_hcd: new USB bus registered, assigned bus number 1
[ 132.657612] usb usb1: configuration #1 chosen from 1 choice
[ 132.657669] hub 1-0:1.0: USB hub found

Затем вбиваешь:

usbip --list 10.0.2.2

И видишь следующие:

- 10.0.2.2
1-5: Genesys Logic, Inc. : USB 2.0 Card Reader/Writer (05e3:0760)
: /sys/devices/pci0000:00/0000:00:02.1/usb1/1-5
: (Defined at Interface level) (00/00/00)
: 0 - Mass Storage / SCSI / Bulk (Zip) (08/06/50)

Для подключения устройства вбиваешь:

usbip --attach 10.0.2.2 1-5

И всё. Так кстати можно получить USB в VirtualBox OSE.

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.