Usbip error unable to bind device on

Настройка USB-сервера Ubuntu на базе usbip В инструкции описан процесс настройки бесплатного решения для редиректа USB устройства с сервера на любой другой компьютер сети. Это может пригодиться, например, для проброса USB токена на виртуальную машину или несетевого принтера. В рамках примера сервер будет на Linux Ubuntu, клиент — на Windows (проверено на 7, 10, […]

Содержание

  1. Настройка USB-сервера Ubuntu на базе usbip
  2. Установка и запуск
  3. Настройка клиента
  4. Автозапуск
  5. Автозапуск сервера
  6. Автозапуск клиента Windows
  7. Возможные проблемы
  8. 1. usbip_common_mod.ko and usbip.ko must be loaded
  9. 2. /usr/sbin/usbipd: No such file or directory
  10. 3. usbip: error: failed to open /usr/share/hwdata//usb.ids
  11. 4. usbip err . recv op_common
  12. 5. (attach_device) cannot find device
  13. 6. udev_device_new_from_subsystem_sysname failed
  14. Arch Linux
  15. #1 2020-07-15 21:07:36
  16. usbip-5.7 isn’t working
  17. #2 2020-07-16 00:03:37
  18. Re: usbip-5.7 isn’t working
  19. #3 2020-07-16 00:15:55
  20. Re: usbip-5.7 isn’t working
  21. #4 2020-07-21 00:59:01
  22. Re: usbip-5.7 isn’t working
  23. #5 2020-07-30 14:05:39
  24. Re: usbip-5.7 isn’t working
  25. #6 2020-07-30 14:36:24
  26. Re: usbip-5.7 isn’t working
  27. The USB/IP Project Discussion
  28. Forums
  29. install usbip on centos 7
  30. Укрощаем USB/IP
  31. Часть первая, историческая
  32. Часть вторая, серверно-линуксовая
  33. Часть третья, клиентская и запутанная

Настройка USB-сервера Ubuntu на базе usbip

В инструкции описан процесс настройки бесплатного решения для редиректа USB устройства с сервера на любой другой компьютер сети. Это может пригодиться, например, для проброса USB токена на виртуальную машину или несетевого принтера. В рамках примера сервер будет на Linux Ubuntu, клиент — на Windows (проверено на 7, 10, Server 2008 и 2012).

Установка и запуск

В Ubuntu установка инструмента проброса USB выполняется следующей командой:

apt-get install linux-tools-`uname -r`

* в моем случае была выполнена установка linux-tools-4.4.0-128-generic, где 4.4.0-128-generic — версия ядра, используемого в Ubuntu.

Подгружаем модули драйверов USB:

Запускаем usbip в качестве демона:

Смотрим список подключенных USB устройств:

root@usb:/usr/src# usbip list -l
— busid 2-1.3 (8564:1000)
Transcend Information, Inc. : JetFlash (8564:1000)

— busid 2-1.4 (1c4f:0026)
SiGma Micro : Keyboard (1c4f:0026)

Теперь можно расшарить флешку:

usbip bind -b 2-1.3

Должны увидеть на подобие:

usbip: info: bind device on busid 2-1.3: complete

Настройка клиента

Выполним настройку на базе операционной системы Windows.

Скачиваем драйвер и утилиту для Windows. Распаковываем архив usbip.zip.

Открываем диспетчер устройств (команда devmgmt.msc или правой кнопкой по Этот компьютер в проводнике — УправлениеДиспетчер устройств).

Кликаем по ДействиеУстановить старое устройство:

Выбираем ручную установку устройства — показать все устройства — Установка с диска и выбираем файл USBIPEnum.inf (находится в каталоге usbip, который мы распаковали ранее).

Будет обнаружено устройство USB/IP Enumerator — кликаем Далее, чтобы его установить. Мы должны его увидеть среди системных устройств.

Теперь открываем командную строку (cmd.exe) и переходим в распакованный каталог, например:

* где C:UsersuserDownloadsusbip — полный путь до папки.

Смотрим список расшаренных USB устройств на сервере:

usbip -l 192.168.0.15

* где 192.168.0.15 — IP-адрес сервера USB.

Мы получим ответ, на подобие этого:

C:UsersuserDownloadsusbip>usbip -l 192.168.0.15
— 192.168.0.15
2-1.3: unknown vendor : unknown product (8564:1000)
: /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3
: (Defined at Interface level) (00/00/00)

Теперь можно примонтировать устройство:

usbip.exe -a 192.168.0.15 2-1.3

* если увидим ошибку . cannot find device, переходим к решению.

Автозапуск

Данная инструкция предполагала разовый запуск как сервера, так и клиента. После перезапуска системы, работоспособность будет потеряна до повторного ввода команд. Попробуем настроить автоматический запуск сервера и клиента.

Автозапуск сервера

Добавляем модули в автозапуск:

usbip-core
usbip-host
vhci-hcd

Создаем юнит в systemd:

[Service]
ExecStart=/scripts/usbipd
Type=oneshot
RemainAfterExit=yes

Перечитываем конфигурацию systemd и разрешаем запуск созданного нами юнита:

systemctl enable usbipd

Создаем каталог хранения скрипта и сам скрипт:

usbipd -D
usbip bind -b $bindID

usbip attach —remote=localhost —busid=$bindID
sleep 2
usbip detach —port=00

Разрешаем запуск скрипта:

chmod +x /scripts/usbipd

systemctl start usbipd

systemctl status usbipd

Для окончательного тестирования можно перезагрузить сервер.

Автозапуск клиента Windows

Пишем небольшой батник:

cd C:UsersuserDownloadsusbip
usbip.exe -a 192.168.0.15 2-1.3

* C:UsersuserDownloadsusbip — путь, где хранится распакованная утилита; 192.168.0.15 — адрес сервера USB; 2-1.3 — идентификатор USB устройства на сервере.

Сохраняем скрипт с расширением bat или cmd. Запускаем планировщик заданий и добавляем новую задачу.

На вкладке Общие отмечаем Выполнять вне зависимости от регистрации пользователя и ставим галочку Выполнить с наивысшими правами:

В триггерах выбираем При запуске системы:

На вкладке Действия выбираем Запуск программы и прописываем путь до скрипта, который мы сохранили ранее:

На вкладке Параметры ставим галочку При сбое выполнения перезапускать через и снимаем галочку Останавливать задачу, выполняемую дольше:

Для проверки, можно запустить вручную задачу на исполнение или перезагрузить компьютер.

Возможные проблемы

1. usbip_common_mod.ko and usbip.ko must be loaded

Ошибка появляется при попытке выполнить usbipd -D.

Причина: был установлен пакет usbip вместо linux-tools- .

Решение: удаляем usbip:

apt-get remove usbip

Ставим нужный пакет:

apt-get install linux-tools-`uname -r`

2. /usr/sbin/usbipd: No such file or directory

Данная ошибка также появляется при попытке выполнить usbipd -D.

Причина: Нужный бинарник для запуска находится по другому пути — /usr/bin/usbipd.

Решение: создаем симлинк:

ln -s /usr/bin/usbipd /usr/sbin/usbipd

Выскакивает при попытке посмотреть список устройств командой usbip list -l.

Причина: необходимый файл usb.ids находится в другой директории.

Решение: создаем каталог /usr/share/hwdata:

Создаем симлинк на существующий файл:

ln -s /usr/share/misc/usb.ids /usr/share/hwdata/usb.ids

4. usbip err . recv op_common

При попытке запустить утилиту в командной строке Windows получаем ошибки:

usbip err: usbip_network.c: 121 (usbip_recv_op_common) recv op_common, -1
usbip err: usbip.c: 216 (query_exported_devices) recv op_common
usbip err: usbip.c: 288 (show_exported_devices) query

Причина: ошибка в бинарном файле для Windows.

Решение: открыть exe-файл в HEX редакторе, например, HxD. И в адресах смещения 00000CBC и 00000E0A заменить 06 на 11:

5. (attach_device) cannot find device

При попытке монтирования устройства в Windows, выскакивает ошибка с похожим текстом:

usbip err: usbip_windows.c: 829 (attach_device) cannot find device

Причина: недоработка серверного ПО — при расшаривании USB не считывается количество дескрипторов.

Решение: примонтировать устройство на сервере с последующим отмонтированием:

usbip attach —remote=localhost —busid=2-1.3

* в моем случае устройство имеет идентификатор 2-1.3.

* смотрим номер порта, на котором висит наше примонтированное устройство.

usbip detach —port=00

6. udev_device_new_from_subsystem_sysname failed

При попытке монтирования устройства на клиенте получаем ошибку с текстом:

libusbip: error: udev_device_new_from_subsystem_sysname failed
usbip: error: open vhci_driver
usbip: error: query

Причина: не подключен модуль vhci-hcd.

Решение: разово выполняем команду:

и добавляем в файл /etc/modules строку vhci-hcd.

Источник

Arch Linux

You are not logged in.

#1 2020-07-15 21:07:36

usbip-5.7 isn’t working

Followed instructions from the WIKI

I tried on two x86_64 hosts and one armv7h (kernel 4.19) rpi3 and none worked.

Help is appreciated.

Last edited by dmorilha (2020-07-15 21:08:39)

#2 2020-07-16 00:03:37

Re: usbip-5.7 isn’t working

Ipod shuffles aren’t often plain USB accessible devices, so I’m not surprised. Do you have any sources on why that would/should work? Have you tried with a plain USB stick?

Last edited by V1del (2020-07-16 00:04:29)

#3 2020-07-16 00:15:55

Re: usbip-5.7 isn’t working

This generation actually is, that’s why I still keep them around. Anyways, I tried with other devices and they all fail at the same point:

#4 2020-07-21 00:59:01

Re: usbip-5.7 isn’t working

This isn’t as much help as it is commiseration.

I’m getting similar errors. This is the first time I’ve actually tried messing with usb/ip, and I’ve only experienced a failed result, so I’m anxious to get it working.

The format of the busids on this particular computer differ from those on my laptop (also Arch), which is more of the x.y-z format. The errors are the same on both.

I also would appreciate some help on this topic. This functionality is built into the linux kernel. I’m delving into understanding whether this is related to the linux kernel, or the usbip package installed with pacman. For the record, though:

#5 2020-07-30 14:05:39

Re: usbip-5.7 isn’t working

As luck would have it, I also wanted to try this out the first time, just to fall straight to this error

I have a virtualbox machine with 5.4.50-1-lts, the error does not happen there. At least, I can bind a device without the «write_sysfs_attribute» error.

This would match well with the idea that things worked till kernel 5.6 — as stated on this bug report

#6 2020-07-30 14:36:24

Re: usbip-5.7 isn’t working

I just switched to the currently available linux-lts 5.4.53-1, and was able to use my scanner over the home network.
A steady stream of about 28 mbps is visible on the client machine.

Источник

The USB/IP Project Discussion

Forums

install usbip on centos 7

i’m new to linux, and i’m using Centos 7. it will be of great help to me, if you can inform me on how to install usbip on Centos. i did google for this, but then i got blogs where the installation is done using apt-get.
but this command does not work on Centos, and i need to use yum.
i tried «yum install usbip» — i did not download any rpm as the webpage said that the source code is part of the mainstream code after kernel 3.7.

will be great if someone can help me install usbip.

the «yum install usbip» command gives «No package usbip* available»

Hi, i’m waiting for a response that would help me progress..

Hi Priya. As you have read, different distributions offer different ways of installing and using USBIP. I’m not used to CentOS, I’m using ArchLinux. On Arch, the module is installed by default with the kernel, while we need to install the userspace tools from the usbip package.

On CentOS, I would be tempted to think the userspace tools must be installed in a similar way with usbip-utils package: https://centos.pkgs.org/7/elrepo-x86_64/usbip-utils-1.0.1-2.el7.elrepo.x86_64.rpm.html. About the kernel module, I would have a look at kmod-usbip package: https://centos.pkgs.org/7/elrepo-x86_64/kmod-usbip-1.0.1-2.el7_5.elrepo.x86_64.rpm.html

Hi Alexandre,
Thanks a bunch for the reply. but i need more guidance. i was able to install usbip-utils and kmod-usbip rpms. but after that, when i execute the command to load the modules, i get a Fatal error stating the module is not found. i tried:
modprobe usbip
modprobe usbip_host
modprobe usbip_common_mod.

but then, i’m also confused as to which modules to load. i also read through the Readme file for linux, and there, it asks for some requirements, and asks to perform some compilations.:
[Requirements]
— USB/IP device drivers
Its source code is included under $(top)/drivers/.

[Install]
0. Skip here if you see a configure script.
$ ./autogen.sh

i’m not sure how to deal with these. If you could help me in what i need to do to completely get the usbip working, it will be great.

Well, you shouldn’t have to go through the kernel steps: by installing the two packages, you now have the modules (should at least) and the userspace tools.

Did you reboot since you installed the packages?

i am not able to proceed. the kernel version on my Centos is 4.20.2-1.el7.elrepo.x86_64.
I ran the commands to install elrepo, and that was successful.

then i installed the packages as below:
[root@linuxci

] # yum install kmod-usbip
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.mirror.net.in
* elrepo: mirror-hk.koddos.net
* extras: centos.mirror.net.in
* updates: centos.mirror.net.in
Package kmod-usbip-1.0.1-3.el7_6.elrepo.x86_64 already installed and latest version
Nothing to do
[root@linuxci

] # yum install usbip-utils
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.mirror.net.in
* elrepo: mirror-hk.koddos.net
* extras: centos.mirror.net.in
* updates: centos.mirror.net.in
Package usbip-utils-1.0.1-2.el7.elrepo.x86_64 already installed and latest version
Nothing to do

After this i tried to load the modules:
[root@linuxci

] # pwd
/root
[root@linuxci

] # sudo modprobe usbip-core
modprobe: FATAL: Module usbip-core not found.
[root@linuxci

] # sudo modprobe usbip
modprobe: FATAL: Module usbip not found.

i tried the below command too:
[root@linuxci

] # insmod usbip-core.ko
insmod: ERROR: could not load module usbip-core.ko: No such file or directory

i do not know where i’m lost. can u guide me here? i also upgraded the kernel to the latest version. and also rebooted the system.

Источник

Укрощаем USB/IP

Часть первая, историческая

Если машина виртуальная — всё это несложно. Функционал проброса USB от хоста в виртуалку появился еще в VMWare 4.1. Но в моём случае ключик защиты, опознающийся как WIBU-KEY, нужно было в разное время подключать к разным машинам, и не только виртуальным.
Первый виток поиска в далеком 2009-м году привел меня к железке под названием TrendNet TU2-NU4
Плюсы:

  • работает не всегда. Допустим, ключ защиты Guardant Stealth II через неё не заводится, ругаясь ошибкой «устройство не может быть запущено».
  • ПО для управления (читай — монтирования и размонтирования USB-устройств) убого до крайности. Ключи командной строки, автоматизация — не, не слышали. Всё только руками. Кошмар.
  • управляющее ПО ищет саму железку в сети широковещанием, поэтому работает это только в пределах одного broadcast-сегмента сети. Указать IP-адрес железки руками нельзя. Железка в другой подсети? Тогда у вас проблема.
  • разработчики забили на устройство, слать баг-репорты бесполезно.

Второй виток случился во времена уже не столь отдаленные, и привел меня к теме статьи — USB/IP project. Привлекает открытостью, тем более, что ребята из ReactOS подписали им драйвер для Windows, так что теперь даже на x64 всё работает без всяких костылей вроде тестового режима. За что команде ReactOS огромное спасибо! Звучит всё красиво, попробуем пощупать, так ли оно на деле? К сожалению, сам проект тоже подзаброшен, и на поддержку рассчитывать не приходится — но где наша не пропадала, исходник есть, разберемся!

Часть вторая, серверно-линуксовая

Сервер USB/IP, расшаривающий USB-девайсы по сети, может быть поднят только в Linux-based OS. Ну что ж, линукс так линукс, устанавливаем на виртуалку Debian 8 в минимальной конфигурации, стандартное движение руками:

Установились. Дальше интернет подсказывает, что нужно бы загрузить модуль usbip, но — здравствуйте, первые грабли. Нет такого модуля. А всё оттого, что большинство руководств в сети относятся к более старой ветке 0.1.x, а в крайней 0.2.0 модули usbip имеют другие названия.

Ну и добавим в /etc/modules такие строки, чтобы загружать их автоматически при старте системы:

Запустим сервер usbip:

Дальше всемирный разум нам подсказывает, что в комплекте с usbip идут скрипты, позволяющие нам управлять сервером — показать, какое устройство он будет расшаривать по сети, посмотреть статус, и так далее. Тут нас поджидает еще один садовый инструмент — эти скрипты в ветке 0.2.x, опять же, переименованы. Получить список команд можно с помощью

Почитав описание команд, становится понятно, что для того, чтобы расшарить требуемый USB-девайс, usbip хочет узнать его Bus ID. Уважаемые зрители, на арене грабли номер три: тот Bus ID, который выдаст нам lsusb (казалось бы, самый очевидный путь) — ей не подходит! Дело в том, что железки вроде USB-хабов usbip игнорирует. Поэтому, воспользуемся встроенной командой:

Примечание: здесь и далее в листингах я буду всё описывать на примере моего конкретного USB-ключа. Ваши название железки и пара VID:PID могут и будут отличаться. Моя называется Wibu-Systems AG: BOX/U, VID 064F, PID 0BD7.

Теперь мы можем расшарить наше устройство:

Троекратное ура, товарищи! Сервер расшарил железку по сети, и мы можем её подключать! Осталось только дописать автозапуск демона usbip в /etc/rc.local

Часть третья, клиентская и запутанная

Подключить расшаренное устройство по сети к машине под управлением Debian я попробовал сразу же на том же сервере, и всё прекрасно подключилось:

Переходим к Windows. В моем случае это был Windows Server 2008R2 Standard Edition. Официальное руководство просит сначала установить драйвер. Процедура прекрасно описана в прилагаемом к windows-клиенту readme, делаем всё как написано, всё получается. На XP тоже работает без каких-либо трудностей.

Распаковав клиент, пробуем примонтировать наш ключик:

Ой-ой. Что-то пошло не так. Используем навык гугла. Встречаются отрывочные упоминания, что что-то там не так с константами, в серверной части разработчики при переходе на версию 0.2.0 изменили версию протокола, а вот в клиенте под Win сделать это забыли. Предлагаемое решение — поменяйте константу в исходнике и пересоберите клиент.

Вот только очень мне не хочется качать Visual Studio ради этой процедуры. Зато у меня есть старый-добрый Hiew. В исходнике константа объявлена как двойное слово. Поищем в файле 0х00000106, заменяя на 0х00000111. Не забываем, порядок байт обратный. Итог — два совпадения, патчим:

На этом можно было бы закончить изложение, но музыка играла недолго. Перезагрузив сервер, я обнаружил, что устройство на клиенте не монтируется!

И всё. На это мне не смог ответить даже всезнающий гугл. А при этом команда отобразить доступные на сервере устройства вполне корректно показывает — вот он, ключ, можете монтировать. Пробую примонтировать из-под Linux — работает! А если теперь попробовать из-под Windows? О ужас — это работает!

Источник

  • Печать

Страницы: [1]   Вниз

Тема: USBIP  (Прочитано 6284 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
RW1R

Всем доброго времени суток!
Столкнулся с проблемой проброса USB over IP, а если точнее, то с настройкой/установкой USBIP. Гуглеж ответов на мои вопросы не нашел, поэтому обращаюсь к Вам, коллеги!

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"

Устанавливаю USBIP следующим образом:
1)

sudo modprobe usbip-host2)

sudo modprobe usbip-core3) стартую демон

sudo usbipd -D
и тут вылазит вот это:

usbip err: stub_driver.c:  33 (open_sysfs_stub_driver) usbip_common_mod.ko and usbip.ko must be loaded

** (process:20029): ERROR **: driver open failed
Ловушка трассировки/останова

Соответственно дальше все тщетно…

Подскажите куда пихать когда первый раз, что делать?


Punko

насколько я могу понять, не хватает нужных модулей ядра.


Оффлайн
RW1R

Насколько я понял, в репах лежит битая (или нерабочая) версия usbip. Гуглеж вывел меня вот на это: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/898003, пост № 34. Запустил — работает, во всяком случае ошибок не вылезает, но теперь другая проблема:

usbip list -r Х.Х.Х.Х
usbip: error: could not connect to Х.Х.Х.Х:3240: System error
Пытался посмотреть девайсы на удаленной машине через Хамачи, возможно дело в нем, вечером проверю по локалке.

« Последнее редактирование: 08 Сентября 2016, 12:09:02 от RW1R »


Punko

RW1R,

Насколько я понял, в репах лежит битая (или нерабочая) версия usbip

возможно, баг даже не присоединили ни к кому, хотя он уже и старый.
Возможно, надо мейнтейнеров пинать, чтоб что-то изменилось.


Оффлайн
RW1R

По локалке, к сожалению, та же беда. Подскажите, нужно ли конфигурировать клиента, для того, чтобы расшарить usb?


Пользователь добавил сообщение 08 Сентября 2016, 22:14:52:


Разобрался! It works!))
Делал так:
1)

usbipd -D — Стартанул демона
2)

netstat -alpt | grep usbipd
ответ:

tcp        0      0 *:3240                  *:*                     LISTEN      25989/usbipd   
tcp6       0      0 [::]:3240               [::]:*                  LISTEN      25989/usbipd   

3) Открыл порт в фаерволле (иначе не заработает):

iptables -I INPUT -p tcp -m tcp --dport 3240 -j ACCEPT
4)

usbip list -lОтвет:

- busid 3-2 (0951:1665)
   Kingston Technology : Digital DataTraveler SE9 64GB (0951:1665)
...

5) На клиенте и сервере делаем так:

sudo modprobe vhci-hcd
6) Биндим нужный девайс:

usbip bind -b 3-2Ответ:

usbip: info: bind device on busid 3-2: complete
7) С удаленной машины делаем так:

usbip list -r Х.Х.Х.Х

« Последнее редактирование: 11 Сентября 2016, 13:55:33 от RW1R »


Оффлайн
jester81

День добрый, принимайте еще одного новичка )))
у меня так жене получалось эту программу настроить
строил немного иначе:

Мне нужно пробросить по сети ЮЗБ с ЛИНУКСОВОЙ МАШИНЫ ( Xubuntu 12)  на виндовую машину, Чтоб работать
 виндовыми программами с устройствами на ЛИНУКС машине

Устанавливаю USBIP по вот этой инструкции(ниже):

**************************************************
https://m.habrahabr.ru/post/177647/?mobile=yes

1. Установка серверной части USBIP.
Шаги установки/настройки ubuntu 12.04 server я пропущу.
1.1 Для начала требуется обновить систему.

sudo apt-get update && sudo apt-get dist-upgrade -y

1.2 Добавим репозиторий с usbip. Пакет есть и в стандартном репозитории, но там он оказался не рабочим.

sudo add-apt-repository ppa:whoopie79/ppa

1.3 Установим пакет usbip и включим нужные модули.

sudo apt-get install usbip -y
modprobe usbip-core
modprobe usbip-host

(можно и sudo modprobe vhci-hcd) тоже работает

1.4 Добавим нужные модули в автозагрузку. Для этого откроем файл /etc/modules в редакторе

sudo nano /etc/modules

и в конец добавим

usbip-core
usbip-host

можно и vhci-hcd

1.5 Создадим init.d скрипт. Для этого скопируем /etc/init.d/skeleton

cp /etc/init.d/skeleton /etc/init.d/usbip

Далее отредактируем строки в /etc/init.d/usbip

DESC=»usbip»
NAME=»usbipd»    (иногда на форумах видел без кавычек в этой строке)
DAEMON_ARGS=»-D»

После этого дадим права файлу

sudo chmod 755 /etc/init.d/usbipd

1.6 Добавим init.d скрипт в автозагрузку.

sudo update-rc.d usbipd defaults

1.7 Пришло время запустить usbip на сервере, для этого запустим команду в консоли

sudo /etc/init.d/usbipd start

Если команда не выдала ошибок, то все прошло удачно и можно приступать к пробросу usb устройства.

Вот тут у меня проблема, не стартует.
Пишет вот что:

/usr/sbin/usbipd: symbol lookup error: /usr/sbin/usbipd: undefined symbol: stub_driver

А если запустить так:
usbipd -D  — то вроде бы как запускается и в пямяти висит даже(TOP запускаю и смотрю)
команда: lsof -i:3240
выдает:
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
usbipd  3082 root    4u  IPv4  18171      0t0  TCP *:3240 (LISTEN)
usbipd  3082 root    5u  IPv6  18172      0t0  TCP *:3240 (LISTEN)

видимо порт3240 открыт и случается

Команда: usbip list -l
ВЫДАЛА устройства:
usbip: error: failed to open /usr/share/hwdata//usb.ids
Local USB devices
=================
 — busid 1-1 (8087:0024)
   unknown vendor : unknown product (8087:0024)
         1-1:1.0 -> hub

 — busid 1-1.1 (079b:0028)
   unknown vendor : unknown product (079b:0028)
         1-1.1:1.0 -> cdc_acm
         1-1.1:1.1 -> cdc_acm

 — busid 1-1.2 (15d9:0a4f)
   unknown vendor : unknown product (15d9:0a4f)
         1-1.2:1.0 -> usbhid

 — busid 1-1.3 (03eb:6119)
   unknown vendor : unknown product (03eb:6119)
         1-1.3:1.0 -> cdc_acm
         1-1.3:1.1 -> cdc_acm

 — busid 2-1 (8087:0024)
   unknown vendor : unknown product (8087:0024)
         2-1:1.0 -> hub

ВОТ МОИ УСТРОЙСТВА В РЕАЛЕ: # lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 03eb:6119 Atmel Corp. AT91SAM CDC Demo Application
Bus 001 Device 004: ID 15d9:0a4f Trust International B.V.
Bus 001 Device 003: ID 079b:0028 Sagem
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

мне бы достучаться хотя бы до …. Bus 001 Device 005: ID 03eb:6119 Atmel Corp. AT91SAM CDC Demo Application

но винда так подключится и не смогла по сети к линукс машине (но это позже)

Откуда вот эта ошибка ?
ПРИ ЗАПУСКЕ:  sudo /etc/init.d/usbipd start
Пишет вот что:
/usr/sbin/usbipd: symbol lookup error: /usr/sbin/usbipd: undefined symbol: stub_driver

При попытке расшарить:  sudo usbip bind -b 1-1.3
выдает: usbip: error: could not bind device to usbip-host

даю команду на флешку: usbip —debug bind —busid=2-1.1
получаю:
usbip: debug: usbip.c:135:[run_command] running command: `bind’
usbip: debug: usbip_bind.c:162:[unbind_other] 2-1.1:1.0 -> unknown
usbip: debug: utils.c:65:[modify_match_busid] write «add 2-1.1» to /sys/bus/usb/drivers/usbip-host/match_busid
usbip: debug: usbip_bind.c:101:[bind_usbip] bind driver at 2-1.1:1.0 failed
usbip: error: could not bind device to usbip-host
usbip: debug: utils.c:65:[modify_match_busid] write «del 2-1.1» to /sys/bus/usb/drivers/usbip-host/match_busid

« Последнее редактирование: 12 Октября 2016, 11:39:54 от jester81 »


Оффлайн
RW1R

Попробуй пойти по другому пути:

Насколько я понял, в репах лежит битая (или нерабочая) версия usbip. Гуглеж вывел меня вот на это: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/898003, пост № 34. Запустил — работает, во всяком случае ошибок не вылезает, но теперь другая проблема:

Попробуй так. Я сам новичок в линухе, но чем смогу — помогу)

« Последнее редактирование: 13 Октября 2016, 23:12:41 от RW1R »


Оффлайн
jester81

Переустановил линуху наново.
Выполнил АПГРЕЙД и АПДЕЙТ системы (пакетов).
Установил СИНАПТИК (установщик пакетов)
С помощью СИНАПТИКА установил linux-tools-generic и linux-tools-3.13.0-24, думал поможет перед установкой USBIP
После этого начал установку USBIP из консоли.

Установил как обычно, начинаю запуск:
sudo /etc/init.d/usbipd start
и получаю ошибку:
usbip err: stub_driver.c: 33 (open_sysfs_stub_driver) usbip_common_mod.ko and usbip.ko must be loaded

** (process:3351): ERROR **: driver open failed
Trace/breakpoint trap (core dumped)

Решаю установить некоторые необходимые вещи (с другого форума прочитал)
apt-get install libncurses5-dev build-essential linux-source dh-autoreconf libsysfs-dev
В папке /usr/src
появляется файл-архив: linux-source-3.13.0.tar.bz2 и рядом папка: linux-source-3.13.0
В папке нет того, что мне надо — распаковываю архив.
В нем есть много чего:

arch     
CREDITS 
debian.master 
dropped.txt 
include 
Kbuild   
lib                         
Makefile 
README         
scripts   
tools   
virt
block   
crypto   
Documentation 
firmware     
init     
Kconfig 
linux-source-3.13.0.tar.bz2 
mm       
REPORTING-BUGS 
security 
ubuntu
COPYING 
debian   
drivers       
fs           
ipc     
kernel   
MAINTAINERS                 
net       
samples       
sound     
usr

Перехожу в папку:
/usr/src/linux-source-3.13.0/drivers/staging/usbip/userspace
вижу файл: autogen.sh
запускаю на выполнение.
Проверяю наличие файла нужного мне (срочно): locate usbip_common_mod.ko — не нашло

Появились новые файлы, среди них появился: configure
Запускаю его тоже на выполнение….
После проверяю — файла «usbip_common_mod.ko» все еще нет.
При запуске службы ошибка осталась та же (((

Делаю:
make
make install

Файла пока нет …..

По совету с инпортного форума сделал:
apt-get install linux-tools-generic-lts-utopic
После этого в папке: /usr/lib/linux-tools/3.16.0-77-generic
нашел файлы: usbip and usbipd
Копирую их вместо старых (находясь в папке /usr/lib/linux-tools/3.16.0-77-generic):

/usr/lib/linux-tools/3.16.0-77-generic# cp usbip /usr/sbin/usbip
/usr/lib/linux-tools/3.16.0-77-generic# cp usbipd /usr/sbin/usbipd
/usr/lib/linux-tools/3.16.0-77-generic# cp usbip /usr/local/sbin/usbip
/usr/lib/linux-tools/3.16.0-77-generic# cp usbipd /usr/local/sbin/usbipd
(в обе папки, потому как не уверен от куда запуск идет)

Запускаю опять злощастную службу ))))
sudo /etc/init.d/usbipd start

ииииииииииииии
КРАСОТИЩА !!!
ЗАПУСТИЛОСЬ )))

Проверяю, есть ли в памяти:
Код

ps aux | grep usbip*
root      6819  0.0  0.1   3000  1616 ?        Ss   19:57   0:00 /usr/sbin/usbipd -D
root      6860  0.0  0.1   6164  2012 pts/4    S+   20:03   0:00 grep —color=auto usbip*

Вау — есть !!!!!!
Типа запустилось ))))

Код

# usbip list -l
usbip: error: failed to open /usr/share/hwdata//usb.ids
 - busid 4-1 (093a:2510)
   unknown vendor : unknown product (093a:2510)

 - busid 1-8 (05e3:0723)
   unknown vendor : unknown product (05e3:0723)

ВИДИТ устройства, но не понимает их, пока….
Исправляем это:
Код

mkdir /usr/share/hwdata
cp /var/lib/usbutils/usb.ids /usr/share/hwdata/usb.ids

usbip list -l
 - busid 4-1 (093a:2510)
   Pixart Imaging, Inc. : Optical Mouse (093a:2510)

 - busid 1-8 (05e3:0723)
   Genesys Logic, Inc. : GL827L SD/MMC/MS Flash Card Reader (05e3:0723)


Получилось !!!!!

Пробуем расшарить устройство (скрещиваем пальцы)
Код

usbip bind -b 1-8
usbip: info: bind device on busid 1-8: complete

ВАУ — получилось, расшарило без ошибки )))))

Дальше дело за КЛИЕНТОМ.
Клиент стоит на ВИНДОВСЕ, ухожу мучать его )))
Скоро отпишусь

Добавлено через 3 часа 18 минут
WINDOWS 7 x 64
Запускаю командную строку
набираю:
c:USB_IP_2>usbip 192.168.1.5 -l -D

ПОЛУЧАЮ ОТВЕТ:
usbip dbg: usbip_network.c: 236 (tcp_connect ) trying

usbip dbg: usbip_network.c: 256 (tcp_connect ) connect
— 192.168.1.5
usbip dbg: usbip.c: 227 (query_exported_devices)
1-8: Genesys Logic, Inc. : unknown product (05e3:
: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-
: (Defined at Interface level) (00/00/00)

— Видит расшаренное устройство.

Пробую присоединить к себе под виндой:

c:USB_IP_2>usbip 192.168.1.5 --attach 1-8 -D

usbip dbg: usbip_network.c: 236 (tcp_connect ) trying 192.168.1.5 port 3240

usbip dbg: usbip_network.c: 256 (tcp_connect ) connected to 192.168.1.5:3240
usbip dbg: usbip_windows.c: 837 (query_interface0) exportable 1 devices
usbip dbg: usbip_windows.c: 854 (query_interface0) 1-8: Genesys Logic, Inc.
: unknown product (05e3:0723)
usbip dbg: usbip_windows.c: 855 (query_interface0) : /sys/devices/pci000
0:00/0000:00:1d.7/usb1/1-8
usbip dbg: usbip_windows.c: 856 (query_interface0) : (Defined at Interfa
ce level) (00/00/00)
usbip dbg: usbip_windows.c: 879 (query_interface0)
usbip err: usbip_windows.c: 899 (attach_device) cannot find device


ОБЛОМ ПОКА!!! (ушел рыдать)


Оффлайн
RW1R

На стороне сервера порт открыт?


Оффлайн
jester81

ДА , порт открыт, файервол отключен
Телнетом с Винды проверял


  • Печать

Страницы: [1]   Вверх

Обновлено Обновлено: 19.09.2018
Опубликовано Опубликовано: 22.06.2018

В инструкции описан процесс настройки бесплатного решения для редиректа USB устройства с сервера на любой другой компьютер сети. Это может пригодиться, например, для проброса USB токена на виртуальную машину или несетевого принтера. В рамках примера сервер будет на Linux Ubuntu, клиент — на Windows (проверено на 7, 10, Server 2008 и 2012).

Устанавливаем usbip
Настраиваем клиента
Настраиваем автоматический запуск
    USB-сервера
    Клиента Windows
Решение проблем
    usbip_common_mod.ko and usbip.ko must be loaded
    /usr/sbin/usbipd: No such file or directory
    failed to open /usr/share/hwdata//usb.ids
    recv op_common
    cannot find device
    udev_device_new_from_subsystem_sysname failed

Установка и запуск

В Ubuntu установка инструмента проброса USB выполняется следующей командой:

apt-get install linux-tools-`uname -r`

* в моем случае была выполнена установка linux-tools-4.4.0-128-generic, где 4.4.0-128-generic — версия ядра, используемого в Ubuntu.

Подгружаем модули драйверов USB:

modprobe usbip-core

modprobe usbip-host

modprobe vhci-hcd

Запускаем usbip в качестве демона:

usbipd -D

Смотрим список подключенных USB устройств:

usbip list -l

Пример ответа:

root@usb:/usr/src# usbip list -l
 — busid 2-1.3 (8564:1000)
   Transcend Information, Inc. : JetFlash (8564:1000)

 — busid 2-1.4 (1c4f:0026)
   SiGma Micro : Keyboard (1c4f:0026)

Теперь можно расшарить флешку:

usbip bind -b 2-1.3

Должны увидеть на подобие:

usbip: info: bind device on busid 2-1.3: complete

Настройка клиента

Выполним настройку на базе операционной системы Windows.

Скачиваем драйвер и утилиту для Windows. Распаковываем архив usbip.zip.

Открываем диспетчер устройств (команда devmgmt.msc или правой кнопкой по Этот компьютер в проводнике — Управление — Диспетчер устройств).

Кликаем по ДействиеУстановить старое устройство:

Установка старого устройства в диспетчере устройств Windows

Выбираем ручную установку устройства — показать все устройства — Установка с диска и выбираем файл USBIPEnum.inf (находится в каталоге usbip, который мы распаковали ранее).

Будет обнаружено устройство USB/IP Enumerator — кликаем Далее, чтобы его установить. Мы должны его увидеть среди системных устройств.

Теперь открываем командную строку (cmd.exe) и переходим в распакованный каталог, например:

cd C:UsersuserDownloadsusbip

* где C:UsersuserDownloadsusbip — полный путь до папки.

Смотрим список расшаренных USB устройств на сервере:

usbip -l 192.168.0.15

* где 192.168.0.15 — IP-адрес сервера USB.

Мы получим ответ, на подобие этого:

C:UsersuserDownloadsusbip>usbip -l 192.168.0.15
— 192.168.0.15
   2-1.3: unknown vendor : unknown product (8564:1000)
        : /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3
        : (Defined at Interface level) (00/00/00)

Теперь можно примонтировать устройство:

usbip.exe -a 192.168.0.15 2-1.3

* если увидим ошибку …cannot find device, переходим к решению.

Автозапуск

Данная инструкция предполагала разовый запуск как сервера, так и клиента. После перезапуска системы, работоспособность будет потеряна до повторного ввода команд. Попробуем настроить автоматический запуск сервера и клиента.

Автозапуск сервера

Добавляем модули в автозапуск:

vi /etc/modules

usbip-core
usbip-host
vhci-hcd

Создаем юнит в systemd:

vi /etc/systemd/system/usbipd.service

[Unit]
Description=USBIPd

[Service]
ExecStart=/scripts/usbipd
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Перечитываем конфигурацию systemd и разрешаем запуск созданного нами юнита:

systemctl daemon-reload

systemctl enable usbipd

Создаем каталог хранения скрипта и сам скрипт:

mkdir /scripts

vi /scripts/usbipd

#!/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

bindID=’2-1.3′

usbipd -D
usbip bind -b $bindID

usbip attach —remote=localhost —busid=$bindID
sleep 2
usbip detach —port=00

Разрешаем запуск скрипта:

chmod +x /scripts/usbipd

Запускаем демона:

systemctl start usbipd

systemctl status usbipd

Для окончательного тестирования можно перезагрузить сервер.

Автозапуск клиента Windows

Пишем небольшой батник:

@echo off

cd C:UsersuserDownloadsusbip
usbip.exe -a 192.168.0.15 2-1.3

C:UsersuserDownloadsusbip — путь, где хранится распакованная утилита; 192.168.0.15 — адрес  сервера USB; 2-1.3 — идентификатор USB устройства на сервере.

Сохраняем скрипт с расширением bat или cmd. Запускаем планировщик заданий и добавляем новую задачу.

На вкладке Общие отмечаем Выполнять вне зависимости от регистрации пользователя и ставим галочку Выполнить с наивысшими правами:

Планировщик - вкладка общие

В триггерах выбираем При запуске системы:

Планировщик - вкладка триггеры

На вкладке Действия выбираем Запуск программы и прописываем путь до скрипта, который мы сохранили ранее:

Планировщик - вкладка действия

На вкладке Параметры ставим галочку При сбое выполнения перезапускать через и снимаем галочку Останавливать задачу, выполняемую дольше:

Планировщик - вкладка параметры

Для проверки, можно запустить вручную задачу на исполнение или перезагрузить компьютер.

Возможные проблемы

1. usbip_common_mod.ko and usbip.ko must be loaded

Ошибка появляется при попытке выполнить usbipd -D.

Причина: был установлен пакет usbip вместо linux-tools-<версия ядра>.

Решение: удаляем usbip:

apt-get remove usbip

Ставим нужный пакет:

apt-get install linux-tools-`uname -r`

2. /usr/sbin/usbipd: No such file or directory

Данная ошибка также появляется при попытке выполнить usbipd -D.

Причина: Нужный бинарник для запуска находится по другому пути — /usr/bin/usbipd.

Решение: создаем симлинк:

ln -s /usr/bin/usbipd /usr/sbin/usbipd

3. usbip: error: failed to open /usr/share/hwdata//usb.ids

Выскакивает при попытке посмотреть список устройств командой usbip list -l.

Причина: необходимый файл usb.ids находится в другой директории.

Решение: создаем каталог /usr/share/hwdata:

mkdir /usr/share/hwdata

Создаем симлинк на существующий файл:

ln -s /usr/share/misc/usb.ids /usr/share/hwdata/usb.ids

4. usbip err … recv op_common

При попытке запустить утилиту в командной строке Windows получаем ошибки:

usbip err: usbip_network.c: 121 (usbip_recv_op_common) recv op_common, -1
usbip err:       usbip.c: 216 (query_exported_devices) recv op_common
usbip err:       usbip.c: 288 (show_exported_devices) query

Причина: ошибка в бинарном файле для Windows.

Решение: открыть exe-файл в HEX редакторе, например, HxD. И в адресах смещения 00000CBC и 00000E0A заменить 06 на 11:

Редактирование exe — было

* было

Редактирование exe — стало

* стало

5. (attach_device) cannot find device

При попытке монтирования устройства в Windows, выскакивает ошибка с похожим текстом:

usbip err: usbip_windows.c: 829 (attach_device) cannot find device

Причина: недоработка серверного ПО — при расшаривании USB не считывается количество дескрипторов.

Решение: примонтировать устройство на сервере с последующим отмонтированием:

usbip attach —remote=localhost —busid=2-1.3

* в моем случае устройство имеет идентификатор 2-1.3.

usbip port

* смотрим номер порта, на котором висит наше примонтированное устройство. 

usbip detach —port=00

6. udev_device_new_from_subsystem_sysname failed

При попытке монтирования устройства на клиенте получаем ошибку с текстом:

libusbip: error: udev_device_new_from_subsystem_sysname failed
usbip: error: open vhci_driver
usbip: error: query

Причина: не подключен модуль vhci-hcd.

Решение: разово выполняем команду:

modprobe vhci-hcd

и добавляем в файл /etc/modules строку vhci-hcd.

NO WAY FOR ME :

root@DESKTOP-N9UN2H3:/usr/src/4.19.104-microsoft-standard/tools/usb/usbip# sudo make install -j 12

Making install in libsrc
make[1]: Entering directory ‘/usr/src/4.19.104-microsoft-standard/tools/usb/usbip/libsrc’
CC libusbip_la-names.lo
CC libusbip_la-usbip_host_driver.lo
CC libusbip_la-usbip_device_driver.lo
CC libusbip_la-usbip_common.lo
CC libusbip_la-usbip_host_common.lo
CC libusbip_la-vhci_driver.lo
CC libusbip_la-sysfs_utils.lo
In file included from /usr/include/string.h:495,
from usbip_device_driver.c:25:
In function ‘strncpy’,
inlined from ‘read_usb_vudc_device’ at usbip_device_driver.c:108:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘strncpy’,
inlined from ‘read_usb_vudc_device’ at usbip_device_driver.c:127:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 32 equals destination size [-Werror=stringop-truncatio ]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:472: libusbip_la-usbip_device_driver.lo] Error 1
make[1]: *** Waiting for unfinished jobs….
In file included from /usr/include/string.h:495,
from usbip_common.h:14,
from usbip_common.c:7:
In function ‘strncpy’,
inlined from ‘read_usb_device’ at usbip_common.c:229:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘strncpy’,
inlined from ‘read_usb_device’ at usbip_common.c:230:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 32 equals destination size [-Werror=stringop-truncatio ]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:479: libusbip_la-usbip_common.lo] Error 1
make[1]: Leaving directory ‘/usr/src/4.19.104-microsoft-standard/tools/usb/usbip/libsrc’
make: *** [Makefile:498: install-recursive] Error 1

The USB/IP Project

  • Summary

  • Files

  • Reviews

  • Support

  • News

  • Discussion

  • Mailing Lists

  • Donate

  • SVN (Obsolete)

  • Git ▾

    • Windows
    • Web Page

Menu

install usbip on centos 7


Created:

2019-01-08

Updated:

2019-03-14

  • Priya Murali

    Hi,

    i’m new to linux, and i’m using Centos 7. it will be of great help to me, if you can inform me on how to install usbip on Centos. i did google for this, but then i got blogs where the installation is done using apt-get.
    but this command does not work on Centos, and i need to use yum.
    i tried «yum install usbip» — i did not download any rpm as the webpage said that the source code is part of the mainstream code after kernel 3.7.

    will be great if someone can help me install usbip.

  • Priya Murali

    the «yum install usbip» command gives «No package usbip* available»

  • Priya Murali

    Hi, i’m waiting for a response that would help me progress..

    • Alexandre Demers

       

      Last edit: Alexandre Demers 2019-01-09

  • Priya Murali

    Hi Alexandre,
    Thanks a bunch for the reply. but i need more guidance. i was able to install usbip-utils and kmod-usbip rpms. but after that, when i execute the command to load the modules, i get a Fatal error stating the module is not found. i tried:
    modprobe usbip
    modprobe usbip_host
    modprobe usbip_common_mod.

    but then, i’m also confused as to which modules to load. i also read through the Readme file for linux, and there, it asks for some requirements, and asks to perform some compilations.:
    [Requirements]
    — USB/IP device drivers
    Its source code is included under $(top)/drivers/.

    - sysfsutils >= 2.0.0
        sysfsutils library
    
    - libwrap0-dev
        tcp wrapper library
    
    - gcc >= 4.0
    
    - libglib2.0-dev >= 2.6.0
    
    - libtool, automake >= 1.9, autoconf >= 2.5.0, pkg-config
    

    [Install]
    0. Skip here if you see a configure script.
    $ ./autogen.sh

    1. Compile & install.
        $ ./configure
        $ make install
    
    2. Compile & install USB/IP drivers if not yet.
    

    i’m not sure how to deal with these. If you could help me in what i need to do to completely get the usbip working, it will be great.

    • Alexandre Demers

      Well, you shouldn’t have to go through the kernel steps: by installing the two packages, you now have the modules (should at least) and the userspace tools.

      Did you reboot since you installed the packages?

  • Priya Murali

    Hi Alexandre,

    i am not able to proceed. the kernel version on my Centos is 4.20.2-1.el7.elrepo.x86_64.
    I ran the commands to install elrepo, and that was successful.

    then i installed the packages as below:
    [root@linuxci ~]# yum install kmod-usbip
    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
    * base: centos.mirror.net.in
    * elrepo: mirror-hk.koddos.net
    * extras: centos.mirror.net.in
    * updates: centos.mirror.net.in
    Package kmod-usbip-1.0.1-3.el7_6.elrepo.x86_64 already installed and latest version
    Nothing to do
    [root@linuxci ~]# yum install usbip-utils
    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
    * base: centos.mirror.net.in
    * elrepo: mirror-hk.koddos.net
    * extras: centos.mirror.net.in
    * updates: centos.mirror.net.in
    Package usbip-utils-1.0.1-2.el7.elrepo.x86_64 already installed and latest version
    Nothing to do

    After this i tried to load the modules:
    [root@linuxci ~]# pwd
    /root
    [root@linuxci ~]# sudo modprobe usbip-core
    modprobe: FATAL: Module usbip-core not found.
    [root@linuxci ~]# sudo modprobe usbip
    modprobe: FATAL: Module usbip not found.

    i tried the below command too:
    [root@linuxci ~]# insmod usbip-core.ko
    insmod: ERROR: could not load module usbip-core.ko: No such file or directory

    i do not know where i’m lost. can u guide me here? i also upgraded the kernel to the latest version. and also rebooted the system.

    • Alexandre Demers

      The modules you need are named usbip-core, vhci-hcd and usbip-host.
      usbip-core: core module of usbip
      vhci-hcd: virtual host controller interface on which remote devices will be attached (used on the local machine)
      usbip-host: host driver used to share devices (used on the remote machine)

      I think I’ve figured out why it is not working: your module version is from a different kernel version. The default kernel version in CentOS 7 is 3.10 if I’ve read correctly. This means you’ll have to find a different module compiled for your 4.20 kernel or build it yourself.

      You could have a look here: https://wiki.centos.org/HowTos/BuildingKernelModules
      Check for Building a kernel module rpm package (kmod)

  • Priya Murali

    Hi Alexandre,

    thanks for this info. i am now clear on which modules i need. i will check the modules or try to build. will update you with where i land.

  • Priya Murali

    Hi Alexandre,

    i got some time now, to look into setting up USB/IP.
    My Environment includes Linux server(where i’m attaching the USB to be shared) and a Windows client (to which the USB port should be shared).

    from the Read Me for Windows, i have installed the USB/IP Enumerator on the Windows system with ip, say 2.2.2.2.
    on the Linux server with ip 1.1.1.1, i have been able to install sysfsutils, gcc and libtool packages. i was unable to find the packages libwrap and libglib.
    i progressed, with the load module commands:
    insmod usbip-core.ko
    insmod usbip-host.ko

    usbip -D

    after this, i was able to see the usbip command with its options:
    usage: usbip [—debug] [—log] [—tcp-port PORT] [version] [help] <args>
    with the options — attach, detach, list, bind, unbind, port.</args>

    as per the linux read me, i donot see the comand usbip_bind_driver.

    so then, i tried to use
    usbip list -l

    this listed the usb connections currently on the server along with the busid.

    Now, to export the usb, i need to first bind the port to usbip-host.ko. Correct?
    i tried the command:
    usbip bind -b 1-2.1

    this returned «usbip: error: unable to bind device on 1-2.1»

    i’m blocked!! Kindly help me progress, by guiding me on what i missed to configure.
    waiting on you.

  • Priya Murali

    Hi Alexandre,

    i did a little more checks, and finally i’m able to bind the the device. below is the set of comands tried:

    yum install for sysfsutils, gcc, libtool, kmod-usbip, usb-utils

    insmod usbip-core.ko
    insmod usbip-host.ko

    modprobe usbip_core
    modprobe usbip_host

    usbipd -D

    usbip list —local
    this listed the usb connections

    usbip bind -b 1-2.1
    this was to bind the device to the usbip-host.ko

    from the Read Me for Linux, the above is required to be done the server (linux).

    then i did insmod for the vhci-hcd.ko module. after this i see the below:
    usbip list -r <linux ip=»» server=»»>
    Exportable USB devices
    ==================
    — <linux ip=»» server=»»>
    1-2.1: OmniKey AG : unknown product (076b:3031)
    : /sys/devices/pci00/00/00/usb1/1-2/1-2.1
    : (Defined at Interface level) (00/00/00)</linux></linux>

    after this, i have setup usbip (Read Me for Windows) on the Windows system, which is the client where i need to export the USB to. i tried to list the exported ports, and got a error:

    usbip —list <linux ip=»» server=»»>
    usbip err: usbip.c: 280 (show_exported_devices) — <ip> failed</ip></linux>

    what have i missed?
    after the bind, do i need to perform some other command to export the usb?
    Kindly respond.

     

    Last edit: Priya Murali 2019-03-14


Log in to post a comment.

переустановил программу USBIP

Local USB devices
=================
— busid 1-8 (05e3:0723)
Genesys Logic, Inc. : GL827L SD/MMC/MS Flash Card Reader (05e3:0723)
1-8:1.0 -> usb-storage

— busid 4-1 (093a:2510)
Pixart Imaging, Inc. : Optical Mouse (093a:2510)
4-1:1.0 -> usbhid

Код

usbip --debug bind -b 1-8

usbip: debug: usbip.c:135:[run_command] running command: `bind’
usbip: debug: usbip_bind.c:162:[unbind_other] 1-8:1.0 -> unknown
usbip: debug: utils.c:65:[modify_match_busid] write «add 1-8» to /sys/bus/usb/drivers/usbip-host/match_busid
usbip: debug: usbip_bind.c:101:[bind_usbip] bind driver at 1-8:1.0 failed
usbip: error: could not bind device to usbip-host
usbip: debug: utils.c:65:[modify_match_busid] write «del 1-8» to /sys/bus/usb/drivers/usbip-host/match_busid

Видимо драйвер тут не при чем (((

Добавлено через 22 часа 15 минут
Переустановил линуху наново.
Выполнил АПГРЕЙД и АПДЕЙТ системы (пакетов).
Установил СИНАПТИК (установщик пакетов)
С помощью СИНАПТИКА установил linux-tools-generic и linux-tools-3.13.0-24, думал поможет перед установкой USBIP
После этого начал установку USBIP из консоли.

Установил как обычно, начинаю запуск:
sudo /etc/init.d/usbipd start
и получаю ошибку:
usbip err: stub_driver.c: 33 (open_sysfs_stub_driver) usbip_common_mod.ko and usbip.ko must be loaded

** (process:3351): ERROR **: driver open failed
Trace/breakpoint trap (core dumped)

Решаю установить некоторые необходимые вещи (с другого форума прочитал)
apt-get install libncurses5-dev build-essential linux-source dh-autoreconf libsysfs-dev
В папке /usr/src
появляется файл-архив: linux-source-3.13.0.tar.bz2 и рядом папка: linux-source-3.13.0
В папке нет того, что мне надо — распаковываю архив.
В нем есть много чего:

Код

arch     
CREDITS  
debian.master  
dropped.txt  
include  
Kbuild   
lib                          
Makefile  
README          
scripts   
tools   
virt
block    
crypto   
Documentation  
firmware     
init     
Kconfig  
linux-source-3.13.0.tar.bz2  
mm        
REPORTING-BUGS  
security  
ubuntu
COPYING  
debian   
drivers        
fs           
ipc     
kernel   
MAINTAINERS                  
net       
samples        
sound     
usr

Перехожу в папку:
/usr/src/linux-source-3.13.0/drivers/staging/usbip/userspace
вижу файл: autogen.sh
запускаю на выполнение.
Проверяю наличие файла нужного мне (срочно): locate usbip_common_mod.ko — не нашло

Появились новые файлы, среди них появился: configure
Запускаю его тоже на выполнение….
После проверяю — файла «usbip_common_mod.ko» все еще нет.
При запуске службы ошибка осталась та же (((

Делаю:
make
make install

Файла пока нет …..

По совету с инпортного форума сделал:
apt-get install linux-tools-generic-lts-utopic
После этого в папке: /usr/lib/linux-tools/3.16.0-77-generic
нашел файлы: usbip and usbipd

Копирую их вместо старых (находясь в папке /usr/lib/linux-tools/3.16.0-77-generic):

Код

/usr/lib/linux-tools/3.16.0-77-generic# cp usbip /usr/sbin/usbip
/usr/lib/linux-tools/3.16.0-77-generic# cp usbipd /usr/sbin/usbipd
/usr/lib/linux-tools/3.16.0-77-generic# cp usbip /usr/local/sbin/usbip
/usr/lib/linux-tools/3.16.0-77-generic# cp usbipd /usr/local/sbin/usbipd
(в обе папки, потому как не уверен от куда запуск идет)

Запускаю опять злощастную службу ))))
sudo /etc/init.d/usbipd start

ииииииииииииии
КРАСОТИЩА !!!
ЗАПУСТИЛОСЬ )))

Проверяю, есть ли в памяти:

Код

ps aux | grep usbip*
root      6819  0.0  0.1   3000  1616 ?        Ss   19:57   0:00 /usr/sbin/usbipd -D
root      6860  0.0  0.1   6164  2012 pts/4    S+   20:03   0:00 grep --color=auto usbip*

Вау — есть !!!!!!
Типа запустилось ))))

Код

# usbip list -l
usbip: error: failed to open /usr/share/hwdata//usb.ids
 - busid 4-1 (093a:2510)
   unknown vendor : unknown product (093a:2510)

 - busid 1-8 (05e3:0723)
   unknown vendor : unknown product (05e3:0723)

ВИДИТ устройства, но не понимает их, пока….
Исправляем это:

Код

mkdir /usr/share/hwdata
cp /var/lib/usbutils/usb.ids /usr/share/hwdata/usb.ids

usbip list -l
 - busid 4-1 (093a:2510)
   Pixart Imaging, Inc. : Optical Mouse (093a:2510)

 - busid 1-8 (05e3:0723)
   Genesys Logic, Inc. : GL827L SD/MMC/MS Flash Card Reader (05e3:0723)

Получилось !!!!!

Пробуем расшарить устройство (скрещиваем пальцы)

Код

usbip bind -b 1-8
usbip: info: bind device on busid 1-8: complete

ВАУ — получилось, расшарило без ошибки )))))

Дальше дело за КЛИЕНТОМ.
Клиент стоит на ВИНДОВСЕ, ухожу мучать его )))
Скоро отпишусь

Добавлено через 3 часа 18 минут
WINDOWS 7 x 64
Запускаю командную строку
набираю:
c:USB_IP_2>usbip 192.168.1.5 -l -D

ПОЛУЧАЮ ОТВЕТ:
usbip dbg: usbip_network.c: 236 (tcp_connect ) trying

usbip dbg: usbip_network.c: 256 (tcp_connect ) connect
— 192.168.1.5
usbip dbg: usbip.c: 227 (query_exported_devices)
1-8: Genesys Logic, Inc. : unknown product (05e3:
: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-
: (Defined at Interface level) (00/00/00)

— Видит расшаренное устройство.

Пробую присоединить к себе под виндой:
c:USB_IP_2>usbip 192.168.1.5 —attach 1-8 -D

usbip dbg: usbip_network.c: 236 (tcp_connect ) trying 192.168.1.5 port 3240

usbip dbg: usbip_network.c: 256 (tcp_connect ) connected to 192.168.1.5:3240
usbip dbg: usbip_windows.c: 837 (query_interface0) exportable 1 devices
usbip dbg: usbip_windows.c: 854 (query_interface0) 1-8: Genesys Logic, Inc.
: unknown product (05e3:0723)
usbip dbg: usbip_windows.c: 855 (query_interface0) : /sys/devices/pci000
0:00/0000:00:1d.7/usb1/1-8
usbip dbg: usbip_windows.c: 856 (query_interface0) : (Defined at Interfa
ce level) (00/00/00)
usbip dbg: usbip_windows.c: 879 (query_interface0)
usbip err: usbip_windows.c: 899 (attach_device) cannot find device

ОБЛОМ ПОКА!!! (ушел рыдать)

Добрый день, Уважаемые!
Помогите настроить usbip в alt 7.0.5
установил usbip и usbipd

# usbipd
usbipd: error: please load usbip-core.ko and usbip-host.ko!
Подскажите как подключить модули?


Записан


Добрый день, Уважаемые!
Помогите настроить usbip в alt 7.0.5
установил usbip и usbipd
# usbipd
usbipd: error: please load usbip-core.ko and usbip-host.ko!
Подскажите как подключить модули?

modprobe usb-core
modprobe usb-host


Записан

Андрей Черепанов (cas@)


пишет:

# modprobe usbip-core
modprobe: FATAL: Module usbip-core not found.


Записан


kernel-modules-staging…. не установлен?


Записан


установил kernel-modules-staging-std-def
нашел в папке
/lib/modules/3.14.73-std-def-alt0.M70P.1/kernel/drivers/staging/usbip
файлы
usbip-core.ko
usbip-host.ko
vhci-hcd.ko
как их подключить?

« Последнее редактирование: 28.07.2016 14:28:58 от zhhh »


Записан


установил kernel-modules-staging-std-def
нашел в папке
/lib/modules/3.14.73-std-def-alt0.M70P.1/kernel/drivers/staging/usbip
файлы
usbip-core.ko
usbip-host.ko
vhci-hcd.ko
как их подключить?

В p8 он в штатном ядре. Команду я уже писал.


Записан

Андрей Черепанов (cas@)


В p8 он в штатном ядре

Извините, а я и не заметил, что вышел Р8 ))
Буду пробовать на нем


Записан


теперь usbipd стартует
а вот устройство не биндится

# usbip list -l
Local USB devices
=================
 - busid 3-1 (1ea7:000b)
   unknown vendor : unknown product (1ea7:000b)
         3-1:1.0 -> usbhid

# usbip bind --busid 3-1
usbip: error: could not bind device to usbip-host


Записан


Обновления все установлены? Прописать устройства явно не надо?


Записан

Андрей Черепанов (cas@)


[root@host-113 ~]# apt-get install hwdatabase

[root@host-113 ~]# usbip list -l
Local USB devices
=================
 - busid 1-3 (13fe:3e00)
   Kingston Technology Company Inc. : Flash Drive (13fe:3e00)
         1-3:1.0 -> usb-storage

[root@host-113 ~]# usbip -d bind --busid=1-3
usbip: debug: usbip.c:135:[run_command] running command: `bind'
usbip: debug: usbip_bind.c:162:[unbind_other] 1-3:1.0 -> usb-storage
usbip: debug: utils.c:65:[modify_match_busid] write "add 1-3" to /sys/bus/usb/drivers/usbip-host/match_busid
usbip: debug: usbip_bind.c:101:[bind_usbip] bind driver at 1-3:1.0 failed
usbip: error: could not bind device to usbip-host
usbip: debug: utils.c:65:[modify_match_busid] write "del 1-3" to /sys/bus/usb/drivers/usbip-host/match_busid

Что дальше делать?  :-(
PS. Где то прочел, что причина может быть в несовместимости версии usbip и подключаемых модулей. Так ли это?

« Последнее редактирование: 29.07.2016 15:24:55 от zhhh »


Записан


Что дальше делать?  :-(
PS. Где то прочел, что причина может быть в несовместимости версии usbip и подключаемых модулей. Так ли это?

а эту флешку никто автоматом не монтирует случайно?


Записан


а эту флешку никто автоматом не монтирует случайно?

Вот принтер подключил:

[root@host-113 sbin]# usbip list -l
Local USB devices
=================
 - busid 1-3 (04a9:10c9)
   Canon, Inc. : PIXIMA iP4600 Printer (04a9:10c9)
         1-3:1.0 -> usblp

[root@host-113 sbin]# usbip -d bind --busid=1-3
usbip: debug: usbip.c:135:[run_command] running command: `bind'
usbip: debug: usbip_bind.c:162:[unbind_other] 1-3:1.0 -> usblp
usbip: debug: utils.c:65:[modify_match_busid] write "add 1-3" to /sys/bus/usb/drivers/usbip-host/match_busid
usbip: debug: usbip_bind.c:101:[bind_usbip] bind driver at 1-3:1.0 failed
usbip: error: could not bind device to usbip-host
usbip: debug: utils.c:65:[modify_match_busid] write "del 1-3" to /sys/bus/usb/drivers/usbip-host/match_busid


Записан


а если перед этим сделать rmmod usblp ?


Записан


а если перед этим сделать rmmod usblp ?

не биндит  :-(
есть ли альтернатива этой проге? или ткните на рабочее решение на каком либо дистрибутиве альта, плз

« Последнее редактирование: 01.08.2016 14:07:39 от zhhh »


Записан


Понравилась статья? Поделить с друзьями:
  • Usbip error failed to open usr share hwdata usb ids
  • Urllib error httperror http error 429 too many requests
  • Usb002 ошибка принтера samsung
  • Urllib error httperror http error 410 gone pytube
  • Usb флешка не читается нет носителя как исправить