"usbipd not found for kernel" when using USB/IP with WSL
I am trying to attach a USB device to my Ubuntu 20.04 distribution running under WSL2.
The problem is that when I run the
usbip command, it gives the following message:
WARNING: usbipd not found for kernel 126.96.36.199-microsoft You may need to install the following packages for this specific kernel: linux-tools-188.8.131.52-microsoft-standard-WSL2 linux-cloud-tools-184.108.40.206-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
I tried doing:
$ sudo apt install linux-tools-220.127.116.11-microsoft-standard-WSL2
… but that doesn’t work. It returns the following:
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package linux-tools-18.104.22.168-microsoft-standard-WSL2 E: Couldn't find any package by glob 'linux-tools-22.214.171.124-microsoft-standard-WSL2'
I have been Googling how to install them, but I can’t find anything about this.
- Ubuntu installation has been installed around 2 months ago.
- I am using WSL2
uspipis called by
usbipd wsl attach -b 2-2from PowerShell because I am trying to attach a USB device to Ubuntu
- Kernel version
Assuming that you are running Windows 11, you can simply
wsl --update from an Administrator PowerShell in order to pull in the latest. Then
wsl --shutdown and restart.
You could also build your own from the WSL2 kernel sources (making sure to specify the WSL2 kernel config options), but most people won’t need to go this route.
Note that if you are running Windows 10, different directions will apply.
Continue following the directions on the previously linked doc, and you’ll see that the packages you need installed are:
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
At that point, the PowerShell
usbipd wsl attach should work.
Always use the updated version of the kernel >
But it seems like you are calling the
usbipd utility from WSL which cases the package errors.
For attaching the usb devices to WSL, always call
usbipd wsl attach --busid <busid> from powershell terminal and NOT from WSL terminal.
Maybe this blog will help.