Question

keep Running Jupyter notebook with VSCode on remote server (SSH) after disconnecting

i'm working with VSCode on remote server via ssh with the jupyter notebook extension. but when im disconnect from the session the process of the code is stopped. is there a way to run the notebook from the VSCode with a backgroung process with tools like tmux. cause i'm far of being a linux expert and i cant figure out how can i run the notebook process with tmux via the VSCode.

thanks a lot in advance.

 48  7266  48
1 Jan 1970

Solution

 5
  1. Open a new tmux session on your server: e.g., tmux new -s my_sess
  2. Go in the folder with your notebook
  3. If you use Anaconda, activate the environment with your libraries (including Jupyter)
  4. Start the jupyter notebook, optionally specifying the port where you want to forward it: e.g., jupyter notebook --no-browser --port=8080 &
  5. Disconnect from tmux
  6. Open your notebook in VS Code
  7. On the top-right, click the button to select your kernel and choose the option "select another kernel" -> "Existing jupyter server" -> "Enter the URL of the running Jupyter server"
  8. If you did as I wrote in point 4, write "http://localhost:8080/"
  9. At this point, you are asked to choose a Python kernel. I think you can choose whatever and it will use in any case the kernel running on the jupyter server in tmux
2023-04-20

Solution

 5
  1. Open a new tmux session on your server: e.g., tmux new -s my_sess
  2. Go in the folder with your notebook
  3. If you use Anaconda, activate the environment with your libraries (including Jupyter)
  4. Start the jupyter notebook, optionally specifying the port where you want to forward it: e.g., jupyter notebook --no-browser --port=8080 &
  5. Disconnect from tmux
  6. Open your notebook in VS Code
  7. On the top-right, click the button to select your kernel and choose the option "select another kernel" -> "Existing jupyter server" -> "Enter the URL of the running Jupyter server"
  8. If you did as I wrote in point 4, write "http://localhost:8080/"
  9. At this point, you are asked to choose a Python kernel. I think you can choose whatever and it will use in any case the kernel running on the jupyter server in tmux
2023-04-20

Solution

 1

Simply start a tmux process in the remote terminal start Jupyter in the tmux session. You can go out of the tmux session without closing it. In VSC you can choose the tmux session as the host.

2022-11-20

Solution

 1

Simply start a tmux process in the remote terminal start Jupyter in the tmux session. You can go out of the tmux session without closing it. In VSC you can choose the tmux session as the host.

2022-11-20