Skip to content
Advertisement

Setup Jupyter inside Fusion’s CentOS 7

I am trying to install Jupyter inside CentOS 7 VM (that I already had) so I can access it via port 8888 at my host Mac laptop. However, I cannot figure out the networking piece.

I am changing the IP address to 200.100.x.x for convenience

From Host Machine

I have 2 adapters for that CentOS VM

enter image description here

enter image description here

$ ifconfig gives me this (I believe those are the same):

JavaScript

From within CentOS

JavaScript

My tests

I pinged the following IP addresses from my host machine and they all worked:

JavaScript

That means there is networking connectivity into the VM. Correct?

When I do jupyter notebook, I could access http://localhost:8888/tree inside the VM but I cannot go there using any IP address from my host OS on the Macbook.

I have restarted my VM many times.

Questions

  1. Is it because of port blocking / not forwarding (8888) or something and if so, how to fix it?

  2. Did I setup the networking incorrectly? Is there something else I need to do inside CentOS? I read this blog here http://twiki.org/cgi-bin/view/Blog/BlogEntry201310x2 and I don’t see eth0 at all.

Advertisement

Answer

The problem is Jupyter picked 127.0.0.0 or localhost by default. If you have the adapter with other IP addresses, it won’t work.

You need to change the IP of Jupyter inside the VM

http://jupyter-notebook.readthedocs.org/en/latest/config.html

$ jupyter notebook --generate-config

Edit it:

vi /root/.jupyter/jupyter_notebook_config.py

Then change:

c.Notebookapp.ip = '0.0.0.0'

Restart jupyter notebook and should be good to go.

Make sure firewall is off or open for port 8888 as well.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement