dorssel / usbipd-win

Windows software for sharing locally connected USB devices to other machines, including Hyper-V guests and WSL 2.
GNU General Public License v3.0
3.64k stars 231 forks source link

Can't connect iPhone to WSL #968

Closed d0n13 closed 4 months ago

d0n13 commented 4 months ago

Hi @dorssel

I've been having this exact issue on Linux so I switched to WSL to see if it worked. Not doing anything special but it just stopped working a few days ago and I've been trying to locate the issue.

$ usbipd bind -b 2-3
$ usbipd attach --wsl -b 2-3
usbipd: info: Using WSL distribution 'Ubuntu-24.04' to attach; the device will be available in all WSL 2 distributions.
usbipd: info: Using IP address 172.29.96.1 to reach the host.

$ usbipd.exe list

Connected:
BUSID  VID:PID    DEVICE                                                        STATE
2-3    05ac:12a8  Apple Mobile Device USB Composite Device                      Shared
2-6    1bcf:28cf  Integrated Webcam                                             Not shared
2-8    0a5c:5842  Dell ControlVault w/o Fingerprint Sensor, Microsoft Usbcc...  Not shared
2-10   8087:0026  Intel(R) Wireless Bluetooth(R)                                Not shared
3-2    0bda:8153  Realtek USB GbE Family Controller                             Not shared
4-1    256f:c652  USB Input Device                                              Not shared
4-3    046d:c52b  Logitech USB Input Device, USB Input Device                   Not shared
4-5    0bda:4014  Realtek USB Audio                                             Not shared

Persisted:
GUID                                  DEVICE

I do a bind and an attach and it fails. No error on Windows side but no device on WSL side. This is what syslog on WSL is reporting... Thing is the log on the Linux machine was identical, so not sure where the issue is...

Any ideas? Thanks Donie

2024-06-04T14:49:27.708165+01:00 DESKTOP-LVPVFTP kernel: vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(3)
2024-06-04T14:49:27.708202+01:00 DESKTOP-LVPVFTP kernel: vhci_hcd vhci_hcd.0: devid(131075) speed(3) speed_str(high-speed)
2024-06-04T14:49:27.708203+01:00 DESKTOP-LVPVFTP kernel: vhci_hcd vhci_hcd.0: Device attached
2024-06-04T14:49:28.058238+01:00 DESKTOP-LVPVFTP kernel: usb 1-1: new high-speed USB device number 3 using vhci_hcd
2024-06-04T14:49:28.208240+01:00 DESKTOP-LVPVFTP kernel: usb 1-1: SetAddress Request (3) to port 0
2024-06-04T14:49:28.238108+01:00 DESKTOP-LVPVFTP kernel: usb 1-1: New USB device found, idVendor=05ac, idProduct=12a8, bcdDevice=13.02
2024-06-04T14:49:28.238138+01:00 DESKTOP-LVPVFTP kernel: usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
2024-06-04T14:49:28.238140+01:00 DESKTOP-LVPVFTP kernel: usb 1-1: Product: iPhone
2024-06-04T14:49:28.238140+01:00 DESKTOP-LVPVFTP kernel: usb 1-1: Manufacturer: Apple Inc.
2024-06-04T14:49:28.238141+01:00 DESKTOP-LVPVFTP kernel: usb 1-1: SerialNumber: 00008101001E48XXXxxxxxxx
2024-06-04T14:49:28.277588+01:00 DESKTOP-LVPVFTP systemd[1]: Started usbmuxd.service - Socket daemon for the usbmux protocol used by Apple devices.
2024-06-04T14:49:28.281753+01:00 DESKTOP-LVPVFTP usbmuxd[643]: [14:49:28.281][3] usbmuxd v1.1.1-56-g360619c starting up
2024-06-04T14:49:28.282106+01:00 DESKTOP-LVPVFTP usbmuxd[643]: [14:49:28.282][3] Successfully dropped privileges to 'usbmux'
2024-06-04T14:49:28.282155+01:00 DESKTOP-LVPVFTP usbmuxd[643]: [14:49:28.282][3] Using libusb 1.0.27
2024-06-04T14:49:28.283264+01:00 DESKTOP-LVPVFTP usbmuxd[643]: [14:49:28.283][3] Initialization complete
2024-06-04T14:49:28.283317+01:00 DESKTOP-LVPVFTP usbmuxd[643]: [14:49:28.283][3] Enabled exit on SIGUSR1 if no devices are attached. Start a new instance with "--exit" to trigger.
2024-06-04T14:49:28.283941+01:00 DESKTOP-LVPVFTP usbmuxd[643]: [14:49:28.283][2] Switching device 1-3 mode to 3
2024-06-04T14:49:28.293546+01:00 DESKTOP-LVPVFTP usbmuxd[643]: [14:49:28.293][2] Cannot find device entry while removing USB device 0x55bc9639aed0 on location 0x10003
2024-06-04T14:49:28.293632+01:00 DESKTOP-LVPVFTP usbmuxd[643]: [14:49:28.293][2] Cannot find device entry while removing USB device 0x55bc9639aed0 on location 0x10003
2024-06-04T14:49:28.297615+01:00 DESKTOP-LVPVFTP usbmuxd[643]: [14:49:28.297][3] usbmuxd shutting down
2024-06-04T14:49:28.298105+01:00 DESKTOP-LVPVFTP kernel: vhci_hcd: connection closed
2024-06-04T14:49:28.298132+01:00 DESKTOP-LVPVFTP kernel: vhci_hcd: stop threads
2024-06-04T14:49:28.298133+01:00 DESKTOP-LVPVFTP kernel: vhci_hcd: release socket
2024-06-04T14:49:28.298134+01:00 DESKTOP-LVPVFTP kernel: vhci_hcd: disconnect device
2024-06-04T14:49:28.298134+01:00 DESKTOP-LVPVFTP kernel: usb 1-1: USB disconnect, device number 3
2024-06-04T14:49:28.398482+01:00 DESKTOP-LVPVFTP usbmuxd[643]: [14:49:28.398][3] Shutdown complete
2024-06-04T14:49:28.399278+01:00 DESKTOP-LVPVFTP systemd[1]: usbmuxd.service: Deactivated successfully.
d0n13 commented 4 months ago

These lines may be the issue?

[11:30:15.493][2] Cannot find device entry while removing USB device 0x557cda3664d0 on location 0x10006
[11:30:15.493][2] Cannot find device entry while removing USB device 0x557cda3664d0 on location 0x10006
d0n13 commented 4 months ago

Following the troubleshooting steps to run usbipd on command line. USB capture attach.zip

> 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]
      4.2.0+54.Branch.master.Sha.5b36605535dd52bc3d8a8e4bbaee7f4d480c86ad
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\donie\Documents\usbipd-win
dbug: Microsoft.Extensions.Hosting.Internal.Host[2]
      Hosting started
dbug: Usbipd.Server[1000]
      new connection from 172.29.100.120
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.29.100.120
dbug: Usbipd.ConnectedClient[1000]
      Received opcode: OP_REQ_IMPORT
dbug: Usbipd.ConnectedClient[1000]
      Claiming took 216 ms
info: Usbipd.ConnectedClient[1]
      Client 172.29.100.120 claimed device at 2-3 (USB\VID_05AC&PID_12A8\00008120001428D61EE8201E).
dbug: 2-3.0[1000]
      Endpoint created
dbug: 2-3.0[1000]
      Endpoint created
dbug: 2-3.0[1000]
      Trapped SET_CONFIGURATION: 1
dbug: 2-3.0[1000]
      Trapped SET_CONFIGURATION: 0
dbug: Usbipd.ConnectedClient[1000]
      Unbind or unplug while attached
info: Usbipd.ConnectedClient[2]
      Client 172.29.100.120 released device at 2-3 (USB\VID_05AC&PID_12A8\00008120001428D61EE8201E).
dbug: Usbipd.Server[1000]
      connection close: The operation was canceled.
dbug: Usbipd.Server[1000]
      connection closed
d0n13 commented 4 months ago

I reinstalled WSL and just used the distribution version of libmobieldevice and it worked again :(