Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to install package for Ubuntu kernel on WSL2

I am trying to attach an usb to my WSL 2 running Ubuntu 20.04.
But there is a problem, then I try to use usbip it prompt the following
message:

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

I tried doing $ sudo apt install linux-tools-5.10.16.3-microsoft-standard-WSL2
but it doesn’t work and show the following:

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'

I have been googling how to install them, but I can’t find
anything about this.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

NOTES:

  • Ubuntu installation has been installed around 2 months ago.
  • I am using WSL 2
  • uspip is called by usbipd wsl attach -b 2-2 from PowerShell because I am trying to attach usb device to Ubuntu
  • Kernel version 5.10.16.3-microsoft-standard-WSL2

>Solution :

From the WSL2 USB/IP Prerequisites, you’ll need the WSL2 5.10.60.1 kernel or higher. That’s the first release that added USB/IP support.

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

Finally, sudo visudo per the instructions to add the correct /usr/lib/linux-tools/5.4.0-77-generic directory to the beginning of the sudo secure_path.

At that point, the PowerShell usbipd wsl attach should work.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading