Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtual display driver not getting installed properly #6280

Closed
shamirahim111 opened this issue Nov 4, 2023 · 107 comments
Closed

virtual display driver not getting installed properly #6280

shamirahim111 opened this issue Nov 4, 2023 · 107 comments
Labels
bug Something isn't working

Comments

@shamirahim111
Copy link

shamirahim111 commented Nov 4, 2023

Bug Description

i am on latest nightly versions, 4/11 on local side (linux-wayland) and 31/10 on remote side (windows 10 ltsc)

i am trying to use virtual monitor but the drvier is not installed properly.

i tried to update driver with the dll files but that did not work.

How to Reproduce

try to use virtual display driver. in device manager it says not installed properly

Expected Behavior

it should get installed

Operating system(s) on local side and remote side

linux>windows

RustDesk Version(s) on local side and remote side

1.2.3>1.2.4

Screenshots

vdd1
vdd2
vdd3

Additional Context

No response

@shamirahim111 shamirahim111 added the bug Something isn't working label Nov 4, 2023
@shamirahim111
Copy link
Author

i am using aspia in the screenshots but rustdesk gets unresponsive if i click on virtual monitor, rustdesk freezes. sometimes it unsticks, sometimes i have to reconnect

@rustdesk rustdesk closed this as completed Nov 4, 2023
Repository owner locked and limited conversation to collaborators Nov 4, 2023
@rustdesk rustdesk reopened this Nov 4, 2023
@rustdesk
Copy link
Owner

rustdesk commented Nov 4, 2023

@fufesou let's still follow it up here.

@rustdesk
Copy link
Owner

rustdesk commented Nov 4, 2023

i am using aspia in the screenshots but rustdesk gets unresponsive if i click on virtual monitor, rustdesk freezes. sometimes it unsticks, sometimes i have to reconnect

This is similar to #4974.

@rustdesk
Copy link
Owner

rustdesk commented Nov 4, 2023

Repository owner unlocked this conversation Nov 4, 2023
@fufesou
Copy link
Collaborator

fufesou commented Nov 4, 2023

@shamirahim111 Hi, thanks for your feedback and the logs.

I can only see the driver is not installed properly in the logs.

ERROR [src\virtual_display_manager.rs:134] Plug in monitor failed Plug in monitor failed RustDeskIdd: Idd device: GetDevicePath2 SetupDiEnumDeviceInterfaces failed, last error 0x103

Can you please show me the win10 version?

1699077854142

Can you please manually remove the driver in the device manager, then try this test app?

https://github.com/fufesou/RustDeskIddDriver/releases

@fufesou
Copy link
Collaborator

fufesou commented Nov 4, 2023

@shamirahim111
Copy link
Author

@fufesou
Screenshot_20231104_114221

@shamirahim111
Copy link
Author

@fufesou

Create device begin
RustDeskIdd: SwDeviceCreate failed with 0x800700b7
RustDeskIdd: SwDeviceCreate failed with 0x800700b7

Press key execute:
1. 'q' 1. quit
2. 'c' 2. create device
3. 'd' 3. destroy device
4. 'i' 4. install or update driver
5. 'u' 5. uninstall driver
6. 'a' 6. plug in monitor
7. 'b' 7. plug out monitor
Install or update driver begin
RustDeskIdd: UpdateDriverForPlugAndPlayDevices failed, last error 0xe000020b
RustDeskIdd: UpdateDriverForPlugAndPlayDevices failed, last error 0xe000020b

@fufesou
Copy link
Collaborator

fufesou commented Nov 4, 2023

Please run as Administrator

@shamirahim111
Copy link
Author

@fufesou yes. run as administrator on RustDeskIddApp.exe. same thing

@fufesou
Copy link
Collaborator

fufesou commented Nov 4, 2023

It looks like the device already exists.

https://github.com/fufesou/RustDeskIddDriver/issues/3

I'll try to find out the reason.

@fufesou
Copy link
Collaborator

fufesou commented Nov 7, 2023

@shamirahim111 Hi, it seems another running process is holding the SwDevice handle.

https://github.com/fufesou/RustDeskIddDriver/issues/3#issuecomment-1798616957

Can you please try find the process, or simple sign out, then try the test app again?

@shamirahim111
Copy link
Author

@fufesou this worked. i installed the latest test app and that did not throw any error but device manager still says driver is not properly installed.

second, i tried "a" for plug in to monitor and got the errors

Press  key                  execute:
       1. 'q'               1. quit
       2. 'c'               2. create software device with lifetime "SWDeviceLifetimeHandle"
       3. 'C'               3. create software device with lifetime "SWDeviceLifetimeParentPresent"
       4. 'd'               4. destroy software device
       5. 'i'               5. install or update driver
       6. 'u'               6. uninstall driver
       7. 'a'               7. plug in monitor
       8. 'b'               8. plug out monitor
Create device begin
Waiting for device to be created....
Create device done


Press  key                  execute:
       1. 'q'               1. quit
       2. 'c'               2. create software device with lifetime "SWDeviceLifetimeHandle"
       3. 'C'               3. create software device with lifetime "SWDeviceLifetimeParentPresent"
       4. 'd'               4. destroy software device
       5. 'i'               5. install or update driver
       6. 'u'               6. uninstall driver
       7. 'a'               7. plug in monitor
       8. 'b'               8. plug out monitor
No virtual monitors


Press  key                  execute:
       1. 'q'               1. quit
       2. 'c'               2. create software device with lifetime "SWDeviceLifetimeHandle"
       3. 'C'               3. create software device with lifetime "SWDeviceLifetimeParentPresent"
       4. 'd'               4. destroy software device
       5. 'i'               5. install or update driver
       6. 'u'               6. uninstall driver
       7. 'a'               7. plug in monitor
       8. 'b'               8. plug out monitor
Plug in monitor begin, current index 0
RustDeskIdd: Idd device: SetupDiEnumDeviceInterfaces failed, last error 0x103
RustDeskIdd: Idd device: SetupDiEnumDeviceInterfaces failed, last error 0x103
RustDeskIdd: Idd device: SetupDiEnumDeviceInterfaces failed, last error 0x103
RustDeskIdd: Idd device: SetupDiEnumDeviceInterfaces failed, last error 0x103
RustDeskIdd: Idd device: SetupDiEnumDeviceInterfaces failed, last error 0x103

1 similar comment
@shamirahim111
Copy link
Author

@fufesou this worked. i installed the latest test app and that did not throw any error but device manager still says driver is not properly installed.

second, i tried "a" for plug in to monitor and got the errors

Press  key                  execute:
       1. 'q'               1. quit
       2. 'c'               2. create software device with lifetime "SWDeviceLifetimeHandle"
       3. 'C'               3. create software device with lifetime "SWDeviceLifetimeParentPresent"
       4. 'd'               4. destroy software device
       5. 'i'               5. install or update driver
       6. 'u'               6. uninstall driver
       7. 'a'               7. plug in monitor
       8. 'b'               8. plug out monitor
Create device begin
Waiting for device to be created....
Create device done


Press  key                  execute:
       1. 'q'               1. quit
       2. 'c'               2. create software device with lifetime "SWDeviceLifetimeHandle"
       3. 'C'               3. create software device with lifetime "SWDeviceLifetimeParentPresent"
       4. 'd'               4. destroy software device
       5. 'i'               5. install or update driver
       6. 'u'               6. uninstall driver
       7. 'a'               7. plug in monitor
       8. 'b'               8. plug out monitor
No virtual monitors


Press  key                  execute:
       1. 'q'               1. quit
       2. 'c'               2. create software device with lifetime "SWDeviceLifetimeHandle"
       3. 'C'               3. create software device with lifetime "SWDeviceLifetimeParentPresent"
       4. 'd'               4. destroy software device
       5. 'i'               5. install or update driver
       6. 'u'               6. uninstall driver
       7. 'a'               7. plug in monitor
       8. 'b'               8. plug out monitor
Plug in monitor begin, current index 0
RustDeskIdd: Idd device: SetupDiEnumDeviceInterfaces failed, last error 0x103
RustDeskIdd: Idd device: SetupDiEnumDeviceInterfaces failed, last error 0x103
RustDeskIdd: Idd device: SetupDiEnumDeviceInterfaces failed, last error 0x103
RustDeskIdd: Idd device: SetupDiEnumDeviceInterfaces failed, last error 0x103
RustDeskIdd: Idd device: SetupDiEnumDeviceInterfaces failed, last error 0x103

@fufesou
Copy link
Collaborator

fufesou commented Nov 8, 2023

You should run "i", before "a".
The normal sequence is "c" -> "i" -> "a".

@fufesou
Copy link
Collaborator

fufesou commented Nov 8, 2023

RustDesk may work without the dirver issue now. Did you kill some processes, sign out or restart the OS?

@shamirahim111
Copy link
Author

@fufesou nope. i tried c>i>a but got same error

no. i am using rustdesk connection itself to install the software but it did not work

@shamirahim111
Copy link
Author

i have not done any restart in between.

@fufesou
Copy link
Collaborator

fufesou commented Nov 8, 2023

@fufesou nope. i tried c>i>a but got same error

no. i am using rustdesk connection itself to install the software but it did not work

What's the output after "i"?

@shamirahim111
Copy link
Author

Install or update driver begin
Install or update driver done, reboot is not required

@fufesou
Copy link
Collaborator

fufesou commented Nov 8, 2023

Strange, here's no error when creating a sw device and installing the driver.
But monitors cannot be plugged in?

And "a" reports:

RustDeskIdd: Idd device: SetupDiEnumDeviceInterfaces failed, last error 0x103

Error code 0x103 corresponds to ERROR_NO_MORE_ITEMS, which means that there are no more device interfaces for enumeration.

The most likely reason is "the driver is not correctly installed".

Can you please check if the "RustDeskIddDriver Device":

  1. Not exists before running the app
  2. Exists after you pressing "c" and "i"

image

@shamirahim111
Copy link
Author

@fufesou "c" and "i" gives me incorrectly installed rustdesk driver. it appears to me that the driver is not getting installed but your testapp is not correctly checking the install status. it is reporting correctly installed when it is not installed

@fufesou
Copy link
Collaborator

fufesou commented Nov 8, 2023

Frankly, I cannot find out why "c" and "i" both report success, while the driver device is not installed.

There're only two Windows API used for the operations.

SwDeviceCreate in
https://github.com/fufesou/RustDeskIddDriver/blob/764c400cfa6b6ac5b4b4274f5b347142ca4b3e0c/RustDeskIddApp/IddController.c#L194

UpdateDriverForPlugAndPlayDevices in https://github.com/fufesou/RustDeskIddDriver/blob/764c400cfa6b6ac5b4b4274f5b347142ca4b3e0c/RustDeskIddApp/IddController.c#L74

Can you try again:

  1. Run "c" -> "i"
  2. Start a new process
  3. Type "c"

If the second process resports "RustDeskIdd: SwDeviceCreate failed with 0x800700b7", the SwDevice handle must be hold by the first process.

If the reason is still unclear, please try:

  1. Sign out
  2. Run "install_cert_runas_admin.bat" as Administrator
  3. Run the test app as Administrator again

😢

@fufesou
Copy link
Collaborator

fufesou commented Nov 16, 2023

@Sven1403 Hi, please try the Debug.zip here

https://github.com/fufesou/rustdesk/releases/tag/tmp

This is a debug build from my PC.

I cannot log the valid backtrace on release profile for rustdesk.
I do not know what affects the backtrace.

C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\log\server\rustdesk_rCURRENT.log

@Sven1403
Copy link

Sven1403 commented Nov 16, 2023

@Sven1403 Hi, please try the Debug.zip here

https://github.com/fufesou/rustdesk/releases/tag/tmp

This is a debug build from my PC.

I cannot log the valid backtrace on release profile for rustdesk. I do not know what affects the backtrace.

C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\log\server\rustdesk_rCURRENT.log

@fufesou
So you want me to test this build the next days? Or you need the logs after installation?

@fufesou
Copy link
Collaborator

fufesou commented Nov 16, 2023

The dialog appears without using (even open) RustDesk. Only Service is running after the computer booted

I need the log when you see the driver dialog.

The log will show the call backtrace.

@Sven1403
Copy link

The dialog appears without using (even open) RustDesk. Only Service is running after the computer booted

I need the log when you see the driver dialog.

The log will show the call backtrace.

okay. Since i cant reproduce it, let hope it will come up soon :D

@Sven1403
Copy link

@fufesou this Build is correct?
grafik

@fufesou
Copy link
Collaborator

fufesou commented Nov 16, 2023

Yes. Is there any problem?

@Sven1403
Copy link

Yes. Is there any problem?

all good :) it only says my version is outdated

@Sven1403
Copy link

@fufesou the driver installation dialog came up today. Here is the log file. You need more logs or can i reinstall the current nightly build? :)

RustDesk_rCURRENT.log

@fufesou
Copy link
Collaborator

fufesou commented Nov 17, 2023

@Sven1403 Thanks for your help.

Did you see it after booting?

I've read the log. It says RustDesk could not detect a display or only one display that all resolutions (w,h) < 1024.

Maybe we need to add a delay to detect the displays after booting or starting the process.

Can you please run #6280 (comment) again?

@Sven1403
Copy link

Sven1403 commented Nov 17, 2023

@fufesou i think i know what it cause. I configured in BIOS that my work computer will boot in the morning. My displays arent on at this time, so i guess RustDesk didnt detect the displays then.

@Sven1403
Copy link

Maybe we need to add a delay to detect the displays after booting or starting the process.

So yeah this would be a good idea =)

@fufesou
Copy link
Collaborator

fufesou commented Nov 17, 2023

Maybe we need to add a delay to detect the displays after booting or starting the process.

So yeah this would be a good idea =)

No, my intention was to add a few seconds of delay.
Because I mistakenly thought the monitor was ready. But the monitor could not be detected in a short time after booting.

I configured in BIOS that my work computer will boot in the morning. My displays arent on at this time

It's hard to handle this case.

You can unckeck this option if you do not need virtual display driver.

1700209150121

@rustdesk
Copy link
Owner

Why detecting monitor at boot?

@fufesou
Copy link
Collaborator

fufesou commented Nov 17, 2023

Why detecting monitor at boot?

Yes, RustDesk should not detect monitors.

There's sth wrong. Let me check the code again.

[2023-11-17 07:16:16.110790 +01:00] INFO [src\core_main.rs:162] main start args:["--server"]
[2023-11-17 07:16:16.114513 +01:00] INFO [src\core_main.rs:246] start --server with user SYSTEM
[2023-11-17 07:16:16.115757 +01:00] DEBUG [libs\hbb_common\src\config.rs:491] Configuration path: C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk2.toml
[2023-11-17 07:16:16.132304 +01:00] INFO [src\ipc.rs:278] Started ipc server at path: \\.\pipe\RustDesk\query
[2023-11-17 07:16:16.145860 +01:00] DEBUG [src\server\display_service.rs:352] no displays, create virtual display
[2023-11-17 07:16:16.166586 +01:00] INFO [src\virtual_display_manager.rs:35] install_update_driver(), backtrace:

@fufesou
Copy link
Collaborator

fufesou commented Nov 17, 2023

*display_service::PRIMARY_DISPLAY_IDX,

RustDesk will try adding a default video service of the primary display.
Then displays are detected.

This service can be added later after one connection is established. I'll fix it.

@Sven1403
Copy link

You can unckeck this option if you do not need virtual display driver.
1700209150121

@fufesou can i use a parameter when i install rustdesk to not install the cert? And which features could not work anymore when i not install the cert on all computer in my company?

@fufesou
Copy link
Collaborator

fufesou commented Nov 17, 2023

can i use a parameter when i install rustdesk to not install the cert? And which features could not work anymore when i not install the cert on all computer in my company?

There's no parameter. The installation wizard is enough.

If you do not install the cert, the "virtual display", "privacy mode" and "headless" features will not be supported.

M SYO_X( {(PK7LPK3 )WI7

9K1O}H$%Z_3ZZ0(`(870ODI

BTW, I've submit a PR #6446. The dialog should not show anymore for you.

@fufesou
Copy link
Collaborator

fufesou commented Nov 17, 2023

#6446 (comment)

@shamirahim111

does this mean if user does not install the cert at first boot, then user wont see virtual display

Do you mean the installation wizard?

If the option is not checked. The cert will not be installed.
Then the driver dialog box will not be displayed. Because the corresponding certification is not found on the local PC, installing the driver will directly return false.

but if later user wants to install virtual display, is there a setting to install certificate and then install the driver?

There's no other place to install the cert. But you can double click the cert file to install it.

C:\Program Files\RustDesk\RustDeskIddDriver.cer

@fufesou
Copy link
Collaborator

fufesou commented Nov 20, 2023

@shamirahim111 IddCxAdapterInitAsync() is restricted before Windows 10 2004.

roshkins/IddSampleDriver#4 (comment)

Windows 10 2004 before, need Testing Mode or signed by Microsoft.

usbmmidd_v2 has the signature.

image

@rustdesk rustdesk closed this as completed Dec 3, 2023
@Sven1403
Copy link

Hey @fufesou
I use 1.2.4 rustdesk with this build in my company atm:
grafik

Some people get the driver install dialog randomly. Me too. Yesterday it didnt appear and today it was there. Isnt this solved?

Here is my server log from today:
[2023-12-20 07:16:12.734965 +01:00] INFO [src\core_main.rs:162] main start args:["--server"]
[2023-12-20 07:16:12.739144 +01:00] INFO [src\core_main.rs:246] start --server with user SYSTEM
[2023-12-20 07:16:12.743026 +01:00] INFO [src\ipc.rs:285] Started ipc server at path: \.\pipe\RustDesk\query
[2023-12-20 07:16:12.751461 +01:00] DEBUG [src\server\display_service.rs:354] no displays, create virtual display
[2023-12-20 07:16:12.761764 +01:00] INFO [libs\virtual_display\src\lib.rs:78] method found get_driver_install_path
[2023-12-20 07:16:12.761808 +01:00] INFO [libs\virtual_display\src\lib.rs:78] method found is_device_created
[2023-12-20 07:16:12.762111 +01:00] INFO [libs\virtual_display\src\lib.rs:78] method found close_device
[2023-12-20 07:16:12.762127 +01:00] INFO [libs\virtual_display\src\lib.rs:78] method found download_driver
[2023-12-20 07:16:12.762136 +01:00] INFO [libs\virtual_display\src\lib.rs:78] method found create_device
[2023-12-20 07:16:12.762147 +01:00] INFO [libs\virtual_display\src\lib.rs:78] method found install_update_driver
[2023-12-20 07:16:12.762159 +01:00] INFO [libs\virtual_display\src\lib.rs:78] method found uninstall_driver
[2023-12-20 07:16:12.762169 +01:00] INFO [libs\virtual_display\src\lib.rs:78] method found plug_in_monitor
[2023-12-20 07:16:12.762179 +01:00] INFO [libs\virtual_display\src\lib.rs:78] method found plug_out_monitor
[2023-12-20 07:16:12.762187 +01:00] INFO [libs\virtual_display\src\lib.rs:78] method found update_monitor_modes
[2023-12-20 07:16:13.269254 +01:00] ERROR [libs\hbb_common\src\platform\windows.rs:71] PdhAddCounterA failed: 0xC0000BB8
[2023-12-20 07:16:14.798574 +01:00] INFO [libs\scrap\src\common\hwcodec.rs:382] Check hwcodec config, exit with: exit code: 0
[2023-12-20 07:16:15.757914 +01:00] DEBUG [libs\hbb_common\src\config.rs:491] Configuration path: C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk2.toml
[2023-12-20 07:16:15.779529 +01:00] DEBUG [libs\hbb_common\src\config.rs:491] Configuration path: C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk.toml
[2023-12-20 07:16:15.788272 +01:00] DEBUG [libs\hbb_common\src\config.rs:491] Configuration path: C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk_local.toml
[2023-12-20 08:19:40.562614 +01:00] ERROR [src\server\display_service.rs:356] plug in headless failed RustDeskIdd: Failed InstallUpdate UpdateDriverForPlugAndPlayDevicesW, last error 0xe0000243

Is there any way to prevent this? Like deleting something or set something in the config/registry?

@rustdesk
Copy link
Owner

@Sven1403 please try out latest build.

@fufesou
Copy link
Collaborator

fufesou commented Dec 20, 2023

ERROR [src\server\display_service.rs:356] plug in headless failed RustDeskIdd: Failed InstallUpdate UpdateDriverForPlugAndPlayDevicesW, last error 0xe0000243

This indicates there is no display.

Do you only have one monitor and the resolution is less than 1024 in width and height?

RustDesk will try to create a virtual display in this case.

if crate::platform::is_installed()

@Sven1403
Copy link

Do you only have one monitor and the resolution is less than 1024 in width and height?

My 2 displays arent on when my computer is booting automatically in the morning. So thats why its not indicates a display. Is this behavior also with the latest build?

@fufesou
Copy link
Collaborator

fufesou commented Dec 20, 2023

Is this behavior also with the latest build?

No, you can try the latest build. It should not detect the displays until you connect to that peer.

@Sven1403
Copy link

@fufesou Hello :)
i wanted to wait for 1.2.4 release for trying that. But now there is 1.2.3-1 because of the vulnerability. I guess the problem with getting the driver install dialog (prompt) is also fixed there?

Greetings

@fufesou
Copy link
Collaborator

fufesou commented Feb 26, 2024

No driver will be installed in 1.2.3-1. So it will not show the dialog.

But you still cannot connect the peer when peer has no dislays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants