Usbip error vhci driver is not loaded

Инструкция по настройке сервера USBIP для редиректа устройств USB с сервера на другой компьютер по сети. Помимо процесса настройки описаны возможные проблемы и способы их решения.

Обновлено Обновлено: 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.

  • Index
  • » Networking, Server, and Protection
  • » USBIP Error can’t open vhci-hcd driver even after modprobe vhci-hcd

Pages: 1

#1 2018-01-10 07:48:16

SepArch
Member
Registered: 2017-10-17
Posts: 4

USBIP Error can’t open vhci-hcd driver even after modprobe vhci-hcd

Hallo I am trying to attach a USB Device.

Server is Arch Linux (Host)
Client is also Arch Linux

[xxx@archlinux ~]$ lsmod | grep vhci_hcd
vhci_hcd               49152  0
usbip_core             32768  2 vhci_hcd,usbip_host
usbcore               282624  7 usbhid,usb_storage,vhci_hcd,usbip_host,xhci_pci,uas,xhci_hcd
usb_common             16384  3 vhci_hcd,usbcore,usbip_core

at client

[root@anarchy]: /home/owner># usbip list -r serverip
Exportable USB devices
======================
 - serverip
        1-1: SanDisk Corp. : Cruzer Blade (0781:5567)
           : /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1
           : (Defined at Interface level) (00/00/00)


[root@anarchy]: /home/owner># lsmod | grep vhci
vhci_hcd               49152  0
usbip_core             32768  2 vhci_hcd,usbip_host
usbcore               282624  7 usbhid,vhci_hcd,usbip_host,ehci_hcd,ohci_pci,ohci_hcd,ehci_pci
usb_common             16384  3 vhci_hcd,usbcore,usbip_core


[root@anarchy]: /home/owner># usbip attach -r serverip -b 1-1
libusbip: error: udev_device_get_sysattr_value failed
usbip: error: open vhci_driver
usbip: error: query

I tried to google the problem but I can’t find a solution. The Windows driver seems not even to list the devices sad

EDIT:
HERE the usbip —debug attach -r ip -b 1-1

usbip: debug: usbip.c:141:[run_command] running command: `attach'
libusbip: debug: vhci_driver.c:264:[usbip_vhci_driver_open] available ports: 16
libusbip: debug: vhci_driver.c:275:[usbip_vhci_driver_open] available controllers: 2
libusbip: debug: vhci_driver.c:128:[refresh_imported_device_list] controller 0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 0 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 1 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 2 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 3 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 4 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 5 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 6 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 7 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 8 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 9 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 10 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 11 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 12 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 13 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 14 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 15 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] socket 0 lbusid 0-0
libusbip: debug: vhci_driver.c:104:[parse_status] exit
libusbip: error: udev_device_get_sysattr_value failed
usbip: error: open vhci_driver
usbip: error: query

Last edited by SepArch (2018-01-10 08:08:04)

#2 2018-01-10 15:06:12

quantasy
Member
Registered: 2018-01-10
Posts: 1

Re: USBIP Error can’t open vhci-hcd driver even after modprobe vhci-hcd

I had the exact same problem!
I had to ?explicitly? update the usbip package which now is on 4.14.1.

Right now I am running
Linux matrix 4.15.0-1-MANJARO #1 SMP PREEMPT Sun Dec 24 07:39:02 UTC 2017 x86_64 GNU/Linux
with
usbip (usbip-utils 2.0)

And things are up and running again.

Last edited by quantasy (2018-01-10 15:24:25)

#3 2018-01-11 04:10:08

xsnake
Member
Registered: 2015-11-27
Posts: 11

Re: USBIP Error can’t open vhci-hcd driver even after modprobe vhci-hcd

I, too, am having the same problem.

I just made a full system upgrade.

pacman -Ss usbip gives:

community/usbip 4.14-1 (linux-tools) [installed]
    An USB device sharing system over IP network

But I am still experiencing the issue. Perhaps this gets fixed with Linux 4.15, because I am currently running:

Linux 4.14.8-1-ARCH #1 SMP PREEMPT Wed Dec 20 21:27:44 UTC 2017 x86_64 GNU/Linux

Last edited by xsnake (2018-01-11 18:30:37)

#4 2018-01-13 15:52:24

desperat
Member
Registered: 2010-01-04
Posts: 6

Re: USBIP Error can’t open vhci-hcd driver even after modprobe vhci-hcd

4.14.13-1-ARCH
Still the issue.

but if you in a rush:

install LTS kernel:
4.9.76-1-lts

and install downgrade
and downgrade to: usbip-4.10-1
downgrade usbip

don’t forget:
sudo modprobe vhci_hcd

and lastly:
sudo usbip —debug list —remote=»192.168.x.x»
sudo usbip —debug attach —remote=»192.168.x.x» —busid=»x-y.z»

to detach:
sudo usbip port
choose port xx from list and
sudo usbip detach —port=xx

LTS and downgrade sometimes save my life.
It’s easier than compile usbip from source and patch everything from scratch what’s an option as well.

Last edited by desperat (2018-01-13 20:41:03)


KDE, Antergos
Thinkpad T410, i5 moded watercooling // LEDE WDR3600 / LTE watercooling

#5 2018-11-26 16:48:28

MilanKnizek
Member
Registered: 2005-12-13
Posts: 88

Re: USBIP Error can’t open vhci-hcd driver even after modprobe vhci-hcd

4.14 has become lts in the meantime and it is still an issue for 4.14.82 (linux-tools, which include usbip, are already v 4.19).

There is a bug report upstream with a patch :
https://bugzilla.kernel.org/show_bug.cgi?id=197607

Or simple commenting out of two lines worked for me:
https://bugs.archlinux.org/task/56069#comment163073

Recompiling patched linux-tools 4.14 against lts eventually produces a working usbip.

P.S. I guess this does not count as necro-bumping :-)

#6 2018-11-26 19:16:12

loqs
Member
Registered: 2014-03-06
Posts: 15,645

Re: USBIP Error can’t open vhci-hcd driver even after modprobe vhci-hcd

#7 2018-11-27 19:30:00

MilanKnizek
Member
Registered: 2005-12-13
Posts: 88

Re: USBIP Error can’t open vhci-hcd driver even after modprobe vhci-hcd

Not sure. The bug I experienced was because the path is «…/vhci_hcd.0/status», while the ‘usbip attach’ command may fail due to lookup of a «…/vhci_hcd.0/status.0»

Commenting out the condition on line 118:

static int refresh_imported_device_list(void)                                                                           
{                                                                                                                       
<------>const char *attr_status;                                                                                        
<------>char status[MAX_STATUS_NAME+1] = "status";                                                                      
<------>int i, ret;                                                                                                     
                                                                                                                        
<------>for (i = 0; i < vhci_driver->ncontrollers; i++) {                                                               
// MK: the file name is vhci_hcd.0/status, not vhci_hcd.0/status.0                                                      
//<----><------>if (i > 0)                                                                                              
//<----><------><------>snprintf(status, sizeof(status), "status.%d", i);

This ugly workaround is certainly not a solution — but then again, I am not a coder :-( and it «works for me».

I want to use the webcam of my Laptop as if it would be connected to my pc.

Specs: Ubuntu Mate 18.04 Kernel Client: 5.3.0-46-generic Kernel Server: 4.15.0-96-generic USBIP Version: 4.15.0-96-generic

These are the Error Messages.

usbip port

usbip: error: failed to open /usr/share/hwdata//usb.ids
usbip: error: open vhci_driver
usbip: error: list imported devices

This is what happen,when i attach the device:

sudo usbip —debug attach -r 192.168.2.22 -b 1-1.6

usbip: debug: usbip.c:129:[run_command] running command: `attach'
libusbip: debug: vhci_driver.c:269:[usbip_vhci_driver_open] available ports: 16
libusbip: debug: vhci_driver.c:281:[usbip_vhci_driver_open] available controllers: 1
libusbip: debug: vhci_driver.c:128:[refresh_imported_device_list] controller 0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 0 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 1 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 2 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 3 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 4 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 5 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 6 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub hs port 7 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 8 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 9 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 10 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 11 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 12 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 13 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 14 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:68:[parse_status] hub ss port 15 status 4 speed 0 devid 0
libusbip: debug: vhci_driver.c:69:[parse_status] sockfd 0 lbusid 0-0
libusbip: debug: vhci_driver.c:104:[parse_status] exit
usbip: debug: usbip_attach.c:100:[import_device] got free port 0
libusbip: debug: vhci_driver.c:367:[usbip_vhci_attach_device2] writing: 0 3 65540 3
libusbip: debug: vhci_driver.c:372:[usbip_vhci_attach_device2] attach attribute path: /sys/devices/platform/vhci_hcd.0/attach
libusbip: debug: vhci_driver.c:380:[usbip_vhci_attach_device2] attached port: 0

/var/log/syslog client

Apr  8 12:42:32 client kernel: [ 7376.482998] vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(3)
Apr  8 12:42:32 client kernel: [ 7376.483003] vhci_hcd vhci_hcd.0: devid(65540) speed(3) speed_str(high-speed)
Apr  8 12:42:32 client kernel: [ 7376.726204] usb 5-1: new high-speed USB device number 18 using vhci_hcd
Apr  8 12:42:32 client kernel: [ 7376.726212] usb 5-1: SetAddress Request (18) to port 0
Apr  8 12:42:32 client kernel: [ 7376.803460] usb 5-1: device descriptor read/8, error -71
Apr  8 12:42:32 client kernel: [ 7377.002279] usb 5-1: device descriptor read/8, error -71
Apr  8 12:42:33 client kernel: [ 7378.010236] usb usb5-port1: Cannot enable. Maybe the USB cable is bad?
Apr  8 12:42:33 client kernel: [ 7378.010253] usb usb5-port1: attempt power cycle
Apr  8 12:42:34 client kernel: [ 7379.234242] usb usb5-port1: Cannot enable. Maybe the USB cable is bad?
Apr  8 12:42:35 client kernel: [ 7380.138258] usb usb5-port1: Cannot enable. Maybe the USB cable is bad?
Apr  8 12:42:35 client kernel: [ 7380.138276] usb usb5-port1: unable to enumerate USB device

/var/log/syslog server

Apr  8 12:42:32 server usbipd: usbipd: info: connection from 192.168.2.20:34330
Apr  8 12:42:32 server usbipd: usbipd: info: received request: 0x8003(6)
Apr  8 12:42:32 server usbipd: usbipd: info: found requested device: 1-1.6
Apr  8 12:42:32 server usbipd: usbip: info: connect: 1-1.6
Apr  8 12:42:32 server usbipd: usbipd: info: request 0x8003(6): complete
Apr  8 12:42:32 server kernel: [ 9504.400594] usbip-host 1-1.6: stub up
Apr  8 12:42:32 server kernel: [ 9504.710050] usbip-host 1-1.6: urb completion with non-zero status -71
Apr  8 12:42:32 server kernel: [ 9504.716793] usbip-host 1-1.6: urb completion with non-zero status -71
Apr  8 12:42:32 server kernel: [ 9504.722043] usbip-host 1-1.6: urb completion with non-zero status -71
Apr  8 12:42:32 server kernel: [ 9504.909299] usbip-host 1-1.6: urb completion with non-zero status -71
Apr  8 12:42:32 server kernel: [ 9504.915669] usbip-host 1-1.6: urb completion with non-zero status -71
Apr  8 12:42:32 server kernel: [ 9504.920794] usbip-host 1-1.6: urb completion with non-zero status -71

Содержание

  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? О ужас — это работает!

Источник

Данный проект позволяет пробросить usb устройства через сеть ethernet. Установку USB/IP производил на ubuntu-server 16.04(14.04) lts. Данной темой пришлось озадачиться т.к приходится пробрасывать usb ключи (eToken) и другие устройства в виртуальные машины у которых нет физических подключений. Можно пробросить usb устройство используя средства виртуализации, в kvm проброс USB это можно сделать так, но тогда возникает вопрос. Как делать живую миграцию виртуальной машины между серверами? Установив USB/IP решил все эти задачи.

Установка usbp/ip на сервере

Все бинарные файлы и модули входят в пакет linux-tools, вот его и поставим.
Сначала посмотрим информацию о нашем установленном ядре uname -r, а потом ставим linux-tools-X.XX

для ubuntu-server 14.04 lts

sudo uname -r
3.19.0-59-generic
sudo apt-get install linux-tools-3.19.0-59-generic

Все необходимые бинарные файлы для запуска будут находится в /usr/lib/linux-tools/3.19.0-59-generic/ usbip и usbipd

После установки необходимо подгрузить модули и запустить сервер командой:
usbipd -D

sudo modprobe usbip-core
sudo modprobe usbip-host

Не забудьте добавить загрузку модулей в файл /etc/modules
Запускаем сервер usbipd

sudo usbipd -D

Если при запуске usbipd -D получили ошибку:

$ sudo usbipd -D
usbip err: stub_driver.c:  33 (open_sysfs_stub_driver)
usbip_common_mod.ko and usbip.ko must be loaded

** (process:11490): ERROR **: driver open failed

Скорее всего вы по ошибке инсталировали пакет apt-get install usbip. Удалите его и поставьте linux-tools…

С установкой и запуском серверной части все. Теперь необходимо раздать в доступ usb устройства подключенные к данному серверу (192.168.10.200).

Посмотреть список usb устройств:

usbip list -l, --local (Список локальных USB устройств)
usbip list -r, --remote=<host> (Список расшариных USB устройств на удаленном хосте)

Подключить usb устройство для раздачи по сети
usbip bind -b, --busid=<busid>

Обратное действие для bind — unbind отключить устройство.
usbip unbind -b, --busid=<busid>

Пример:

admin@srv1404:~#sudo usbip list -l
usbip: error: failed to open /usr/share/hwdata//usb.ids
 - busid 4-1 (0529:0620)
   unknown vendor : unknown product (0529:0620)

 - busid 5-1 (046b:ff10)
   unknown vendor : unknown product (046b:ff10)

admin@srv1404:~# sudo usbip bind --busid=4-1
usbip: info: bind device on busid 4-1: complete

usbip bind — необходимо выполнять для каждого устройства
Посмотреть расшариные usb устройства можно следующей командой:

admin@srv1404:~#sudo usbip list -r localhost
usbip: error: failed to open /usr/share/hwdata//usb.ids
Exportable USB devices
======================
 - localhost
        4-1: unknown vendor : unknown product (0529:0620)
           : /sys/devices/pci0000:00/0000:00:1a.1/usb4/4-1
           : (Defined at Interface level) (00/00/00)
           :  0 - unknown class / unknown subclass / unknown protocol (0b/00/00)

Настраиваем клиентскую часть usb/ip

Установка ни чем не отличается от серверной части. Устанавливаем тот же пакет linux-tools.X-XX-….
Подгружаем модули: usbip-core и usbip-host

Смотрим доступные usb устройства на удаленном сервере:

sudo usbip list -r 192.168.10.200
usbip: error: failed to open /usr/share/hwdata//usb.ids
Exportable USB devices
======================
 - 192.168.10.200
        4-1: unknown vendor : unknown product (0529:0620)
           : /sys/devices/pci0000:00/0000:00:1a.1/usb4/4-1
           : (Defined at Interface level) (00/00/00)
           :  0 - unknown class / unknown subclass / unknown protocol (0b/00/00)

Подключаем устройство:

admin@client1404:~#sudo usbip attach -r  192.168.10.200 --busid=4-1
admin@client1404:~#

Если получили ошибку:

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

Мы забыли подключить модуль vhci-hcd

sudo modprobe vhci-hcd

Вот теперь все должно сработать без ошибок. Не забудьте подгрузить все необходимые модули на клиенте в /etc/modules
usbip-core
usbip-host
vhci-hcd

Нюансы при работе с usb/ip

В процессе эксплуатации выяснились следующе моменты. Если клиентскую машину перегрузить или выключить, то подключение usb устройства командой usbip attach -r 192.168.10.200 —busid=4-1 может завершится ошибкой:

usbip: error: recv op_common
usbip: error: query

Но при этом если посмотреть с клиентской машины доступные usb устройства на сервере, то все usb видятся прекрасно. Видимо серверная часть хранит информацию о подключенных клиентах.
В качестве решения этой проблемы необходимо на сервере отключить usb устройство и заново расшарить. Делается примерно так.

sudo usbip list -r localhost
usbip: error: failed to open /usr/share/hwdata//usb.ids
Exportable USB devices
======================
 - localhost
        4-1: unknown vendor : unknown product (0529:0620)
           : /sys/devices/pci0000:00/0000:00:1a.1/usb4/4-1
           : (Defined at Interface level) (00/00/00)
           :  0 - unknown class / unknown subclass / unknown protocol (0b/00/00)

sudo usbip unbind --busid=4-1
usbip: info: unbind device on busid 4-1: complete
sudo usbip bind -b 4-1
usbip: info: bind device on busid 4-1: complete

Поэтому преждем чем перегружать или выключать клиентскую машину необходимо сначала отключать usb.
1. Смотрим на каком порту подключен usb

admin@client1404:~# /usr/lib/linux-tools/3.19.0-64-generic/usbip port
Imported USB devices
====================
Port 00:  at Full Speed(12Mbps)
       unknown vendor : unknown product (0529:0620)
       2-1 -> usbip://192.168.10.200:3240/4-1
           -> remote bus/dev 004/003

2. Отключаем устройство

sudo usbip detach -p 00

Все теперь можно перегружать, выключать и т. д. это все можно автоматизировать создав исполняемый файл положив в /etc/init.d/. update-rc.d — в помощь.

В моей сети нет необходимости пробрасывать usb на клиентскую машину с windows. Но судя по отзывам пользователей в интернете тоже все работает.

Понравилась статья? Поделить с друзьями:
  • Usbip error unable to bind device on
  • Usbip error tcp connect
  • Usbip error failed to open usr share hwdata usb ids
  • Urllib error httperror http error 429 too many requests
  • Usb002 ошибка принтера samsung