Reputation: 617
I'm attempting to do embedded systems development within a WSL2 Linux (Ubuntu 20.04) and getting the error:
usbipd: warning: USB filter 'USBPcap' is known to be incompatible with this software; 'bind --force' will be required.
In powershell, running a usbipd wsl list
is when I see the error 'bind --force' will be required (full output below).
I am unsure exactly why this occurs & is required, the --force behavior is not documented / does not appear in a google search. Example:
PS C:\Users\Hidden> usbipd wsl list
BUSID DEVICE STATE
1-3 Logitech USB Input Device, USB Input Device Not attached
1-4 Printer XYZ Series, USB Printing Support, USB Mass Stor... Not attached
1-7 USB Input Device Not attached
1-8 USB Input Device Not attached
1-10 Intel(R) Wireless Bluetooth(R) Not attached
1-11 USB 2.0 Webcam Device Not attached
1-12 Realtek USB 2.0 Card Reader Not attached
usbipd: warning: USB filter 'USBPcap' is known to be incompatible with this software; 'bind --force' will be required.
I'm using the Windows 11, insider stable release channel with all patches applied. WSL1 is slow, the disk bindings are different, it doesn't have WSLG (so I can't run Linux GUI software)
WSL2 has one major drawback - it does not presently support USB devices, that is unless you follow the instructions from Ben McMorran Senior Software Engineer, C++ Team @ Microsoft who writes about USBIPD which exports a USB device from the Windows Host using TCP/IP to the Linux machine here:
https://devblogs.microsoft.com/commandline/connecting-usb-devices-to-wsl/
A google search turns up few if any useful tips/others related to --force.
I thought I'd post this question here to start a discussion for other people experiencing the same pain & frustration feel being required to --force my USB ports.
Upvotes: 3
Views: 9790
Reputation: 1
WSL2 I'm using "usbipd wsl attach -b x-y -a" and just ignoring the warning about USBPcap (Wireshark needs it). That seems to work for most things.
My Virtual COM Port doesn't work inside the VM, but so far that's the only thing I can't do. My test harness works great (uses EP0 for the most part).
Upvotes: 0
Reputation: 114
Step 1.
Restart all terminals and/or shells.
Step 2.
The Force bind command for usbipd is as follows:
$PS C:\WINDOWS\System32>
usbipd bind --busid <the bus id> -f
you can get the usb pid list with the
usbipd devices -l
command.
The Usbipd format has to be 1-int . My exact command looks like this:
PS C:\WINDOWS\system32> usbipd bind --busid 1-11 -f
I had the same exact problem you got.
I personally, get frustrated with wsl... However I executed the above command, and it fixed the USBCAP force bind software mismatch flag. the --busid
or -b
flag is location sensitive, it must come immediately after usbipd bind
-b
or --busid <busid>
then followed by -f
or --force
.
Step 1.
Open admin PowerShell:
[Windows key] + [x]
then press
[a]
...Type the following command:
wsl --set-version Ubuntu 2
[Note: that the distro name can be found using the command wsl -l
]
if you are using debian use Debian
, if you are using the community arch distro use Arch
as your distro.
if this doesnt work and you recently installed Pcap or usbcap, consider restarting your computer completely to apply hidden changes require to hypervisor bind to a network interface.
usbipd: warning: USB filter 'USBPcap' is known to be incompatible with this software; 'bind --force' will be required.
PS C:\WINDOWS\system32> usbipd bind --busid 1-11 -f
usbipd: warning: A reboot may be required before the changes take effect.
PS C:\WINDOWS\system32> usbipd bind --busid 1-11 -f
usbipd: info: Device with busid '1-11' was already shared.
PS C:\WINDOWS\system32> history
Id CommandLine
-- -----------
1 winget install --interactive --exact dorssel.usbipd-win
2 usbipd wsl list
3 usbipd wsl attach --busid 1-11
4 usbipd wsl attach --busid 1-11 bind --force
5 usbipd wsl attach --busid 1-11 bind -d Ubuntu
6 usbipd wsl attach --busid 1-11 -d Ubuntu
7 usbipd wsl attach --busid 11 -d Ubuntu
8 usbipd wsl attach --busid 1-11 -d Ubuntu
9 usbipd wsl attach --busid 1-11 -d Ubuntu --force
10 usbipd wsl attach --busid 1-11 -d Ubuntu -a
11 usbipd wsl attach --busid 1-11 -d Ubuntu -a
12 usbipd wsl attach --busid 1-11 -d Ubuntu
13 usbipd wsl list
14 usbipd bind --busid 1-11 -f
15 usbipd bind --busid 1-11 -f
PS C:\WINDOWS\system32>
Upvotes: 2
Reputation: 1
usbipd bind -f worked fine for me with WSL2. I had still had to recompile the kernel to build the usb modules since they aren't included in Win10.
Another option is to install socat for Windows and WSL2/Ubuntu
I used the socat packaged with Cygwin which uses unix paths for Windows serial ports so /dev/ttyS3 corresponds to COM4. Socat is supplied as source only so you'll have to find the windows version in a unix/linux ports or compile your own.
Socat doesn't require additional drivers and handy if the WSL kernel is missing the modules. It also let me work around a buggy Linux USB serial driver. The drawback is the Linux side has no control of the real serial port baud rate or hardware handshaking.
Windows:
socat TCP-LISTEN:4444,fork /dev/ttyS3,raw
Linux/WSL2
socat pty,link=/tmp/ttyUSB0,echo=0,raw tcp:172.18.32.1:4444 &
Upvotes: 0
Reputation: 617
NOT A SOLUTION: 'Use Windows' Arduino, ESP32 xtensa, etc. dev experience is unparalleled under Linux especially with WSLG, no annoying C:\dir with spaces stupidity, please don't suggest I do my development in Windows!
NOT A SOLUTION: No I won't uninstall USBPCap, it's required for either my USB probes or Oscilloscope (which incidentally requires Windows)
Now to understand what the --force setting does, here is the CLI:
PS C:\Users\MyHome> usbipd bind
Option '--busid' is required.
usbipd-win 2.1.0
Description:
Registers a single USB device for sharing, so it can be attached to other machines. Unless the --force option is used, shared devices remain available to the host until they are attached to another machine.
Usage:
usbipd bind [options]
Options:
-b, --busid <BUSID> (REQUIRED) Share device having <BUSID>
-f, --force Force binding; the host cannot use the device
-?, -h, --help Show help and usage information
I'd appreciate examples of how anybody presently uses usbipd and/or known work-arounds for this issue. Obviously the --force gets it done, but it feels like using a nail when the task called for a screw.
I may try to submit an issue and/or patch to the winpcap/LibUSBpcap team, any answers which tell me how to do this without using the --force or removing the warning will definitely get the answer marked as solved. ;-)
Upvotes: 0