vadimgrn / usbip-win2

USB/IP Client for Windows
GNU General Public License v3.0
314 stars 31 forks source link

Windows server 2019 support #42

Closed srdimitroff closed 11 months ago

srdimitroff commented 11 months ago

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!

vadimgrn commented 11 months ago

What exact version of Windows?

srdimitroff commented 11 months ago

Thanks for the quick reply. Under windows edition names it:

Windows Server 2019 Standard

vadimgrn commented 11 months ago

It should be like Windows 10 Version 2004 (OS build 19041). I use API that is available since this release of Win10.

srdimitroff commented 11 months ago

Yeah I thought it should be similar to that with Server 2019, however the .exe to install it will not start due to the error:

"This program does not support the version of Windows your computer is running."

Screenshot 2023-06-28 090601

vadimgrn commented 11 months ago

I see, but I want you to get full version info about your Win Server. It contains version and OS build numbers. Win Server 2019 is not enough, I suppose.

srdimitroff commented 11 months ago

Sorry that was my bad. Here is info:

Windows server 2019 standard Version: 1809 OS Build: 17763.2928

I'm guessing the version 1809 is why it is not compatible?

vadimgrn commented 11 months ago

It seems so. It's possible to replace ExAllocatePool2 as described here. If you are a programmer, you could do that.

srdimitroff commented 11 months ago

Thank you for the support vadimgrn! I will try that and recompile. This can be closed

vadimgrn commented 11 months ago

There are several places where Win version should be changed as well. See also. Screenshot 2023-06-29 090530 Screenshot 2023-06-29 090555 Screenshot 2023-06-29 090642

srdimitroff commented 11 months ago

I am going to recompile it this weekend with ExAllocatePool1. I'll use your tip and change the windows versions as well. I'll let you know, thank you!

vadimgrn commented 11 months ago

It won't be so easy. There are some other functions that available since Windows 10, version 2004. For example, RtlUTF8StringToUnicodeString and RtlInitUTF8String. In general, ExAllocatePoolZero and ExAllocatePoolUninitialized should be used instead of ExAllocatePool2.

Beside that, you will have to deal with functions like

unique_ptr(_In_ POOL_FLAGS Flags, _In_ SIZE_T NumberOfBytes)

For such reasons I don't want to downgrade Win version requirements. Time works for me :)

vadimgrn commented 11 months ago

I did it :) It should run on Windows 10 x64 Version 1709 (OS build 16299) and later. v.0.9.5.4 has released and it incorporates this feature.

srdimitroff commented 11 months ago

Awesome work, I appreciate this! I did end up building it from the master last night and was having some issues with the drivers after the installation. I tried your build and it was doing the same. When I install it, the USBip 3.X Emulated Host Controller driver installs but says:

"Windows cannot start this hardware device because its configuration information (in the registry) is incomplete or damaged. (Code 19)"

Screenshot 2023-07-02 080040

Screenshot 2023-07-02 080211

So I tried restarting the VM and then all the USB controllers have that same error message:

Screenshot 2023-07-02 080158

I am currently testing it out on Win10 LTSC version 1809 build 17763.3887 which will be similar to the Windows Server 2019 I eventually want to run it on.

vadimgrn commented 11 months ago

I don't have Win10 to test. Collect logs, pls.

srdimitroff commented 11 months ago

Which logs can I provide? I ran the verifier for the driver and can provide that?

vadimgrn commented 11 months ago

Today I installed Win10 1709 on VM. There are issues with .inf files for drivers. Other than that "pnputil /remove-device" available starting in Windows 10 version 2004. Errors for .inf files are very generic, it is not possible to understand what exactly wrong. I'm going to move these changes to a new branch, master branch will be reverted to Win 10 2004.

If you want to fix these issues, it should be done in userspace/innosetup/setup.iss, drivers/ude/usbip2_ude.inf, drivers/ude_filter/usbip2_filter.inf

vadimgrn commented 11 months ago

https://github.com/vadimgrn/usbip-win2/tree/win10_1709 "master" and "develop" branches are modified, three last commits were replaced. See also bin/install.txt, bin/uninstall.bat how to manually install/remove drivers.

vadimgrn commented 11 months ago

I revealed that 1803 doesn't work, UDE driver fails to load. 1809 is OK, but there are two issues: a) Primitive drivers targeting only Windows 10 version 1903 and later. Inf file must be modified for filter driver. b) "pnputil /remove-device" available starting in Windows 10 version 2004.

srdimitroff commented 11 months ago

Does the driver need that "pnputil /remove-device" to run properly? I'm not sure if that is only needed when uninstalling the driver or is it for detaching usbip device?

vadimgrn commented 11 months ago

It is required during the uninstallation.

vadimgrn commented 11 months ago

I found the solution, the downgrade of Win version will be implemented in develop branch soon.

vadimgrn commented 11 months ago

The branch win10_1809 is completed, usbip can be installed/removed correctly. I'm thinking if it worth merging this branch into develop.

The only issue is that usbip2_ude service remains in the registry after the uninstallation on Win10 1809, but it is harmless.

vadimgrn commented 11 months ago

The branch has merged into develop.