My office job routinely sees me connected to a Linux box via VNC.
Sometimes I start a remote job on the console, and realize later that it runs much longer than expected. (Should have started that one under Screen in the first place...)
I don't want to keep my workstation running overnight just to keep the VNC session open; I would like to move that already-running remote job into a Screen session (on the remote box), so I can power down the workstation (and reconnect next morning).
How can this be done, if at all?
Have a look at reptyr, which does exactly that. The github page has all the information.
You cannot do this, easily. I'd suggest making it a habit to start screen as the first thing you do after opening a console.
However, for your actual problem, there's another thing you could try: after having launched your job from the terminal, background it by typing ctrl-z and then
bg
. After that, detach the job from it's parent shell; in bash you'd dodisown -h %<jobid>
. After that, you can safely close the terminal and the job will continue running.As you're using Linux, what about using retty inside the newly launched screen process?