kelleydv / Eidyia

A scientific python environment configured with Vagrant
MIT License
20 stars 0 forks source link

Port forwarding? #2

Closed kelleydv closed 10 years ago

kelleydv commented 10 years ago

I want to be able to view the ipython notebook

vagrant@raring64-vanilla:~$ ipython3 notebook
[NotebookApp] Created profile dir: '/home/vagrant/.ipython/profile_default'
[NotebookApp] Serving notebooks from /home/vagrant
[NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8888/
[NotebookApp] Use Control-C to stop this server and shut down all kernels.
[NotebookApp] No web browser found: could not locate runnable browser.

ipython wants to open it's own browser, which is not installed. I am fine with that, but I want to be able to visit http://127.0.0.1:8888/ from the host machine to be able to work with the notebook.

jakiestfu commented 10 years ago

In your Vagrant File, add the following line:

config.vm.network :forwarded_port, host: 8888, guest: 8888

The guest parameter is the port inside Vagrant, and the host parameter is the port you want mapped to outside Vagrant. Let me know if this fixes things for you

kelleydv commented 10 years ago

I did a port scan on the host. There is clearly something happening on 8888, but I can't get what I want in the browser

Port Scan has started…

Port Scanning host: 127.0.0.1

         Open TCP Port:     22          ssh
         Open TCP Port:     631         ipp
         Open TCP Port:     2222        rockwell-csp2
         Open TCP Port:     4370
         Open TCP Port:     4380
         Open TCP Port:     8888        ddi-tcp-1
         Open TCP Port:     17500
         Open TCP Port:     26164
         Open TCP Port:     29754
         Open TCP Port:     37395
         Open TCP Port:     54740
         Open TCP Port:     57669
         Open TCP Port:     57670
         Open TCP Port:     63391
Port Scan has completed…
jakiestfu commented 10 years ago
vagrant up
vagrant ssh
ipython3 notebook

Open a New Tab

vagrant ssh
curl http://localhost:8888/

This curl request returns data, but obviously isn't being mapped to external port. On mac, when you do the curl request, the connection is refused. This was a problem with the apache LAMP setup, too.

kelleydv commented 10 years ago

OK. Good troubleshooting. We need to figure this out.

kelleydv commented 10 years ago

solved: https://github.com/stemdev/Eidyia/commit/05f986066481dc8d6d602c55de648e77c29d7905