Jupyterlabt2b: Difference between revisions

From T2B Wiki
Jump to navigation Jump to search
(Created page with "=== How to be able to work with jupyterlab on T2B using Linux personal machine === == Create file "config" in ~/.ssh directory of your personal machine. == Write into the config file: <pre> Host mlong HostName mlong.iihe.ac.be User your_username ForwardX11 yes ServerAliveInterval 100 LocalForward ???? localhost:????" </pre> ''???? is an identical 4-digit number you can invent yourself.''<br /> Save and close the config file. Now you can connect to...")
 
Line 10: Line 10:
     ForwardX11 yes
     ForwardX11 yes
     ServerAliveInterval 100
     ServerAliveInterval 100
     LocalForward ???? localhost:????"
     LocalForward xxxx localhost:xxxx
</pre>
</pre>
''???? is an identical 4-digit number you can invent yourself.''<br />
''xxxx is an identical 4-digit number you can invent yourself.''<br />
Save and close the config file.
Save and close the config file.



Revision as of 10:40, 12 March 2024

How to be able to work with jupyterlab on T2B using Linux personal machine

Create file "config" in ~/.ssh directory of your personal machine.

Write into the config file:

Host mlong
    HostName mlong.iihe.ac.be
    User your_username
    ForwardX11 yes
    ServerAliveInterval 100
    LocalForward xxxx localhost:xxxx

xxxx is an identical 4-digit number you can invent yourself.
Save and close the config file.

Now you can connect to T2B using the alias in the ssh config file:

$ ssh mlong

(If this does not work you may want to reopen your terminal.)

On t2b, activate (or create and activate) a virtual environment and install jupyter.

Create a jupyter config file by:

$ jupyter lab --generate-config

Open the jupyter config file in a text editor, e.g.:

$ vim ~/.jupyter/jupyter_lab_config.py

Remove # in front of these 2 lines in the file:

c.ServerApp.open_browser = False
c.ServerApp.port = 0

Change the 0 in the second line to the same 4-digit number you chose in the ssh config file on your personal machine.
Save and close the jupyter config file.
Now you can run:

$ jupyter lab

To open the session in the browser of your personal machine, copy-paste one of the links under

"Or copy and paste one of these URLs:".

To close the session close the tab on your browser, then on t2b command line press "Ctrl+C" twice.