5

I'm following this oficial guide to Connecting USB devices to WSL2 but I'm stuck installing linux-tools-5.4.0-77-generic. I'm executing the $ sudo apt install linux-tools-5.4.0-77-generic command but it gaves me the next error:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-tools-5.4.0-77-generic
E: Couldn't find any package by glob 'linux-tools-5.4.0-77-generic'

I've tried:

  1. $ sudo apt upgrade.
  2. $ sudo apt update.
  3. Editing /etc/apt/sources.list manually.
  4. Download the binary files from https://ubuntu.pkgs.org/18.04/ubuntu-updates-main-amd64/linux-tools-5.4.0-77-generic_5.4.0-77.86~18.04.1_amd64.deb.html and installing manually with $ sudo apt install ./path/to/binary.file.deb.

Please follow the next github issue to get more details about my WSL environment.

Issue on WSL.

Thanks in advance, I'm still learning about WSL.

3
  • Ubuntu is based on Debian but they are very different. NEVER use packages from one on the other. The guide you followed is for Ubuntu. Commented Nov 9, 2021 at 12:40
  • That's what I suspect, but where can I find for similar packages? Is that means I can't proceed with the guide because there isn't a similar package for Debian? Commented Nov 9, 2021 at 17:41
  • I haven't tried it on Debian, but a quick search says that the usbip tools (which are in linux-tools on Ubuntu) are in the usbip package on Debian Buster. See if that works, and we can add it as an answer if so. Commented Nov 10, 2021 at 2:18

1 Answer 1

9

This turns out to be even easier in Debian than in Ubuntu. Simply:

sudo apt install usbip hwdata usbutils

There's no need to modify sudoers with visudo since Debian installs usbib to /usr/sbin (which is already in the secure_path.

Given the above, and assuming Debian is your default WSL instance, then the rest of the instructions (e.g. usbipd wsl) should work.

However, at this point, the usbipd wsl only seems to work with the default WSL instance. If Debian is not your default WSL distribution (as noted by wsl -l -v), then you just need to set things up in two stages.

First, share/bind the device from Windows (in an Administrator prompt):

usbipd list
usbipd bind --busid <bus-id>

Then attach to it from inside Debian via:

sudo usbip attach -r $HOSTNAME.local -b <bus-id>

The $HOSTNAME.local uses mDNS to connect to the Windows host.

lsusb should then show the device.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .