我正试图将一个USB设备附加到运行在WSL2下的Ubuntu20.04发行版上。
问题是,当我运行usbip
命令时,它会给出以下消息:
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
我试着做:
$ sudo apt install linux-tools-5.10.16.3-microsoft-standard-WSL2
..。但这不管用。它返回以下内容:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-tools-5.10.16.3-microsoft-standard-WSL2
E: Couldn't find any package by glob 'linux-tools-5.10.16.3-microsoft-standard-WSL2'
我一直在谷歌上搜索如何安装它们,但是我找不到关于这个的任何东西。
备注:
uspip
是由usbipd wsl attach -b 2-2
从PowerShell调用的,因为我试图将USB设备附加到Ubuntu。5.10.16.3-microsoft-standard-WSL2
发布于 2021-12-30 18:42:26
在WSL2 USB/IP先决条件中,您将需要WSL2 5.10.60.1内核或更高版本。这是第一个增加USB/IP支持的版本。
假设您运行的是Windows 11,您只需从管理员wsl --update
中获取最新的PowerShell即可。然后wsl --shutdown
并重新启动。
您也可以从WSL2内核源代码构建自己的内核(确保指定WSL2内核配置选项),但大多数人都不需要这样做。
请注意,如果您正在运行Windows 10,则将应用不同的方向。
继续遵循前面链接的文档的说明,您将看到您需要安装的包是:
sudo apt install linux-tools-5.4.0-77-generic hwdata
sudo update-alternatives --install /usr/local/bin/usbip usbip $(command -v ls /usr/lib/linux-tools/*/usbip | tail -n1) 20
在这一点上,PowerShell usbipd wsl attach
应该可以工作。
发布于 2022-08-22 21:45:39
始终使用内核> 5.10.60.1
的更新版本。
但是,您似乎正在从WSL调用usbipd
实用程序,这将导致包错误。
若要将usb设备附加到WSL上,请始终从powershell终端调用usbipd wsl attach --busid <busid>
,而不是从WSL终端调用。
也许这个博客会有帮助。
https://askubuntu.com/questions/1384456
复制相似问题