1

I'm using vscode to execute *.py and *.ipynb file on Linux machin through SSH remote. However, the session ends when my computer hibernates or encounters a connection lost. As the session is closed, the execution of jupyter notbook ceases, which is quite annoying as I train machine learning over night.

Is there any solution to make such remote SSH (as well as vscode remote tunnel) connecion presistent on vscode ?

The vscode documation has a related description but do not solve my problem:

The terminal supports two different types of persistent sessions:

Process reconnection: When reloading a window (for example, after installing an extension), reconnect to the previous process and restore its content. Process revive: When restarting VS Code, a terminal's content is restored and the process is relaunched using its original environment.

And tmux seems only works on termal.

N.B. I'm using vscode jupyter extension to selection kernal on remote machine. Jupyter kernal selection

Cheney
  • 21
  • 7
  • 1
    I am puzzled that if you use remote-ssh, local machine sleep will not affect the operation of the Jupyter server. However you said that disconnecting will cause the session to terminate. Please check that whether you run the jupyter in remote server. – MingJie-MSFT Jul 31 '23 at 02:29
  • Thx for the reply. I'm using the Jupyter extension to select Kernal in a remote server (The question description is updated and plz check the image illustration for Kernal selection). However, that remote machine runs on LAN which I don't have access to at this moment. I do remember that is the case but can not verify right now. Yet, what I'm ruse is that the operation of the jupyter is stopped when using Remote - Tunnels (https://marketplace.visualstudio.com/items?itemName=ms-vscode.remote-server) – Cheney Jul 31 '23 at 13:44
  • It's a known limitation of vscode implementation of remote Jupyter kernels. See https://github.com/microsoft/vscode-jupyter/issues/11077#issuecomment-1211392942 for instance. You can vote or comment on that issue to make them aware that more people are suffering from this. – a06e Jul 31 '23 at 17:48
  • lol I've voted for that comments. @MingJie-MSFT I've tested the restoration and It does run the Jupyter when the local machine sleeps for a short period of time. But the vscode asks for window reload and the Jupyter is ceased for a longer time hibernation. – Cheney Aug 01 '23 at 02:17
  • You can try adding `"remote.SSH.connectTimeout": 30000,` to your USER `settings.json`. This may help. – MingJie-MSFT Aug 01 '23 at 05:59

0 Answers0