WSL2(Windows 10)中出现“未找到内核的 usbipd”

WSL2(Windows 10)中出现“未找到内核的 usbipd”

usbipd wsl list

它又回来了 WARNING: usbipd not found for kernel 5.10.16.3-microsoft You may need to install the following packages for this specific kernel: linux-tools-5.10.16.3-microsoft-standard-WSL2 linux-cloud-tools-5.10.16.3-microsoft-standard-WSL2

You may also want to install one of the following packages to keep up to date: linux-tools-standard-WSL2 linux-cloud-tools-standard-WSL2

我使用了如下解决方案。

  1. 在 WSL 中使用 USB/IP 时出现“内核未找到 usbipd”。 这显示了: hwdata is already the newest version (0.333-1). linux-tools-5.4.0-77-generic is already the newest version (5.4.0-77.86). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

  2. https://superuser.com/questions/1694723/access-mobile-device-filesystem-from-wsl 安装jmtpfs和 后sudo jmtpfs -o allow_other /media/android/,它返回No mtp devices found.,而 Android 设备显示在 Windows 10 的文件管理中(通过 MTP 连接)。

  3. https://superuser.com/questions/1686414/e-unable-to-locate-package-linux-tools-5-4-0-77-generic-on-wsl-debian-11/1688086#1688086. 但之后sudo apt install usbip hwdata usbutils它又回来了E: Unable to locate package usbip

  4. https://developer.ridgerun.com/wiki/index.php/How_to_setup_and_use_USB/IP 它回来了linux-tools-generic is already the newest version (5.4.0.139.137). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

  5. https://www.geekbits.io/how-to-install-usbip-tools-on-debian/ sudo make installmake[1]: Entering directory '/mnt/d/test/libsrc' CC libusbip_la-names.lo /bin/bash: ../libtool: No such file or directory make[1]: *** [Makefile:460: libusbip_la-names.lo] Error 127 make[1]: Leaving directory '/mnt/d/test/libsrc' make: *** [Makefile:498: install-recursive] Error 1

然后sudo usbipd -D它又回来了usbipd: error while loading shared libraries: libusbip.so.0: cannot open shared object file: No such file or directory

最后但并非最不重要的一点是,sudo apt update&sudo apt upgrade表明所有软件包都是最新的且已升级。

提前致谢。

答案1

从我对这个问题的理解来看,也许不仅需要链接客户端可执行文件usbip,还需要链接守护进程实用程序usbipd(注意后面的d)?这意味着

sudo update-alternatives --install /usr/local/bin/usbip usbip $(command -v ls /usr/lib/linux-tools/*/usbip | tail -n1) 20

可能需要

sudo update-alternatives --install /usr/local/bin/usbipd usbipd $(command -v ls /usr/lib/linux-tools/*/usbipd | tail -n1) 20

答案2

感谢@Nielo指出您正在尝试运行usbipd(而不是uspip,正如我最初所想的那样)。

在 WSL 下:

  • USB/IP 守护程序 ( usbipd.exe) 在以下环境下运行视窗因为它是 Windows分享(通过usbipd bind)该设备。
  • usbip您应该在USB/IP 客户端 ( ) 下运行Ubuntu,连接到共享的 Windows 守护进程的设备。

因此从电源外壳在 Windows 中,尝试运行usbipd list(或usbipd wsl list

注意:要运行usbipd bind,您需要进入管理员 PowerShell。

请记住,只要你尝试将设备连接到默认发行版,并且你已经usbip在 Ubuntu 中设置了命令,如我的答案在这里全部usbipd可以从管理 PowerShell 运行命令。

例如:

usbipd wsl list
# Identify BUSID of device to attach
usbipd wsl attach --busid <busid>

这做了两件事:

  • 通过 USB/IP 守护程序从 Windows 绑定/共享设备
  • 发送适当的命令Ubuntu 连接到该设备。

相关内容