Multiple X11 forwardings on ubuntu and jupyter-notebook

39 views
Skip to first unread message

muhamma...@gmail.com

unread,
Aug 29, 2020, 9:27:29 AM8/29/20
to Project Jupyter

Dear All,

We are using jupyter-notebook for educational purpose. We are facing the below issue. Please disregard this post if it is irrelevant to the discussion group.

I have installed jupyter-notebook on an ubuntu 18.04; let us call it Server A. I successfully establish SSH to server A initiated by my client ( Client B). I am able to visually forward X11 running of Firefox to Client B using the below command.

On Client B:
SSH -X@Server A ip Address
user1# sudo jupyter-notebook --allow-root
user1# firefox &

Now, Inside the jupyter-notebook in firefox tab, I am able to execute a GUI-based application - I am able to run Linux shell command inside the firefox tab(jupyter-notebook session).

!xclock

The problem is that the xclock is executed on the Server A successfully, but it is not forwarded to a new X11 window on the Client B. Is it possible to forward xclock(GUI Application), which is initiated by the jupyter-notebook session (firefox tab) to client B, while the firefox is also initiated by SSH connection from Client B?

Sincerely,
Mohammad

Jonathan Gutow

unread,
Aug 29, 2020, 12:13:11 PM8/29/20
to jup...@googlegroups.com
I'm not sure what you are trying to achieve, but you will get better response of Jupyter in the browser if the browser is running on your client, rather than your server. I suggest you use ssh port forwarding. You will need something like this on your client:

$ ssh -NL localhost:8080:localhost:8080 username@serverA

You will get asked for the password and can then point your client's browser at localhost:8080 to access the Jupyter server (this assumes 8080 is the local port it is running on).

An OK discussion with more details of this technique may be found at: https://www.howtogeek.com/168145/how-to-use-ssh-tunneling/
An SSH client connects to a Secure Shell server, which allows you to run terminal commands as if you were sitting in front of another computer.But an SSH client also allows you to “tunnel” a port between your local system and a remote SSH server. There are three different types of SSH tunneling, and they’re all used for different purposes.


Dr. Jonathan Gutow
Chemistry Department
UW Oshkosh



From: jup...@googlegroups.com <jup...@googlegroups.com> on behalf of muhamma...@gmail.com <muhamma...@gmail.com>
Sent: Saturday, August 29, 2020 8:27 AM
To: Project Jupyter <jup...@googlegroups.com>
Subject: [jupyter] Multiple X11 forwardings on ubuntu and jupyter-notebook
 

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/2f61a136-a236-48ea-915c-d5ba0fad51e9n%40googlegroups.com.

muhamma...@gmail.com

unread,
Aug 30, 2020, 7:13:48 PM8/30/20
to Project Jupyter
Dear Jonathan,

Although port forwarding may be very useful, but it doesn't solve this specific problem. let us assume everything with ssh port forwarding is correct, and client is able to connect to a remote jupyter server via SSH -NLX. the problem is, if the client opens his browser an initiates a new jupyter file and execute the below cell:

!xclock

the GUI application of the xclock will be executed on the remote server and will not be forwarded to client machine. Please note that if the client, here a windows user, initiates an ssh -X command by PuTTY, and execute the command serverA@xclock, the GUI will be forwarded to the client side successfully!

Sincerely,
Mohammad
Reply all
Reply to author
Forward
0 new messages