Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

access jupyter notebook running on vm

I want to run jupyter notebook running on my ubuntu vm which i fired using vagrant.

$ jupyter notebook --no-browser --port 8004
[I 18:26:10.152 NotebookApp] Serving notebooks from local directory: /home/vagrant/path/to/jupyter/notebook/directory
[I 18:26:10.153 NotebookApp] 0 active kernels
[I 18:26:10.154 NotebookApp] The Jupyter Notebook is running at: http://localhost:8004/
[I 18:26:10.154 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

Jupyter notebook starts in localhost. But to access the notebook from my host machine I need to start the notebook in 0.0.0.0. How to bind the ip 0.0.0.0 so that it routes to 127.0.0.1 in the vm?

My host machine is windows and vm is ubuntu 14.04.4

like image 872
joydeep bhattacharjee Avatar asked Jul 23 '16 18:07

joydeep bhattacharjee


1 Answers

For my case (using VMware with Ubuntu), the solution was very simple. By default, the network adapter was already in NAT mode. If not, adjust this in the settings of your VM instance.

Type ifconfig in a VM terminal to get your local IP, e.g. 192.168.124.131.

Start the notebook: jupyter notebook --ip=192.168.124.131 --no-browser

The terminal then gives you a link you can use on the host to access jupyter, e.g. http://192.168.124.131:8888/?token=xxxxxxxxxxxxxxxxxxx.

like image 92
Caranown Avatar answered Oct 19 '22 07:10

Caranown