Skip to content

WSL usbip: error: Attach Request failed - Device in error state #1212

Open
@Girmii

Description

@Girmii

Issue

I'm trying to set up a serial connection with an Arduino Mega 2560 R3 in WSL. I know this is possible because it has worked for the last couple of months. However, since last week I can't get the device to show up in WSL.
The device is still accessible and responsive through Putty on the Windows host.

Environment info

PS> usbipd --version
5.1.0-41+Branch.master.Sha.fe06088bb6916e6722bd66b03d245141ae8ec6c1.fe06088bb6916e6722bd66b03d245141ae8ec6c1
> uname -a
Linux DESKTOP 6.6.87.1-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 17:08:54 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy

Connection logs

Bind without force

PS> usbipd bind --busid 1-6
PS> usbipd attach --wsl --busid 1-6
usbipd: info: Using WSL distribution 'Ubuntu' to attach; the device will be available in all WSL 2 distributions.
usbipd: info: Detected networking mode 'nat'.
usbipd: info: Using IP address 172.26.176.1 to reach the host.
WSL usbip: error: Attach Request for 1-6 failed - Device in error state
usbipd: error: Failed to attach device with busid '1-6'.
PS> usbipd server Logging:LogLevel:Default=Trace
dbug: Microsoft.Extensions.Hosting.Internal.Host[1]
      Hosting starting
dbug: Usbipd.PcapNg[1000]
      usbipd:PcapNg:Path = ''
dbug: Usbipd.Server[1000]
      usbipd:Port = 3240
dbug: Usbipd.Server[1000]
      5.1.0-41+Branch.master.Sha.fe06088bb6916e6722bd66b03d245141ae8ec6c1
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\Users\GirmiSchouten
dbug: Microsoft.Extensions.Hosting.Internal.Host[2]
      Hosting started
dbug: Usbipd.Server[1000]
      new connection from 172.26.184.4
dbug: Usbipd.Server[1000]
      connection close: Unable to read beyond the end of the stream.
dbug: Usbipd.Server[1000]
      connection closed
dbug: Usbipd.Server[1000]
      new connection from 172.26.184.4
dbug: Usbipd.ConnectedClient[1000]
      Received opcode: OP_REQ_IMPORT
fail: Usbipd.ConnectedClient[3]
      An exception occurred while communicating with the client:
      System.IO.FileNotFoundException: Unable to find the specified file.
         at Usbipd.ConfigurationManager.GetVBoxDevice(BusId) + 0x153
         at Usbipd.VBoxUsb.<ClaimDeviceOnce>d__0.MoveNext() + 0x6b
      --- End of stack trace from previous location ---
         at Usbipd.VBoxUsb.<ClaimDevice>d__1.MoveNext() + 0x17e
      --- End of stack trace from previous location ---
         at Usbipd.VBoxUsb.<ClaimDevice>d__1.MoveNext() + 0x2b9
      --- End of stack trace from previous location ---
         at Usbipd.ConnectedClient.<HandleRequestImportAsync>d__8.MoveNext() + 0xf03
      --- End of stack trace from previous location ---
         at Usbipd.ConnectedClient.<HandleRequestImportAsync>d__8.MoveNext() + 0x18f9
      --- End of stack trace from previous location ---
         at Usbipd.ConnectedClient.<RunAsync>d__5.MoveNext() + 0x32f
dbug: Usbipd.Server[1000]
      connection close: Unable to find the specified file.
dbug: Usbipd.Server[1000]
      connection closed

Bind with force

PS> usbipd bind --force --busid 1-6
PS> usbipd attach --wsl --busid 1-6
usbipd: info: Using WSL distribution 'Ubuntu' to attach; the device will be available in all WSL 2 distributions.
usbipd: info: Detected networking mode 'nat'.
usbipd: info: Using IP address 172.26.176.1 to reach the host.
PS> usbipd server Logging:LogLevel:Default=Trace
dbug: Microsoft.Extensions.Hosting.Internal.Host[1]
      Hosting starting
dbug: Usbipd.PcapNg[1000]
      usbipd:PcapNg:Path = ''
dbug: Usbipd.Server[1000]
      usbipd:Port = 3240
dbug: Usbipd.Server[1000]
      5.1.0-41+Branch.master.Sha.fe06088bb6916e6722bd66b03d245141ae8ec6c1
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\Users\GirmiSchouten
dbug: Microsoft.Extensions.Hosting.Internal.Host[2]
      Hosting started
dbug: Usbipd.Server[1000]
      new connection from 172.26.184.4
dbug: Usbipd.Server[1000]
      connection close: Unable to read beyond the end of the stream.
dbug: Usbipd.Server[1000]
      connection closed
dbug: Usbipd.Server[1000]
      new connection from 172.26.184.4
dbug: Usbipd.ConnectedClient[1000]
      Received opcode: OP_REQ_IMPORT
dbug: Usbipd.ConnectedClient[1000]
      Claiming took 316 ms
info: Usbipd.ConnectedClient[1]
      Client 172.26.184.4 claimed device at 1-6 (USB\VID_2341&PID_0042\33436323438351100331).
dbug: 1-6.0[1000]
      Endpoint created
dbug: 1-6.0[1000]
      USBSUP_XFER_STALL -> EPIPE -> -32
dbug: 1-6.0[1000]
      USBSUP_XFER_STALL -> EPIPE -> -32
dbug: 1-6.0[1000]
      USBSUP_XFER_STALL -> EPIPE -> -32
dbug: 1-6.0[1000]
      USBSUP_XFER_STALL -> EPIPE -> -32
dbug: 1-6.0[1000]
      USBSUP_XFER_STALL -> EPIPE -> -32
dbug: 1-6.0[1000]
      USBSUP_XFER_STALL -> EPIPE -> -32
dbug: 1-6.0[1000]
      Endpoint created
dbug: 1-6.0[1000]
      Trapped SET_CONFIGURATION: 1
> lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 2341:0042 Arduino SA Mega 2560 R3 (CDC ACM)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> dmesg
[ 2619.122359] vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(3)
[ 2619.123452] vhci_hcd vhci_hcd.0: devid(65542) speed(2) speed_str(full-speed)
[ 2619.124901] vhci_hcd vhci_hcd.0: Device attached
[ 2619.302078] vhci_hcd: vhci_device speed not set
[ 2619.366370] usb 1-1: new full-speed USB device number 4 using vhci_hcd
[ 2619.438034] vhci_hcd: vhci_device speed not set
[ 2619.498083] usb 1-1: SetAddress Request (4) to port 0

Before, attaching the device worked without the bind --force. However, even with the --force flag the device does not show up under /dev/ttyACM where it did before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions