Is there any way to apt install screen to resume on the webterminal if the connection closes?

I'm doing some longer runs for ai training, but one issue I keep running into in the webterminal is the "Connection Closed" notification which leaves me unable to resume where I left off after the pod has run for an hour. Is there any way to setup a webterminal to resume so that in the event the connection is closed I don't lose all of my work?
4 Replies
SuperSynapse
SuperSynapseOP2mo ago
Likewise, is there anything I could be doing that would cause the webterminal to close?
DreamBox
DreamBox2mo ago
How about connecting to the host over SSH from an external terminal like iTerm. You could also add the SSH KEEPALIVE optons on the cmd line (which can also go into ~/.ssh/config: If you are doing that, add these arguments in the ssh command, like so... ssh -o ServerAliveInterval=180 -o ServerAliveCountMax=2 and if you are on Windows and use MobaXterm, there is a settings checkbox for keepalive from the client. If you are using Jupyter, I would look for ways to leverage a Jupyter config file, although now I am starting to guess about stuff. Just throwing some ideas out there.
SuperSynapse
SuperSynapseOP2mo ago
So, I figured it out, but IMO this needs to be added to the runpod docs How to Setup a Pod Webterminal Screen to Resume: (do this BEFORE you navigate into further directories, at START of pod)
apt update
apt update
apt install screen
apt install screen
enter "y" when prompted
It will take you into a hub, press SPACE to exit, then prompt:
It will take you into a hub, press SPACE to exit, then prompt:
screen -ls
This will list a screen that looks like the codeblock below.
You only want the number at the beginning: __**1067**__ WRITE IT DOWN:
>
This will list a screen that looks like the codeblock below.
You only want the number at the beginning: __**1067**__ WRITE IT DOWN:
>
1067.pts-0-e1b2953a1c1f (3/14/25 17:14:14) (Attached)
Now you can do a few things to display more content on the webterminal. To test, you can close your webterminal, reopen and prompt:
Now you can do a few things to display more content on the webterminal. To test, you can close your webterminal, reopen and prompt:
screen -r 1067``` Enter your screen number here instead of 1067 You should now see your previous screen 🎉
Dj
Dj2mo ago
I'm glad you got it figured out! I saved your suggestion to add screen to the docs, it could be really useful for others 🙏🏾

Did you find this page helpful?