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

[Windows] Investigate running sanzu as a headless service #281

Open
JeremieSpiesser opened this issue Mar 18, 2024 · 0 comments
Open

[Windows] Investigate running sanzu as a headless service #281

JeremieSpiesser opened this issue Mar 18, 2024 · 0 comments

Comments

@JeremieSpiesser
Copy link

Hello 👋 ,

I am investigating using sanzu as a headless remote desktop on a windows server. For that to work I would need to

  • have sanzu_server run on Windows startup (windows service or scheduled task)
  • connect to it
  • use sanzu_client to log into windows without manual intervention.

Right now, when I create a service and connect to it, I get an error like this :

[2024-03-06T17:39:16.846625200Z ERROR sanzu_server] Server error
[2024-03-06T17:39:16.846672700Z ERROR sanzu_server]  - due to Cannot init d3d11
[2024-03-06T17:39:16.846695900Z ERROR sanzu_server]  - due to Cannot create d3d11 device

This errors stems from the EnumOutputs call here https://github.com/cea-sec/sanzu/blob/main/sanzu/src/server_windows.rs#L635 that fails when started this way.

Interestingly, Sunshine seem to use a similar approach https://github.com/LizardByte/Sunshine/blob/nightly/src/platform/windows/display_base.cpp#L484 but manages to handle the case where EnumOutputs fails (typically when not running from a logged in user session).

I tried to add the SetThreadExecutionState(ES_DISPLAY_REQUIRED); to sanzu like Sunshine does but it isn't enough apparently.

  1. Have you got any rough idea as to what would be necessary to make sanzu usable for headless remote desktop (including beeing able to log into windows remotely) ?
  2. If I were to make a PR that adds this feature, would you consider merging it or is it out of scope for the project ?

Thanks

@JeremieSpiesser JeremieSpiesser changed the title [Windows] Investigate [Windows] Investigate running sanzu as a headless service Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant