-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cannot connect after disconnecting from RDP session #964
Comments
this is not specific to sunshine. This also is/was the case with nvidia GameStream. It's even mentioned in the Moonlight troubleshooting section that using RDP will cause this issue. |
Yeah its not necessarily related to Sunshine but we might be able to do something to fix the issue, this issue was created just so that if people searched for it they would understand that its known behavior. Although, I can't seem to replicate this issue on my machine. It's able to connect back just fine even after using RDP, I am not entirely sure why though. |
Not sure if this helps find a solution, but I have the same issue and I've found that when it happens, I can fix it by logging in using VNC. After logging in that way, it seems to clear the problem and Moonlight will work again. I've written some test code just to figure out what's going on with RDP. I find that occasionally when logged in with RDP, if I enumerate the available monitors on the machine, I'll get a list of the actual physical displays as presented by the GPU. Generally everything works fine when this is the case. However most of the time I'll get a list of 'virtual' displays, and this seems to be when things go wrong. Whenever the displays listed are virtual, I'll then find Moonlight won't log in when I quit the RDP session. My theory is that Windows gets locked in a state where it's 'detached' from the physical monitors, and then Sunshine can't hook into the GPU because there's no output on it. Going to the actual machine and logging in puts things back as they were before, and now Sunshine works because the GPU is once again displaying the desktop. Likewise, logging in with VNC seems to act in the same way as being at the physical machine - so it fixes the problem. It's just a theory but I think if somebody figured out what VNC server is doing (I'm using TigerVNC for my tests) during that initial connection, it might present a solution for Sunlight? |
Logging back in with any method fixes it, even RDP if you disconnect with the script I put above. |
Personally, the script did not work for me at all. I'm on windows 11. But, I found something that works for me and figured I would share here. I use rdp to login and restart my computer, then I wait for my computer to start up again and sunshine works normally again until I use rdp again, then I have to restart to use sunshine again. It's not a very elegant solution but it's better than nothing This solutions also locks your system, unlike the script above |
It's a batch script, you need to run it as admin while connected to the remote desktop session. This is not a prep command script for Sunshine. |
I have found that if you "start -> log out" instead of just close the RDP connection from the "x", then youll be able to log back with Moonlight. Next time the Moonlight connection opens (I am using the Desktop connection) you'll be presented with login screen of Windows. |
This doesn't work for me, tried both clicking my username and the "shutdown icon" to disconnect. The script works. (Android RDP) |
While true not Sunshines fault, I agree that Sunshine when getting a connection (or perhaps when failing to connect) could execute this command or perhaps a better scoped version of that calls the very same API that the tscon.exe tool does to close out any open rdp sessions. The reason it matters to me, I have a headless Windows box JUST for gaming (I switch to a Mac after Windows 11 and what I can only describe as Microsoft clearly not caring about Windows moving forward since they make their money on cloud services now). Using Moonlight to admin the box is a pain, RDP is truly better then all other remote control (except for when gaming). My previous workaround was to reboot as I have my box setup to auto logon but now ill make a shortcut to run tscon as admin. But again, would just be killer if baked into the tool. If people are uneasy about it, make it a non-default option. There has been enough people on the nvidia side asking about this that sunshine could make a positive impact for a decent group of people with this fairly easy shim. Just my thoughts on it. |
This would be a security risk if an attacker had access to a paired moonlight client... kicking out an admin connected to RDP. RDP should take priority over any moonlight session. Let's be real... far too many users are giving moonlight access to casual friends and family members. So we won't automatically handle this for you, but feel free to add it as a prep command (that may work). |
Prep commands won't work because they require an active console session now, which RDP closes out when disconnecting. |
I would say it's pretty unlikely we would add a workaround to this problem. By design, windows won't allow us to execute processes under a users account unless they're an "active" console session. The reason why sunshine doesn't work is because of this limitation. If you execute an application that has no command and prep commands disabled, it will let you in without issues. By leaving the command/detached field blank and make sure it has no prep commands (including global ones) it will not matter that a user is not signed in or disconnected, you will be able to tunnel in and sign in without issues. |
The original bug reported here is fixed by 9955890. Sunshine will respawn on the console Winlogon session when the original user session is taken over by RDP. Logging back into an existing connection will result in a temporary disconnection as Sunshine spawns back into the original console session, but otherwise is usable now. We can't do prep/undo commands for the reasons mentioned above. |
This issue has been fixed and will be available in the next release. |
I still have this problem with Sunshine 0.21.0. It should have been fixed in v0.20.0. Anybody else? |
Works for me... You still need to disconnect the rdp session. |
I found a setting in Sunshine -> Applications that might be related:
I'm using Desktop, so will try unchecking this option. |
This script saved my day! You just need to store the code in a file ending with |
You don't need a script as long as you've installed the latest version of Sunshine. And you need to launch the Desktop app in Moonlight, to sign back in, otherwise it will fail until you sign back in |
I am using the latest version I downloaded 3 days ago and I HAVE to use the script, or else I can't even launch the Desktop app in Moonlight (from Mac). |
You should just be able to disconnect from your RDP session, and then connect using Moonlight. I don't believe you need the bat script I posted anymore, as long as you disconnect yourself. You can disconnect via "start/power/disconnect". |
Is there an existing issue for this?
Is your issue described in the documentation?
Is your issue present in the nightly release?
Describe the Bug
With Sunshine running as a service, cannot connect to Sunshine from Moonlight after using the Windows built in method of disconnecting from a remote desktop session.
Can connect if using this workaround, but that leaves the system unlocked, so is not preferred. This is a batch script that must be run as admin. It is not a prep command for Sunshine.
Can also connect to locked desktop as before using RDP.
Expected Behavior
No response
Additional Context
No response
Host Operating System
Windows
Operating System Version
11
Architecture
64 bit
Sunshine commit or version
v0.18.3
Package
Windows - installer
GPU Type
Nvidia
GPU Model
GeForce RTX 2080 Super
GPU Driver/Mesa Version
528.49
Capture Method (Linux Only)
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: