usbipd attach did not work on wsl
Windows Version
11
WSL Version
2.5.7.0
Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
Kernel Version
Linux version 6.6.87.1-microsoft-standard-WSL2
Distro Version
Ubuntu 22.04
Other Software
On windows 11 When using usbipd attach,
usbipd attach --wsl Ubuntu-22.04 --busid 2-2
it fails with WARNING: usbipd not found for kernel 6.6.87.1-microsoft.
You may need to install the following packages for this specific kernel: linux-tools-6.6.87.1-microsoft-standard-WSL2 linux-cloud-tools-6.6.87.1-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
This happens on both clean installs of Ubuntu 24.04 and 22.04.
The required package linux-tools-6.6.87.1-microsoft-standard-WSL2 cannot be located by apt in any standard or Microsoft repository.
Repro Steps
Start with a fully updated Windows machine.
Install a clean distribution of Ubuntu 22.04 LTS from the Microsoft Store or via wsl --install -d Ubuntu-22.04.
Launch the new Ubuntu 22.04 instance and run sudo apt update && sudo apt upgrade -y to ensure the system is up to date.
On the Windows host, in PowerShell, bind a USB device (e.g., a webcam) using usbipd bind --busid
Attempt to attach the device to the WSL instance: usbipd attach --wsl Ubuntu-22.04 --busid
Following the warning's advice, attempt to install the required tools inside Ubuntu 22.04: sudo apt install linux-tools-6.6.87.1-microsoft-standard-WSL2. This fails because the package cannot be located.
As a workaround, install the standard Hardware Enablement (HWE) tools, which should provide support for newer kernels: sudo apt install linux-tools-virtual-hwe-22.04. This command succeeds.
After the successful installation of HWE tools, re-attempt to attach the device from PowerShell (usbipd attach...). The original warning persists, indicating that the installed HWE tools are not being recognized by usbipd.
The same sequence of failures occurs on a clean installation of Ubuntu 24.04 LTS.
Expected Behavior
After successfully installing the appropriate kernel tools package on Ubuntu 22.04 (e.g., linux-tools-virtual-hwe-22.04), the usbipd attach command should successfully connect the USB device to the WSL2 instance without warnings.
Actual Behavior
The usbipd attach command consistently fails with the following warning, even after installing the linux-tools-virtual-hwe-22.04 package:
WARNING: usbipd not found for kernel 6.6.87.1-microsoft
You may need to install the following packages for this specific kernel: linux-tools-6.6.87.1-microsoft-standard-WSL2 linux-cloud-tools-6.6.87.1-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
Diagnostic Logs
lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.5 LTS Release: 22.04 Codename: jammy
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1
The script will output the path of the log file once done.
If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here
Once completed please upload the output files to this Github issue.
Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.
This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.
Thank you!