Connect to remote iPython notebook - ssh

I want to connect to existing notebooks via ssh tunnel / vpn on a remote linux machine.
I can not log in to the remote desktop viewing them,
but can generally log into another desktop session via Windows Remote Desktop (Win7, Linux with xrdp), so that I found the *.json files containing the ports (see similar questions 1, though I have no experience in finding the correct job/file).
After connecting a vpn and putty ssh tunnel (port A), I tried to access localhost:A by opening that in Firefox. Also I tried to run ipython notebook --existing kernel-B.json.
This did not work.
Do notebooks have to be on the tunneled port?
Or is there a way to connect (not start as in 2), or should I open a tunnel for every notebook port?
Similar questions:
Connecting to a remote IPython instance
Connect ipython-notebook via SSH tunnel from a remote location

Read this:
How do I add a kernel on a remote machine in IPython (Jupyter) Notebook?
Remote jupyter kernel/kernels administration utility (the rk) here:
https://github.com/korniichuk/rk
Should I open a tunnel for every notebook port?
Yes!

Related

Opening browser in client machine through ssh

Using linux, this link explains how to open a browser in the remote machine using ssh:
https://superuser.com/questions/583608/opening-browser-in-remote-machine-through-ssh-closed
How can I do to see the remote machines browser on the client computer?
Sort of as with xclock...

Windows 10 update then can't connect to guest vm

I'm a beginner in vm, I always used a working vm :D but today I've a big problem... :?
I've just updated my system windows 10 with the new available and suggested update, but now I can't connect to my guest vm.
Before (after windows update) I runned virtualbox 5.1.14 and it doesn't work, now I installed virtualbox 5.1.30 with the same result.
Before window's update it worked.
Initially I had one problem, host-only network doesn't works and the vm didn't start, so I deleted the old host-only network and created a new one and now the vm start, but I can't connect to the machine, that has a static ip (192. 168. 109. 151), with putty via ssh port 22, and also via http.
I used this ip address to connect to vm via browser.
The vm can ping google, and in virtualbox command line I can log in and make everything.
Some one know why I can't connect with my vm?
In virtualbox preferences I have set host-only network with this values:
IPV5 address 219.168.56.1
DHCP: 192.168.56.102
mask: 255.255.255.0
lower: 192.168.56.103
upper: 192.168.56.254
ok, now I can access via putty to port 22. I needed to add the static ip of the vm to virtualbox host-only network net in windows control panel, to tcp/ip protocol.
Now I need to acces via browser. For the moment it doesn't works

Remote access Jupyter notebook from Windows

I usually access Jupyter notebook running on Linux from Mac OS X via port forwarding like following:
https://coderwall.com/p/ohk6cg/remote-access-to-ipython-notebooks-via-ssh
Is it possible to do similar thing from Windows 10 instead of Mac OS? I guess putty or WSL offer one.
https://www.akadia.com/services/ssh_putty.html
https://superuser.com/questions/1119946/windows-subsystem-for-linux-ssh-port-forwarding
You can create an SSH tunnel to connect to the Jupyter Notebook or Jupyter Lab web interface using PUTTY on windows.
Download the latest version of PUTTY
Open PUTTY and enter the server URL or IP address as the hostname
Now, go to SSH on the bottom of the left pane to expand the menu and then click on Tunnels
Enter the port number which you want to use to access Jupyter on your local machine. Choose 8000 or greater (i.e. 8001, 8002, etc.) to avoid ports used by other services, and set the destination as localhost:8888 where :8888 is the number of the port that Jupyter Notebook is running on. Now click the Add button, and the ports should appear in the Forwarded ports list.
Click the Open button to connect to the server via SSH and tunnel to the desired ports.
In the PUTTY terminal, run Jupyter, where the default port is 8888
jupyter lab --no-browser or jupyter-notebook --no-browser
Copy the server path into the browser on your local system and navigate to the notebook
http://localhost:8888/lab?token=... or http://127.0.0.1:8888/lab?token=...
Note:
If running remotely to your employer, a VPN connection will probably be required.
As an addendum to this answer, this screenshot shows how putty config looks like:
On the Linux machine, I then start Jupyter with:
jupyter notebook --no-browser --port=8889
Finally, on the windows (or any remote machine) I enter localhost:8888 in the browser.
It asks for the token, that is provided at the shell of the Linux machine.
--
Note which port refers to which machine, I have the notebook on port 8889, the browser calls it at localhost:8888
I solved this problem by myself. My solution is using Windows Subsystem for Linux (WSL). This offers (virtual?) Linux console like Ubuntu. I just use ssh with -L option on it.
Follow the steps below.
step1- Download putty.
step2- Insert ip address or hostname.
step3- Go to SSH and expand.
step4- Add address of jupyter-notebook to destination column ex: localhost:6666. Add local port such as 8000 to source and press add button. Then connect, it should work.
I wanted to use the VPN Server feature of my cable box to enable remoting into my network, especially to run jupyter notebook. For my situation, probably not quite the same as anyone elses, this works fine.
On the cable box, be sure to enable the VPN Server and enable external access.
On the remote Windows 10 computer, add a PPTP VPN specifying cable box's external IP. Connect to the VPN. Verify you can access the network. e.g. You should be able to see the cable box's webpage.
On the Jupyter serving computer, in Windows Defender Firewall, you need to create a new Inbound Rule for a Port.
3.1. General-> Enabled, Allow the connection
3.2. Protocols and Ports-> TCP, 8888
3.3. Scope-> Private
On the Jupyter serving computer, invoke Jupyter (e.g 192.168.0.1, port 8888):
jupyter-notebook --ip 192.168.0.1 --port 8888 --no-browser
On the remote computer, you should now be able to access your Jupyter server by browsing to http://192.168.0.8:8888/tree

Unable to start X11 through ssh using Putty

Currently trying to setup the mininet virtual machine. I did all according to the instructions. Before proceeding following is my setup details.
My host platform - Windows 8.1
My guest OS : Ubuntu 14.04, 32-bit with mininet. I downloaded the
ovf this one - mininet-2.2.0-141209-ubuntu-14.04-server-i386. Running on VirtualBox
I installed the required packages on the mininet-ubuntu-server (xserver-xorg-core,xserver-xorg,xorg,xorg openbox,ubuntu-desktop). One package fxlrg, I could not install as it was saying "unable to locate package"
Then I used the command "startx" on virtualbox console, it started the ubuntu desktop but very slow and with poping up 4 to 5 errors.
I have already setup the network for host-only adapter, I am able to ping from host machine to guest machine, I am able to ssh from host machine to guest machine using PuTTy. I am able to login with no problems.
But I don't know to see the x11 window from PuTTy. I have already enabled the X11 forwarding on PuTTy and I have already installed the Xming on windows. Please suggest how to debug and how to fix this. I have no idea how to proceed now.
You may need to enable X11 SSH Forwarding in the /etc/ssh/ssh_config file.

VirtualBox, Remote Desktop, and VPN

Networking is not a strong skill set of mine and I'm new to VirtualBox..so here we go -
I've got a Windows (XP) VM running on VirtualBox. I am able to use remote desktop to connect to the VM with no problems.
The Problem: I need to connect to another network via VPN on the virtual machine. However, once connected, all local network resources become unavailable. As a result, my remote desktop session is disconnected.
Question: Is there another way to remotely access the VM? Is there some way that VirtualBox can route me to the VM without using the Windows RDC functionality so that I can have an active VPN connection but still control the VM remotely.
Should have done some more research. This feature is already built into VirtualBox. You can log into the VM through the host machine.
All you have to do is turn on remote display in the settings for the VM and choose the port that you want to use (make sure to make appropriate firewall changes). Then you remote to that port on the host machine.
Ex: Host machine has an IP of 192.168.1.200 and you set up port 3395 for the remote display - you would open Remote Desktop Connection and use 192.168.1.200:3395 and it would open the VM.
More detail from the VirtualBox site.
http://www.virtualbox.org/manual/ch07.html