Coder Social home page Coder Social logo

vadimgrn / usbip-win2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cezanne/usbip-win

366.0 366.0 41.0 5.45 MB

USB/IP Client for Windows

License: GNU General Public License v3.0

C 2.54% C++ 95.64% Inno Setup 1.13% Batchfile 0.50% Python 0.17% CMake 0.02%
usb-over-ethernet usb-over-ip usb-over-network usb-to-ethernet usbip usbip-client usbip-linux usbip-win vhci virtual-usb-hub

usbip-win2's People

Contributors

bartlomiejcieszkowski avatar brandonros avatar cezanne avatar cezuni avatar danice123 avatar dontech avatar george-hopkins avatar koudis avatar martindrab avatar mdilic avatar mfmooney avatar nraggett avatar oxalin avatar paulpv avatar red54 avatar rogermiranda1000 avatar rpasek avatar sileader avatar spog avatar stoyandimitrov avatar svirot avatar vadimgrn avatar wqrld avatar yalp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

usbip-win2's Issues

Why doesn't this project use the VHCI(UDE) driver?

Hi, thanks for developing this project.
I'd like to know why this project doesn't use the VHCI(UDE) driver.
I'm using the VHCI(UDE) driver of the https://github.com/cezanne/usbip-win project in my project, but the project has many problems.
So, I'm considering this project.
But, because this project uses the VHCI(WDM) driver, I'm struggling to properly change my project.
Please help me.

Calling usbip in cmd resulted in app crash in windows, but calling usbip.exe is working fine

usbip app crash event details:-
Faulting application name: usbip.exe, version: 0.9.5.7, time stamp: 0x654e04b0
Faulting module name: ucrtbase.dll, version: 10.0.19041.3636, time stamp: 0x81cf5d89
Exception code: 0xc0000409
Fault offset: 0x000000000007286e
Faulting process id: 0x1fec
Faulting application start time: 0x01da2f67cc8b8e7c
Faulting application path: C:\Program Files\USBip\usbip.exe
Faulting module path: C:\Windows\System32\ucrtbase.dll
Report Id: 9c6180f4-8941-49ce-93d8-5faf1a3ff571
Faulting package full name:
Faulting package-relative application ID:

C:\Users\Administrator>usbip --help <<< no output and app crash event created in windows event

C:\Users\Administrator>usbip.exe --help
USB/IP client
Usage: usbip.exe [OPTIONS] SUBCOMMAND

Options:
-h,--help Print this help message and exit
-V,--version Display program version information and exit
-d,--debug Debug output
-t,--tcp-port TEXT:INT in [1024 - 65535] [3240]
TCP/IP port number of USB/IP server

Subcommands:
attach Attach to a remote/stashed USB device(s)
detach Detach a remote USB device
list List exportable/stashed USB devices
port Show/stash imported USB devices

usbip-win2 on Wine

I'm trying to use an usbip client for windows on wine. Unfortunately, it fails to install and run [1]. Do you have any plans to make it work on Wine ?

USBHub3.sys BSOD on device disconnect

When running ~130mb/s of data over the link for a long enough period of time, I get a BSOD. It appears to be from the device disconnecting and reconnecting.
The stack dump is:

SYSTEM_THREAD_EXCEPTION_NOT_HANDLED (7e)
This is a very common BugCheck.  Usually the exception address pinpoints
the driver/function that caused the problem.  Always note this address
as well as the link date of the driver/image that contains this address.
Arguments:
Arg1: ffffffffc0000005, The exception code that was not handled
Arg2: fffff80028a8f47c, The address that the exception occurred at
Arg3: fffff900b2a84288, Exception Record Address
Arg4: fffff900b2a83ac0, Context Record Address

Debugging Details:
------------------
KEY_VALUES_STRING: 1

    Key  : Analysis.CPU.mSec
    Value: 29983

    Key  : Analysis.DebugAnalysisManager
    Value: Create

    Key  : Analysis.Elapsed.mSec
    Value: 30298

    Key  : Analysis.IO.Other.Mb
    Value: 1

    Key  : Analysis.IO.Read.Mb
    Value: 0

    Key  : Analysis.IO.Write.Mb
    Value: 26

    Key  : Analysis.Init.CPU.mSec
    Value: 2655

    Key  : Analysis.Init.Elapsed.mSec
    Value: 26247

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 112

    Key  : Bugcheck.Code.DumpHeader
    Value: 0x7e

    Key  : Bugcheck.Code.KiBugCheckData
    Value: 0x7e

    Key  : Bugcheck.Code.Register
    Value: 0x7e

    Key  : WER.OS.Branch
    Value: vb_release

    Key  : WER.OS.Timestamp
    Value: 2019-12-06T14:06:00Z

    Key  : WER.OS.Version
    Value: 10.0.19041.1

FILE_IN_CAB:  MEMORY.DMP

VIRTUAL_MACHINE:  VirtualBox

BUGCHECK_CODE:  7e

BUGCHECK_P1: ffffffffc0000005

BUGCHECK_P2: fffff80028a8f47c

BUGCHECK_P3: fffff900b2a84288

BUGCHECK_P4: fffff900b2a83ac0

EXCEPTION_RECORD:  fffff900b2a84288 -- (.exr 0xfffff900b2a84288)
ExceptionAddress: fffff80028a8f47c (nt!ExFreeHeapPool+0x000000000000076c)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000000
   Parameter[1]: 0000000000000000
Attempt to read from address 0000000000000000

CONTEXT:  fffff900b2a83ac0 -- (.cxr 0xfffff900b2a83ac0)
rax=0000000000000000 rbx=ffffb68305bddd70 rcx=0000000000000016
rdx=0000000000000000 rsi=0000000000000000 rdi=a2e64eada2e64ead
rip=fffff80028a8f47c rsp=fffff900b2a844c0 rbp=0000000000000000
 r8=0000000000000000  r9=0000000000000000 r10=0000000000000000
r11=fffff8002d2484e8 r12=0000000000000000 r13=0000000000000200
r14=0000000000000000 r15=0000000000000001
iopl=0         nv up ei ng nz na pe nc
cs=0010  ss=0018  ds=002b  es=002b  fs=0053  gs=002b             efl=00010282
nt!ExFreeHeapPool+0x76c:
fffff800`28a8f47c 488b18          mov     rbx,qword ptr [rax] ds:002b:00000000`00000000=????????????????
Resetting default scope

BLACKBOXBSD: 1 (!blackboxbsd)


BLACKBOXNTFS: 1 (!blackboxntfs)


BLACKBOXPNP: 1 (!blackboxpnp)


BLACKBOXWINLOGON: 1

EXCEPTION_STR:  0xc0000005

STACK_TEXT:  
fffff900`b2a844c0 fffff800`291b5019     : 00000000`00000000 00000000`00000000 00000000`00000000 01000000`00100000 : nt!ExFreeHeapPool+0x76c
fffff900`b2a845a0 fffff800`2d1b5b0d     : 00000000`ffffffff 00000000`00000001 00000000`1c341c5c 00000000`00000000 : nt!ExFreePool+0x9
fffff900`b2a845d0 fffff800`2d1b40cb     : 00000000`00000000 fffff900`b2a84680 00000000`00000004 00000000`00000000 : Wdf01000!FxRegKey::`scalar deleting destructor'+0x8d
fffff900`b2a84610 fffff800`2d1b2a46     : ffffb683`012b7d60 fffff800`2d1ba67a 00000000`c0000034 0000497c`fa421248 : Wdf01000!FxObject::SelfDestruct+0x1b [minkernel\wdf\framework\shared\inc\private\common\fxobject.hpp @ 453] 
fffff900`b2a84640 fffff800`2d1b5f0d     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000001 : Wdf01000!FxObject::Release+0x106 [minkernel\wdf\framework\shared\inc\private\common\fxobject.hpp @ 884] 
fffff900`b2a84690 fffff800`2d1b3c08     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : Wdf01000!FxObject::DeleteObject+0x19d [minkernel\wdf\framework\shared\object\fxobjectstatemachine.cpp @ 124] 
fffff900`b2a84710 fffff800`30b8e55e     : 00000000`00000000 ffffb683`05bddd70 00000000`00000000 00000000`00000000 : Wdf01000!imp_WdfRegistryClose+0x78 [minkernel\wdf\framework\shared\support\fxregistryapi.cpp @ 327] 
fffff900`b2a84760 fffff800`30b8c708     : ffffb683`05769894 00000000`00000fa0 ffffb683`057692c8 00000000`0000afd1 : UsbHub3!HUBREG_QueryUsbflagsValuesForDevice+0xb4e
fffff900`b2a84920 fffff800`30b2e9e0     : 00000000`00000000 ffffb683`03a08410 ffffb683`057692c8 00000000`ffffffff : UsbHub3!HUBMISC_QueryAndCacheRegistryValuesForDevice+0x54
fffff900`b2a84990 fffff800`30b1a737     : ffffb683`00000000 00000000`0000afd1 fffff900`00000000 01000000`00100000 : UsbHub3!HUBDSM_QueryingRegistryValuesForAlternateDeviceEnumeration+0x10
fffff900`b2a849c0 fffff800`30b1aecf     : 00000000`00000000 00000000`00000000 fffff800`00000fa0 fffff800`30b76b80 : UsbHub3!HUBSM_ExecuteEntryFunctionsAndPushPopStateMachinesForCurrentState+0x87
fffff900`b2a84a60 fffff800`3095a770     : ffffb683`03a08410 fffff800`30b1aeb0 ffffb683`0138eb60 fffff800`30b1aeb0 : UsbHub3!HUBSM_EvtSmWorkItem+0x1f
fffff900`b2a84aa0 fffff800`3095a6f9     : ffffb683`034aee50 ffffb683`0138eb60 00000000`00000000 fffff800`3095a6f0 : ucx01000!Controller_ForwardProgressWorkItemCallback+0x60
fffff900`b2a84ad0 fffff800`28a07d53     : 00000000`00000000 00000000`00000000 00000000`00000000 fffff800`2fd95440 : ucx01000!Controller_ForwardProgressWorkItemWdmCallback+0x9
fffff900`b2a84b00 fffff800`28abdef5     : ffffb682`fc245080 ffffb682`fc245080 fffff800`28a07cc0 ffffb682`00000000 : nt!IopProcessWorkItem+0x93
fffff900`b2a84b70 fffff800`28a55485     : ffffb682`fc245080 00000000`00000080 ffffb682`fbc7e080 000fa005`b8bb3dfe : nt!ExpWorkerThread+0x105
fffff900`b2a84c10 fffff800`28c02d48     : ffff8e80`2e3a0180 ffffb682`fc245080 fffff800`28a55430 00000000`00000000 : nt!PspSystemThreadStartup+0x55
fffff900`b2a84c60 00000000`00000000     : fffff900`b2a85000 fffff900`b2a7f000 00000000`00000000 00000000`00000000 : nt!KiStartSystemThread+0x28


SYMBOL_NAME:  UsbHub3!HUBREG_QueryUsbflagsValuesForDevice+b4e

MODULE_NAME: UsbHub3

IMAGE_NAME:  UsbHub3.sys

IMAGE_VERSION:  10.0.19041.1202

STACK_COMMAND:  .cxr 0xfffff900b2a83ac0 ; kb

BUCKET_ID_FUNC_OFFSET:  b4e

FAILURE_BUCKET_ID:  AV_UsbHub3!HUBREG_QueryUsbflagsValuesForDevice

OS_VERSION:  10.0.19041.1

BUILDLAB_STR:  vb_release

OSPLATFORM_TYPE:  x64

OSNAME:  Windows 10

FAILURE_ID_HASH:  {9865597a-443d-22dc-6f2b-3f61bcf3e013}

Followup:     MachineOwner
---------

The issue appears to be from UCX handling a WorkItem. I'll look further into their use to see if there's a possible faulty WorkItem being passed.

Linux client support?

Hi, does this have Linux client support? I need to host a USB device on a Hyper-V host and use this USB divice in a Ubuntu guest VM.

Drive unloading

Hello, when a device is created in the bus driver and the device is in use, and the bus driver is directly unloaded in the device manager, how do you ensure resource release?

Supported device addition for Wiki

I can't submit a edit to the wiki page for supported devices.

Just wanted to add one:

  • Apple
    • iPhone 13 Pro, iOS 17.0.1

I've got the iPhone connected to a Windows 11 machine, shared over IP to a Server 2019 machine. I was able to interact with the iPhone using iMazing, approve trusting the device, pull a backup and view data on the phone.

Server 2019: usbip-win2 UDE 0.9.5.6
Windows 11: usbipd-win 3.2.0

Driver not loading - Driver Entry Point Not Found

Installing the driver on Win10 I cannot get the driver to load with the error:

Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)

{Driver Entry Point Not Found}
The %hs device driver could not locate the entry point %hs in driver %hs.

I tried with several of the release packages, 9.0.1 up to 9.3.0.
Am I doing something wrong or is something missing from the driver or system?

tcp-port is bypassed

Hello @vadimgrn

I was testing your fork of windows client and I did the following scenario and it didn't work, seems the client ignores the tcp-port

  • create ssh tunnel for localhost:3000 to [IPV6 of the device]:3240
  • run uspip.exe list- r localhost --tcp-port 3000
  • got usbip: error: failed to connect a remote host: localhost
  • kill tunnel
  • create new tunnel from 3240 of localhost to 3240 of device's IPV6
  • run usbip.exe list -r localhost
  • it works

Can you check what's the problem with tcp-port?

HID Device not working after installing v.0.9.5.5

After Installation and rebooting the device (Windows 10 pro). Both Mouse and Keyboard connected to that machine stopped working. I tried connecting other Mouse keyboard and also tried to plug in on all USB port, Mouse and keyboard just not working after installation.

How can i improve quality of usb audio?

Hi, I am very impressed by what you've done. This project is the most stable and has the best performance within usb ip softwares.

I have been trying to pass USB headset to remote PC. When the driver is ude, I does not work at all. But in wdm mode, it works pretty. But there is cracking sound intermittently. Is there anything I can do for resolving crackling sound?

Project Status

hi,

if i understand your project properly, i think its fantastic and hope youre project is still active. i think your 'very' smart to conform to the linux USB/IP protocol.

so in theory i should be able to create an embedded host that acts as an usb hid keyboard host that connects to your client and also to a linux client too. that sound right?

im, creating a small embedded device to emulate usb host hid devices that connect to the clients via physical usb, bluetooth, and ip.

i have the usb and bluetooth working. so ready to focus on wifi.

thanks again for this project. happy to help if possible.

-bob

some experiences using usbip win-win and win-lin

development:
i'm working on a gui for the usbip client side for windows:
image
here you can easily attach and detach usb devices (usbip client gui works together with windows and linux usbip server)

here i made different experiences connecting from:
-windows (client) to windows (server)
and
-windows (client) to linux (server)

windows (client) to windows (server):
-here attaching the usb devices works very easy, but some usb devices like usb storage sticks are only working with wdm drivers
-so you have to adapt the devices to different usbip.exe versions (wdm or ude driver) by testing it out

windows (client) to linux (server):
-attaching usb devices sometimes needs fixes to work properly. so you have to create rules for some vendors or devices to get it work. these fixes are normally not needed in windows (client) to windows (server) scenario.
-ude drivers often leeds to bluescreen

results:
-crossplatform usage needs some tweaking and fixes with rules for wdm and ude usage
-it is not possible to use only one driver version, you have to mix both drivers and have to decide which usb device will work with which driver by testing and creating rules
-it is important to have the wdm driver version, because many usb devices will work only with that driver

questions:
-can you also say or comment something to these observations?
-would it be possible to have only one version of usbip-win2 which will work crossplatform or do you need both driver versions (wdm and ude) and you can't avoid creating vendor or device specific rules?
-can this info help you in developping further the usbip-win2 project?

bsod when trying to forward smart card or yubikey

Hi,

I have tried the following combinations. In all cases trying to connect smartcard reader or yubikey triggers bsod in windows client.

Status Server Client Device

bsod Android Windows Omnikey Smart Card Reader
bsod Android Windows Yubikey
bsod Linux Windows Yubikey
ok Linux Windows Mac keyboard
ok Android Linux Yubikey
ok Linux Linux Yubikey

Cheers
--pawel

error: No connection could be made because the target machine actively refused it.

Hi,

I/m using a Raspberry Zero with a clean install of Debian Bullseye Lite and a laser engraver connected to its USB port. USBip makes a successful bind on that side.

On windows 11, after installing USBip I try to access it but get the following error:

error: No connection could be made because the target machine actively refused it.

I can successfully ssh to the raspberry, its IP address is correct, I also used Virtualhere and successfully connected to the laser(but communication freezes after initial connection, that's why I'm trying USBip).

Do you have any idea how I can proceed?

Thanks!

Why prefer WDM over UDE?

Hey,

I'm by no means a driver developer or such, but I was wondering why did you choose to focus on WDM, as UDE is the tech that supersedes it, according to wikipedia.
Also, excerpt from ms website:
Should You Write a WDM Driver? If you are writing a new driver, consider using the [Kernel-Mode Driver Framework](https://docs.microsoft.com/en-us/windows-hardware/drivers/wdf/) (KMDF). KMDF provides interfaces that are simpler to use than WDM interfaces.

Cheers

Sharing USB dongle through local network

Instead of going from server to computer I'm trying to go from 1 computer to another. I have this dongle needed to open a software and I'm trying to accomplish that with the use of your driver. I was using Donglify for a week as a free trial and it worked very well, so I figured there must be free alternatives.

I'm at the step in your instruction where I need to list all available devices at a specific IP adress. From what I understand this is what I did : I installed the driver on the computer I want to be working WITHOUT the dongle. I did IPconfig on the console of the computer with the dongle plugged in and grabbed both its IPv4, IPv6 local (the fe80:: thing). got back on the computer without the dongle and ran the list -r command. it keeps saying failed to connect to remote host, what am I doing wrong (I'm kind of a newbie)

Windows server 2019 support

Interested installing this on a VM running Windows Server 2019 edition. When I try running the installer it says that "This Program does not support the version of windows your computer is running"

Windows Server 2019 is more or less similar enough to Windows 10/11. Thanks!

Working device report

I'm not sure what the criteria are for listing a device as "known to work" in the wiki. For what it's worth, I've used usbip-win2 0.9.3.2 to attach 1b35:1019 Anthem ARC Microphone and it worked without a hitch as far as I could tell, so perhaps that can be listed as a working device. I was able to complete room correction with ARC Genesis -- which is the device's purpose -- on a Windows VM using a microphone exported by a Linux box with usbipd.

How can i sign driver?

Hi, I recently purchased EV code signing certificate for personal purpose. I'd like to sign the latest release but i don't know how.

is there any guide for it?

usbip: error: can't connect to domain.com

Hi,

I have an USBIP Server running on Ubuntu Core 22.04 on Raspberry PI 3 Model B+, with 2 peripherals attached (a CH340 Serial Converter and a CP2102 USB to UART Converter).

In the very beginning, I used the cezanne/usbip-win binaries on Windows 10, and it was working with CH340, but whenever I attached the CP2102 the USB 3.0 Hub ceased to function -- I was seeing an exclamation mark in Device Manager and the ports were not available. Running only with CH340 was working flawlessly).

So I decided to give your binaries a try.
Server-wise the configuration remained the same.

I used a fresh install of Windows and ran all the necessary steps to install the USBIP Client.

Whenever I try to list the devices, it works.
On Windows I run C:\Windows\system32>usbip.exe --tcp-port 16125 list -r domain.com and I receive the device list:

usbip: info: using port "16125"
Exportable USB devices
======================
 - domain.com
    1-1.1.3: Silicon Labs : CP210x UART Bridge (10c4:ea60)
           : /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.3
           : (Defined at Interface level) (00/00/00)

    1-1.1.2: QinHeng Electronics : CH340 serial converter (1a86:7523)
           : /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2
           : (Defined at Interface level) (00/00/00)

Also, since I run the server with -d option, I also see that it's exported correctly:

usbipd: debug: usbipd.c:575:[do_standalone_mode] heartbeat timeout on ppoll()
usbipd: debug: usbipd.c:569:[do_standalone_mode] read event on fd[0]=3
usbipd: info: connection from XX.XX.XX.XX:63887
usbipd: info: received request: 0x8005(4)
usbipd: info: exportable devices: 2
libusbip: debug: usbip_common.c:114:[dump_usb_device] path                 = /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.3
libusbip: debug: usbip_common.c:115:[dump_usb_device] busid                = 1-1.1.3
libusbip: debug: usbip_common.c:121:[dump_usb_device] Device(C/SC/P)       = (Defined at Interface level) (00/00/00)
libusbip: debug: usbip_common.c:123:[dump_usb_device] bcdDevice            = 100
libusbip: debug: usbip_common.c:128:[dump_usb_device] Vendor/Product       = unknown vendor : unknown product (10c4:ea60)
libusbip: debug: usbip_common.c:130:[dump_usb_device] bNumConfigurations   = 1
libusbip: debug: usbip_common.c:131:[dump_usb_device] bNumInterfaces       = 0
libusbip: debug: usbip_common.c:133:[dump_usb_device] speed                = Full Speed(12Mbps)
libusbip: debug: usbip_common.c:136:[dump_usb_device] busnum               = 1
libusbip: debug: usbip_common.c:137:[dump_usb_device] devnum               = 5
libusbip: debug: usbip_common.c:114:[dump_usb_device] path                 = /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2
libusbip: debug: usbip_common.c:115:[dump_usb_device] busid                = 1-1.1.2
libusbip: debug: usbip_common.c:121:[dump_usb_device] Device(C/SC/P)       = unknown class / unknown subclass / unknown protocol (ff/00/00)
libusbip: debug: usbip_common.c:123:[dump_usb_device] bcdDevice            = 264
libusbip: debug: usbip_common.c:128:[dump_usb_device] Vendor/Product       = unknown vendor : unknown product (1a86:7523)
libusbip: debug: usbip_common.c:130:[dump_usb_device] bNumConfigurations   = 1
libusbip: debug: usbip_common.c:131:[dump_usb_device] bNumInterfaces       = 0
libusbip: debug: usbip_common.c:133:[dump_usb_device] speed                = Full Speed(12Mbps)
libusbip: debug: usbip_common.c:136:[dump_usb_device] busnum               = 1
libusbip: debug: usbip_common.c:137:[dump_usb_device] devnum               = 4
usbipd: info: request 0x8005(4): complete
usbipd: debug: usbipd.c:569:[do_standalone_mode] read event on fd[0]=3
usbipd: info: connection from XX.XX.XX.XX:63889
usbipd: info: received request: 0x8003(4)
usbipd: info: found requested device: 1-1.1.2
usbip: info: connect: 1-1.1.2
usbipd: debug: usbipd.c:152:[recv_request_import] import request busid 1-1.1.2: complete
usbipd: info: request 0x8003(4): complete
usbipd: debug: usbipd.c:575:[do_standalone_mode] heartbeat timeout on ppoll()

But when I try to attach a device, I receive the following error:

C:\Windows\system32>usbip.exe --tcp-port 16125 attach -r domain.com -b 1-1.1.2
usbip: info: using port "16125"
usbip: error: can't connect to domain.com:16125

I also enabled debug mode -d to see if I get more info:

C:\Windows\system32>usbip.exe -d --tcp-port 16125 attach -r domain.com -b 1-1.1.2
usbip: info: using port "16125"
usbip: debug: usbip.cpp:104:[run_command] running command: attach
usbip: debug: vhci.cpp:51:[vhci_driver_open] device path: \\?\usbip#ehci#1&79f5d87&0#{b8b60941-cacb-454a-a8d1-35acb8fa1f1e}
usbip: error: can't connect to domain.com:16125

The weird thing, is that the server reports that the device was successfully exported:

usbipd: debug: usbipd.c:575:[do_standalone_mode] heartbeat timeout on ppoll()
usbipd: debug: usbipd.c:569:[do_standalone_mode] read event on fd[0]=3
usbipd: info: connection from XX.XX.XX.XX:63894
usbipd: info: received request: 0x8003(4)
usbipd: info: found requested device: 1-1.1.2
usbip: info: connect: 1-1.1.2
usbipd: debug: usbipd.c:152:[recv_request_import] import request busid 1-1.1.2: complete
usbipd: info: request 0x8003(4): complete
usbipd: debug: usbipd.c:575:[do_standalone_mode] heartbeat timeout on ppoll()

I get the same thing for the second device as well (1-1.1.3).
If I try to attach a non-existent device just to see if I get the same message, it tells me that the device does not exist indeed:

C:\Windows\system32>usbip.exe -d --tcp-port 16125 attach -r domain.com -b 1-1.1.5
usbip: info: using port "16125"
usbip: debug: usbip.cpp:104:[run_command] running command: attach
usbip: debug: vhci.cpp:51:[vhci_driver_open] device path: \\?\usbip#ehci#1&79f5d87&0#{b8b60941-cacb-454a-a8d1-35acb8fa1f1e}
usbip: error: device not found by bus id: 1-1.1.5

The server also reports that the client tried to attach a non-existent device:

usbipd: debug: usbipd.c:575:[do_standalone_mode] heartbeat timeout on ppoll()
usbipd: debug: usbipd.c:569:[do_standalone_mode] read event on fd[0]=3
usbipd: info: connection from XX.XX.XX.XX:63918
usbipd: info: received request: 0x8003(4)
usbipd: info: requested device not found: 1-1.1.5
usbipd: debug: usbipd.c:139:[recv_request_import] import request busid 1-1.1.5: failed
usbipd: info: request 0x8003(4): failed
usbipd: debug: usbipd.c:575:[do_standalone_mode] heartbeat timeout on ppoll()

...so it's clear that it isn't a TCP connection problem (such as no route, firewall or similar).
Even more... the listing works, it just does not connect.

As said, it (partially) works with the cezanne/usbip-win implementation.

Things I tried:

  • Fresh Windows 10 Install (with all the updates)
  • Removing the port forwarding (currently using TCP port 16125) and leaving the default one 3240.
  • Installing the debug version (I received no further error)
  • Adding USBIP to the Windows Firewall or disabling the firewall completely

None of them changed anything.

I also tried to install the mentioned SDK and WDK in the readme, but I couldn't find the tracelog.exe binary for x64, for some reason it only installed it for arm and arm64.
I tried with an older version of WDK, but unfortunately I got no relevant information that could lead me to anything.
LE: I've attached debugging output in the next comment.
LE2: I also tried with an USB flash drive. Same error.

Server is running usbip (usbip-utils 2.0), kernel is Linux version 5.15.0-1021-raspi (buildd@bos02-arm64-062) (gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #23-Ubuntu SMP PREEMPT Fri Nov 25 15:27:43 UTC 202.

Any help is greatly appreciated.
Thank you,
A.

Note: I've hidden the domain and IP for privacy purposes.

UDE 9.5.0 Bug

Hi, I have a NodeMCU ESP8266 with https://github.com/thevoidnn/esp8266-wifi-cmsis-dap installed on it which turns it in to a usb wifi device as a dap link probe. But it seems that when I actually attach the usb device it doesn't show up in device manager on windows. This device works fine on linux usbip.

Here is my COM output thanks so much!

s1 handling dev attach request...
s1 sending header...
s1 sending device info...

  • GET 0x01 DEVICE DESCRIPTOR
  • GET 0x01 DEVICE DESCRIPTOR
  • GET 0x02 CONFIGURATION DESCRIPTOR
    Sending ALL CONFIG

Here is my device manager for you to see not sure why usbip root is not installed with a driver either.

image

Communications issue with the device

Hello,

We are using cezanne's WDM driver with a specific USB device and are trying to move to usbip-win2 (hopefully that will fix many of our issues ..)

When plugged in and powered, that device is in a specific mode called "diag mode"
usbip-win2 bind correctly the device in that first mode
We can then use a tool to switch the device's mode to a second mode call "passthru mode" : it will disconnect, do a soft reboot, and can be rebind in the second mode
The mode switch is physically visible on the device via a colored led blinking

Anyway, when bound with usbip-win2, the passthru mode cannot be reached : the led never blinks, the device is never disconnected, because there is no soft reboot
It seems that whatever communication happens between the soft and the device is somehow denied by the driver
There is no crash or whatever, the device is still seen in its first mode

I've fetched the logs using the procedure:
usbip-vhci.txt

I know this is not much information to work with ..
What could it be ?

Best regards,

Win10 BSOD when connecting to mouse on Win10 host running https://github.com/dorssel/usbipd-win

I am trying a mix of your https://github.com/vadimgrn/usbip-win2/releases/download/v.0.9.3.0/usbip-win2-0.9.3.0-Debug.exe usbip client talking to https://github.com/dorssel/usbipd-win's usbipd host.

On the host I bind the mouse and start the daemon:

C:\Program Files\usbipd-win>usbipd list
Connected:
BUSID  VID:PID    DEVICE                                                        STATE
8-2    1b1c:1b8b  USB Input Device                                              Not shared

C:\Program Files\usbipd-win>usbipd bind -b 8-2

C:\Program Files\usbipd-win>usbipd server
....

On the client I list and attach:

C:\Program Files\usbip-win2>usbip.exe list -r 10.0.0.11
Exportable USB devices
======================
 - 10.0.0.11
        8-2: Corsair : unknown product (1b1c:1b8b)
           : USB\VID_1B1C&PID_1B8B\1602D03FAF7A04C55F40C0F0F5001C06
           : (Defined at Interface level) (00/00/00)
           :  0 - Human Interface Device/Boot Interface Subclass/Mouse (03/01/02)
           :  1 - (Defined at Interface level) (00/00/00)

C:\Program Files\usbip-win2>usbip.exe attach -r 10.0.0.11 -b 8-2

The connection is established, but soon after the client PC BSODs in usbip2_vhci.sys

Interestingly, after reproing this a few times, my usbipd.exe binary is now a 0 byte file!
I checked Windows Defender and nothing has been reported as being quarantined.

I then tried to uninstall and reinstall usbipd-win2 and now it bluescreens during every uninstall attempt. :/

FWIW, The client PC that is BSODing also has cezanne's usbip client and host configured, so perhaps it is some conflict between the two apps?

UDE: BSOD on ConcurrencyCheck Deletion

Looks like the assertion for concurrency failed on deletion. BSOD dump is attached below:
BSOD Dump

Additional info:
This is running with a USB device sending 1000hz packets. The sheer number of packets coming through could be the cause. Replicated with a Tundra Tracker and running Libsurvive.

Eject flash drive from Explorer does not work

Eject is successful, but the drive is still there and is fully functional despite the system message "Safe to remove hardware". Eject from the system tray works as expected.
Affected versions - at least from 0.8.1.0, older versions were not tested.

Multiple bug & "low speed"

Hello I have tried the last three version :

  • 9.5.2 : usbip with or without parameters command output nothing
  • 9.3.4 : EDIT: works but still low speed for a webcam
  • 9.3.3 : usbip can list and attach but use "low speed" on USB cam where before it was using "fulll speed"

Let's try 9.3.2 !

can you remove testsigning after installing winusb?

is it possible to disable testsigning with bcdedit.exe /set testsigning off after you have installed winusb with the test certificates? is this possible for both ude and wdm driver releases or only for ude?

WDM: Failure to receive HID reports

Hey Vadym!
I've been experimenting around with a device which has its config loaded through repetitive HID reports.
When loading through UDE, the reports come through as expected, with no issues.
When loading through WDM, the reports appear to first come through with null data, then are double-received, leading to a total report twice the expected size.

When capturing this operation through Wireshark, it appears the process is exactly the same, with no incorrect actions taken. So the issue must be between the WDM driver and its handling of the userspace USB requests.

The actual userspace USB request is handled through this windows HIDAPI function:

BOOL ret = DeviceIoControl(dev->device_handle,
		IOCTL_HID_GET_FEATURE,
		data, (DWORD)length,
		data, (DWORD)length,
		&bytes_returned, &overlap);

Attached below is:

Is there anywhere I can look within the WDM drivers to trace back how HID reports are handled?

usbipd

Are you aware of usbipd? I just used it last night to throw my keyboard and mouse over to my laptop. It works well from what I can tell.

https://github.com/dorssel/usbipd-win

In my case, I forward the local 3240 to my laptop on port 13240 and then use --tcp-port 13240 with my client commands.

Devices are not attached

I have issues attaching devices. Despite a message saying

usbip: debug: usbip.c:151:[run_command] running command: attach
usbip: debug: usbip_vhci.c:61:[usbip_vhci_driver_open] device path: \\?\usbipwin#vhci#1&19724a8b&b#{d35f7840-6a0c-11d2-b841-00c04fad5171}
succesfully attached to port 1

The device does not actually appear in the device manager (or disappears after a very short time). I have tried with multiple different devices and always get this result. With usbip-win v.0.3.5 the device attaches without issues, but does not function correctly, so I decided to try this version as it seems to be maintained.

Software I use:

Client:
usbip-win 0.7.5.1
Windows 10 build 19041 (qemu VM)

Server:
usbipd 2.0
Linux 5.16

Things I still want to try:

  1. Collect logs from the driver using the instructions in the README.md
  2. Build the latest version of the driver from master or develop

This would probably take me some time as I am not as familiar with Windows development and tools involved, But I will update the issue as soon as I have more logs to show

If you have any other suggestions to try, would be happy to do so

using usb/ip with Amazon Kindle

Hi!

I'm trying to use usb/ip with the Amazon Kindle without any luck.

Binding seems to be successful, the drive shows, but it's not accessible. Moreover the Kindle seems to be in some kind of loop like it was being connected and disconnected continuously.

The server is running on Ubuntu. I noticed disturbing logs from dmesg.

image

Signed driver

Is there any hope of getting a signed driver? My organization has policies set which disallow use of test signed drivers.

C:\Program Files\usbip-win2>bcdedit.exe /set testsigning on
An error has occurred setting the element data.
The value is protected by Secure Boot policy and cannot be modified or deleted.

BSOD crash while trying to connect to AiM racing dash

Hi, I've been using your usbip for a week or so, and it shows great promise from what else I've seen and tried. My application is a bit different than most, as I'm trying to ship USB data from a race car to tuning computers in a nearby trailer. My USB devices are an AiM dash, AiM logging camera (though video is stored on an SD card, not via USB), and an ECUMaster Power Management Unit.
Server side: I've installed an industrial router (Teltonika 955) in the car that runs Ubuntu (kernel 5.4.147), and the USB devices mentioned above connect to the USB port on the router (via 3-1 non-powered splitter/hub). usbip list -l on the server shows:

Teltonika RUT9 series 2022

root@Teltonika-RUT955:~# usbip list -l

  • busid 1-1.1.3 (11cc:2002)
    unknown vendor : unknown product (11cc:2002)

  • busid 1-1.3 (04b4:0003)
    Cypress Semiconductor Corp. : unknown product (04b4:0003)

  • busid 1-1.1.2 (11cc:0110)
    unknown vendor : unknown product (11cc:0110)

  • busid 1-1.4 (2c7c:0125)
    Quectel Wireless Solutions Co., Ltd. : EC25 LTE modem (2c7c:0125)

  • busid usb1 (1d6b:0002)
    Linux Foundation : 2.0 root hub (1d6b:0002)

  • busid 1-1.1 (05e3:0610)
    Genesys Logic, Inc. : Hub (05e3:0610)

  • busid 1-1.1.1 (0483:5740)
    STMicroelectronics : Virtual COM Port (0483:5740)

  • busid 1-1 (05e3:0610)
    Genesys Logic, Inc. : Hub (05e3:0610)

For the client side, I'm using an ordinary laptop running Windows 11. I use AiM and ECUMaster applications to access the USB data coming via usbip. All the devices work, at least for a while (15s to 30minutes), but all end up as a BSOD. Sometimes two devices will work at a time, though I've never had all three working at once. I've spent nearly all of the past week gathering software in order to capture the memory dump and trace from such a crash, and I finally did that. Windows is so much harder than Linux. Sigh.

In this case, the error was a hang during attach to device 1-1.1.2. 30s or so. When that happens CTL-C does nothing, so typically I go to the server and kill the bind, and when I did that this time, it resulted in a BSOD.

C:\Users\jp>usbip list -r rut955
Exportable USB devices

  • rut955
    1-1.1.1: STMicroelectronics : Virtual COM Port (0483:5740)
    : /sys/devices/platform/ahb/1b000000.usb/usb1/1-1/1-1.1/1-1.1.1
    : (Defined at Interface level) (00/00/00)
    : 0 - Communications/Abstract (modem)/AT-commands (v.25ter) (02/02/01)
    : 1 - (Defined at Interface level) (00/00/00)

    1-1.1.3: unknown vendor : unknown product (11cc:2002)
    : /sys/devices/platform/ahb/1b000000.usb/usb1/1-1/1-1.1/1-1.1.3
    : (Defined at Interface level) (00/00/00)

    1-1.1.2: unknown vendor : unknown product (11cc:0110)
    : /sys/devices/platform/ahb/1b000000.usb/usb1/1-1/1-1.1/1-1.1.2
    : (Defined at Interface level) (00/00/00)

I think this is all the data you request, but please let me know if it isn't:
unrivaledrides-bsod.zip

some hid devices do not work immediately after attaching

i hope getting more infos here also concerning the linux usbip server implementation. i have similar problems with some hid devices as described here in usbipd-win project, where they fixed the issue with a timeout:
dorssel/usbipd-win#659 (comment)

after attaching the devices, they are shown in a connected state but will not work immediately. only after detaching and reattaching 1 to 3 times then the usb devices come to work correctly. so could this be a similar driver issue in linux server usbip or timeout issue? i would like to also mention that these kind of hid devices mostly have 2 bNumInterfaces and this differs from other devices which normally have only 1 bNumInterfaces and perhaps this could also be the reason. any advice or ideas?

Unable to detach devices

Seems that detaching a device does not works in my laptop, even rebooting the server does not correct the problem, the client still cant detach remote connected USB devices, any advice ?

Once server reboot, those device are still available in "phantom mode"

C:\Users\bruno>usbip port
Imported USB devices
====================
Port 01: <Device in Use> at Full Speed(12Mbps)
       QinHeng Electronics : CH340 serial converter (1a86:7523)
           -> usbip://192.168.0.101:3240/1-1.5
           -> remote bus/dev 001/005
Port 02: <Device in Use> at Low Speed(1.5Mbps)
       Sunplus Innovation Technology Inc. : unknown product (1bcf:28c4)
           -> usbip://192.168.0.101:3240/1-1.3
           -> remote bus/dev 001/004
Port 03: <Device in Use> at Low Speed(1.5Mbps)
       Sunplus Innovation Technology Inc. : unknown product (1bcf:28c4)
           -> usbip://192.168.0.101:3240/1-1.3
           -> remote bus/dev 001/004

C:\Users\bruno>usbip detach -p 01
usbip: error: failed to detach

C:\Users\bruno>usbip detach -p 1
usbip: error: failed to detach

C:\Users\bruno>usbip detach -p 02
usbip: error: failed to detach

C:\Users\bruno>usbip detach -p 03
usbip: error: failed to detach

C:\Users\bruno>usbip detach -p -1
all ports are detached

C:\Users\bruno>usbip port
Imported USB devices
====================
Port 01: <Device in Use> at Full Speed(12Mbps)
       QinHeng Electronics : CH340 serial converter (1a86:7523)
           -> usbip://192.168.0.101:3240/1-1.5
           -> remote bus/dev 001/005
Port 02: <Device in Use> at Low Speed(1.5Mbps)
       Sunplus Innovation Technology Inc. : unknown product (1bcf:28c4)
           -> usbip://192.168.0.101:3240/1-1.3
           -> remote bus/dev 001/004
Port 03: <Device in Use> at Low Speed(1.5Mbps)
       Sunplus Innovation Technology Inc. : unknown product (1bcf:28c4)
           -> usbip://192.168.0.101:3240/1-1.3
           -> remote bus/dev 001/004

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.