Updated 9/1/2014 to add a few more IPython Notebook dependencies.
Honestly, you’d think it would be easy to remember these four simple steps, but I never seem to. Since IPython notebook is pretty much the greatest thing since sliced bread, here’s how to run it in Vagrant/VirtualBox and access the notebook from the host machine’s browser.
- Make sure the prerequisite packages are installed in the virtual machine’s Python environment:*
- jinja2
- sphinx
- pyzmq
- pygments
- tornado
- ipython
- Make sure your Vagrant file is forwarding port 8888 to port 8888 (or whatever you’d like to use):
- In your virtual machine, run the IPython notebook server: ipython notebook ––ip=0.0.0.0
- View the notebook in the host’s browser: http://localhost:8888
*Alternately, you can pip install ipython[notebook] to install IPython and all Notebook dependencies. I got errors when doing this via zsh, though it worked after switching to Bash.
Update 11/6/2014: Praful Mathur left a good tip for using the pip install ipython[notebook] syntax with zsh. You have to escape the hard brackets: pip install ipython\[all\]. Thanks!
Hi, this helped me. Thank you.
Thanks. –ip 0.0.0.0
It works in ZSH but you have to escape the hard brackets to ‘pip install ipython\[all\]’
The ZSH thing was driving me nuts. Thanks so much for the clarification–post updated!
I was struggling with the same problem. It is working now, thanks!
ipython notebook –ip=0.0.0.0 is running in my guest Ubuntu / Vagrant virtual box.
I forwarded the port: 8888->8001, but I still can’t access the notebook server from my host
OS X 10.10.3.
Vagrantfile:
config.vm.network :forwarded_port, host: 8001, guest: 8888, auto_correct: true # IPython port (set in notebook config)
Curiously, it work from a different virtual box (e.g. Spark).
David-Laxers-MacBook-Pro:coreos-vagrant davidlaxer$ vagrant suspend
==> core-01: Saving VM state and suspending execution…
David-Laxers-MacBook-Pro:coreos-vagrant davidlaxer$ vi Vagrantfile
David-Laxers-MacBook-Pro:coreos-vagrant davidlaxer$ vagrant up
Bringing machine ‘core-01′ up with ‘virtualbox’ provider…
==> core-01: Checking if box ‘coreos-alpha’ is up to date…
==> core-01: Resuming suspended VM…
==> core-01: Booting VM…
==> core-01: Waiting for machine to boot. This may take a few minutes…
core-01: SSH address: 127.0.0.1:2222
core-01: SSH username: core
core-01: SSH auth method: private key
==> core-01: Machine booted and ready!
David-Laxers-MacBook-Pro:coreos-vagrant davidlaxer$ vagrant ssh
Last login: Mon Jul 6 19:15:36 2015 from 10.0.2.2
CoreOS alpha (723.1.0)
Failed Units: 1
format-ephemeral.service
core@core-01 ~ $ docker run -ti –net=host –rm -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority -e DISPLAY=$DISPLAY -e XAUTHORITY=/root/.Xauthority –privileged nashamri/nupic
root@core-01:/home/docker# ipython notebook –ip=0.0.0.0
2015-07-06 19:25:02.756 [NotebookApp] Created profile dir: u’/root/.ipython/profile_default’
2015-07-06 19:25:02.763 [NotebookApp] Using system MathJax
2015-07-06 19:25:02.785 [NotebookApp] Serving notebooks from local directory: /home/docker
2015-07-06 19:25:02.785 [NotebookApp] The IPython Notebook is running at: http://0.0.0.0:8888/
2015-07-06 19:25:02.785 [NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
2015-07-06 19:25:02.785 [NotebookApp] WARNING | No web browser found: could not locate runnable browser.
I spent the whole day trying to get jupyter working, and all this time it was just what you recommended in starting it with –ip=0.0.0.0. Is there a way to specify in the configuration file?
Thanks for getting my jupyter working!!!!
–ip=0.0.0.0 worked like a charm, but why?
Olá Mel,Pelo jeito você não procurou um pouquinho no blog o artigo que eu falo sobre isso…Veja esse artigo e você terá a resposta
Aw your outside reading spot looks lovely! I prefer a relaxed approach to the readathon, although I did spent too much time on Twitter following the readathon hashtag.
hey there — i get this error `No web browser found: could not locate runnable browser.` wdyt is possible to fix here?