![usbip 打开 vhci 驱动程序时出错](https://linux22.com/image/11376/usbip%20%E6%89%93%E5%BC%80%20vhci%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E6%97%B6%E5%87%BA%E9%94%99.png)
更新(见下文)
在客户端和服务器上安装 usbip 软件包并在两者上加载内核模块后,我在服务器上启动了 usbipd:
sudo usbipd
usbipd: info: starting usbipd (usbip-utils 2.0)EDIT: I found better instructions here: https://github.com/torvalds/linux/tree/master/tools/usb/usbip
客户端: sudo modprobe vhci-hcd sudo usbip Attach -r 192.168.5.153 -b 1-1
服务器:
usbipd: 信息: 来自 192.168.1.2:40942 的连接 usbipd: 信息: 收到请求: 0x8003(4) usbipd: 信息: 找到请求的设备: 1-1 usbip: 信息: 连接: 1-1 usbipd: 信息: 请求 0x8003(4) ): 完全的
客户:
sudo lsusb (未显示预期的 USB 设备,KDE 多媒体工具也未显示任何新的音频设备) usbipd: info: Listening on 0.0.0.0:3240 usbipd: error: socket: :::3240: 97 (地址族不协议支持)
我没有调查上述错误,我不知道它是否相关,但我假设它不相关。
然后我绑定了我的USB设备:
sudo usbip bind -b 1-1
然后在客户端上我连接了设备:
sudo usbip attach -r 192.168.1.153 -b 1-1
libusbip: error: udev_device_new_from_subsystem_sysname failed
usbip: error: open vhci_driver
usbipd 的服务器上显示以下消息(我尝试连接两次):
usbipd: info: connection from 192.168.1.2:40910
usbipd: info: received request: 0x8005(4)
usbipd: info: exportable devices: 1
usbipd: info: request 0x8005(4): complete
usbipd: info: connection from 192.168.1.2:40912
usbipd: info: received request: 0x8003(4)
usbipd: info: found requested device: 1-1
usbip: info: connect: 1-1
usbipd: info: request 0x8003(4): complete
usbipd: info: connection from 192.168.1.2:40918
usbipd: info: received request: 0x8003(4)
usbipd: info: found requested device: 1-1
usbip: info: connect: 1-1
usbipd: info: request 0x8003(4): complete
lsusb
表明客户端没有连接USB设备。客户端的相关错误有:
libusbip: error: udev_device_new_from_subsystem_sysname failed
usbip: error: open vhci_driver
客户端和服务器都运行这些版本:
sudo pacman -Qi usbip 名称:usbip 版本:4.18-1
Linux 4.18.6-arch1-1-ARCH #1 SMP PREEMPT 9 月 5 日星期三 11:54:09 UTC 2018 x86_64 GNU/Linux
我从这里获得了安装帮助:教程 – USB/IP » Linux Magazinehttp://www.linux-magazine.com/Issues/2018/208/Tutorial-USB-IP
更新:我在这里找到了更好的说明:https://github.com/torvalds/linux/tree/master/tools/usb/usbip
客户:
sudo modprobe vhci-hcd
sudo usbip attach -r 192.168.5.153 -b 1-1
服务器:
usbipd: info: connection from 192.168.1.2:40942
usbipd: info: received request: 0x8003(4)
usbipd: info: found requested device: 1-1
usbip: info: connect: 1-1
usbipd: info: request 0x8003(4): complete
客户:
sudo lsusb
(未显示预期的 USB 设备,KDE 多媒体工具也未显示任何新的音频设备)
客户端上的日志显示已找到 USB 设备但立即未绑定,我不清楚原因。
# journalctl -r
Sep 23 05:12:20 client kernel: usb 3-1: USB disconnect, device number 4
Sep 23 05:12:20 client kernel: vhci_hcd: disconnect device
Sep 23 05:12:20 client kernel: vhci_hcd: release socket
Sep 23 05:12:20 client kernel: vhci_hcd: stop threads
Sep 23 05:12:20 client kernel: vhci_hcd: connection closed
Sep 23 05:12:20 client krunner[993]: [05::12:20.748] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client org_kde_powerdevil[1022]: [05::12:20.748] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client kdeinit5[954]: [05::12:20.748] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client kate[4517]: [05::12:20.748] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client plasmashell[995]: [05::12:20.748] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client baloo_file[991]: [05::12:20.748] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client systemsettings5[1170]: [05::12:20.748] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client kdeinit5[954]: [05::12:20.748] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client kdeinit5[954]: [05::12:20.748] unknown: QObject::connect: invalid null parameter
Sep 23 05:12:20 client org_kde_powerdevil[1022]: [05::12:20.748] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client krunner[993]: [05::12:20.748] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client plasmashell[995]: [05::12:20.747] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client kate[4517]: [05::12:20.747] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client systemsettings5[1170]: [05::12:20.747] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client baloo_file[991]: [05::12:20.747] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client kdeinit5[954]: [05::12:20.747] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client kdeinit5[954]: [05::12:20.747] unknown: QObject::connect: invalid null parameter
Sep 23 05:12:20 client baloo_file[991]: [05::12:20.747] unknown: QObject::connect: invalid null parameter
Sep 23 05:12:20 client baloo_file[991]: [05::12:20.746] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client org_kde_powerdevil[1022]: [05::12:20.746] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client plasmashell[995]: [05::12:20.746] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client systemsettings5[1170]: [05::12:20.746] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client krunner[993]: [05::12:20.746] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client kate[4517]: [05::12:20.746] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client kdeinit5[954]: [05::12:20.746] unknown: QObject::connect: invalid null parameter
Sep 23 05:12:20 client baloo_file[991]: [05::12:20.746] unknown: QObject::connect: invalid null parameter
Sep 23 05:12:20 client baloo_file[991]: [05::12:20.745] unknown: QObject::connect: invalid null parameter
Sep 23 05:12:20 client kdeinit5[954]: [05::12:20.744] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client baloo_file[991]: [05::12:20.744] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client systemsettings5[1170]: [05::12:20.744] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client org_kde_powerdevil[1022]: [05::12:20.744] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client kdeinit5[954]: [05::12:20.744] unknown: QObject::connect: invalid null parameter
Sep 23 05:12:20 client krunner[993]: [05::12:20.744] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client plasmashell[995]: [05::12:20.744] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client kate[4517]: [05::12:20.744] unknown: UdevQt: unhandled device action "bind"
Sep 23 05:12:20 client baloo_file[991]: [05::12:20.743] unknown: QObject::connect: invalid null parameter
Sep 23 05:12:20 client mtp-probe[5684]: bus: 3, device: 4 was not an MTP device
Sep 23 05:12:20 client mtp-probe[5684]: checking bus 3, device 4: "/sys/devices/platform/vhci_hcd.0/usb3/3-1"
Sep 23 05:12:20 client kernel: hid-generic 0003:0746:3000.0003: hidraw0: USB HID v1.00 Device [ONKYO USB HS Audio Device] on usb-vhci_hcd.0-1/input2
Sep 23 05:12:20 client kernel: hid-generic 0003:0746:3000.0003: No inputs registered, leaving
Sep 23 05:12:20 client kernel: usb 3-1: Manufacturer: ONKYO
Sep 23 05:12:20 client kernel: usb 3-1: Product: USB HS Audio Device
Sep 23 05:12:20 client kernel: usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Sep 23 05:12:20 client kernel: usb 3-1: New USB device found, idVendor=0746, idProduct=3000, bcdDevice=22.04
Sep 23 05:12:20 client kernel: usb 3-1: SetAddress Request (4) to port 0
Sep 23 05:12:20 client kernel: usb 3-1: new high-speed USB device number 4 using vhci_hcd
Sep 23 05:12:20 client kernel: vhci_hcd vhci_hcd.0: devid(65544) speed(3) speed_str(high-speed)
Sep 23 05:12:20 client kernel: vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(3)
Sep 23 05:10:53 client nm-dispatcher[5670]: req:1 'dhcp4-change' [wlan0]: completed: no scripts
Sep 23 05:10:53 client nm-dispatcher[5670]: req:1 'dhcp4-change' [wlan0]: new request (0 scripts)
Sep 23 05:10:53 client systemd[1]: Started Network Manager Script Dispatcher Service.
Sep 23 05:10:53 client dbus-daemon[478]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Sep 23 05:10:53 client systemd[1]: Starting Network Manager Script Dispatcher Service...
Sep 23 05:10:53 client dbus-daemon[478]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-disp>
答案1
每当我遇到这个错误时,都是由于usbip 实用程序客户端和服务器版本不匹配。通过执行来检查两者,usbip version
哪个应该返回类似的内容usbip (usbip-utils 2.0)