How to Prevent an OBS Live Stream from Stopping After Closing RDP
OBS goes black or stops when you close Remote Desktop, because the session loses its screen. Two fixes: hand the session to the console, or use VNC.
3 min readBy Shailabh
Reviewed by the AmazingRDP technical team

Streaming around the clock from a server? See our Streaming RDP plans. See Streaming RDP from $15.99
You set up OBS Studio on a remote Windows server, start the stream, close the Remote Desktop window, and minutes later viewers see a black or frozen picture. Nothing crashed. The cause is how Remote Desktop works, and there are two reliable ways around it.
Why it happens
While you are connected, Windows draws your session's desktop for the Remote Desktop connection. When you disconnect, Windows stops drawing it: the session keeps running, but it has no screen. OBS captures the screen and windows, so it has nothing left to capture. Signing out is worse still, because that closes OBS itself.
The fix is to keep a screen attached to the session after you leave.
Method 1: hand the session to the console
Windows can move your running session from the Remote Desktop connection to the machine's own (physical or virtual) screen. The session then stays drawn, and OBS keeps capturing.
- On the server, open Notepad and paste this one line:
tscon %sessionname% /dest:console
- Save it on the desktop as
leave-rdp.bat(choose "All files" as the type). - When the stream is running and you want to leave, right-click the file and choose Run as administrator.
Your Remote Desktop window closes. The session carries on at the console, and the stream continues. To return, connect with Remote Desktop as usual.
Things to know:
- Always leave with the file, never with the X of the Remote Desktop window.
- The console is left signed in and unlocked. For a server in a datacentre that is acceptable; for a PC in an office, someone at its screen could use it.
- The screen size may change to the console's. Set a fixed canvas size in OBS (Settings, Video) so that the stream's layout does not depend on it.
Method 2: control the server with VNC
A VNC program shows the server's console screen itself, so closing the viewer changes nothing for OBS. TightVNC is a free one.
On the server. Download TightVNC from its official site, tightvnc.com, and run the installer with the "Complete" setup. On the tasks page, keep Register TightVNC Server as a system service ticked.

Set a password for remote access, and a separate administrative password.

Protect it. VNC traffic is not encrypted and its port, 5900, is scanned constantly. Allow the port in the server's firewall for your own address only, or keep it closed and reach it through an SSH tunnel. See enable a port through PowerShell for a rule limited to one address.
On your PC. Install a VNC viewer, connect to the server's address, and enter the password. You see the server's console screen.
Then: sign in to Windows through VNC (not RDP), open OBS and start the stream.



Close the VNC viewer whenever you like. The stream keeps running, because the console session never loses its screen. If you connect by Remote Desktop afterwards, leave with Method 1, or you are back where you started.
Which method?
| Hand over to console | VNC | |
|---|---|---|
| Extra software | None | VNC server and viewer |
| Picture quality while you work | Remote Desktop's (better) | VNC's (rougher) |
| Risk | Forgetting to use the file when leaving | One more port to protect |
Other things that stop a long stream
- Session time limits. In
gpedit.msc, under Remote Desktop Session Host, Session Time Limits, the limits for disconnected and idle sessions must be "Never". - Sleep. Set the power plan to never sleep and never turn off the display.
- Windows Update restarts. Set active hours, and restart on your own schedule.
- Connection drops. In OBS, Settings, Advanced, enable Automatically reconnect.
- Sound. A server has no sound card; see VB-Cable on Windows Server and enable audio in Windows Server 2022.
Our Streaming RDP plans are made for this kind of use. Both methods need administrator rights on the server.
Questions
Why does OBS go black when I disconnect from RDP?
Windows stops drawing a disconnected Remote Desktop session, so OBS has no screen to capture.
How do I keep OBS streaming after closing Remote Desktop?
Leave with a file that runs tscon %sessionname% /dest:console as administrator, or control the server through VNC.
Can I just close the RDP window?
No. Closing it disconnects the session and the capture goes black. Signing out closes OBS.
Is VNC safe to leave open?
Not to the whole internet. Limit its port to your own address in the firewall or use an SSH tunnel.