Hi @JoseCarlos2314 , Thanks for your first post and welcome to our Community!
Is the remote session closing as you're using TeamViewer or is the remote session inactive? If the session is inactive, try to check the advanced settings:
Let us know how it goes. Best, Carol