Skip to content

Instantly share code, notes, and snippets.

@sergiobuj
Last active August 29, 2015 14:01
Show Gist options
  • Save sergiobuj/2de9c841b6bd07329148 to your computer and use it in GitHub Desktop.
Save sergiobuj/2de9c841b6bd07329148 to your computer and use it in GitHub Desktop.
Working vagrant base box with python dev tools included.

Create custom Vagrant base boxes

About ipyvmbase:

  • Debian 7.5
  • build-essentials and git
  • ipython notebook
  • numpy
  • scipy
  • matplotlib
  • pandas

Prepared following this Vagrant box docs

Use

  1. Set git user.name and user.email
  2. This Vagrantfile will download ipyvmbase from dropbox and forward port 8888 for the IPython notebook.

Going further

  1. Create this vagrant machine
  2. Shut it down
  3. Package this as a new box with the Vagrantfile to have a new base machine with vagrant package --Vagrantfile Vagrantfile
  4. Then add the resulting 'package.box' as a vagrant box with vagrant box add <name> package.box

Notes

  • the notebook alias has the --quiet option, so launching the notebook won't write to stdout.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ipyvmbase"
config.vm.box_url = "https://www.dropbox.com/meta_dl/eyJzdWJfcGF0aCI6ICIiLCAidGVzdF9saW5rIjogZmFsc2UsICJzZXJ2ZXIiOiAiZGwuZHJvcGJveHVzZXJjb250ZW50LmNvbSIsICJpdGVtX2lkIjogbnVsbCwgImlzX2RpciI6IGZhbHNlLCAidGtleSI6ICJ1ZWJtOTA0MGV3dDFobzMifQ/AALhKgNxT3xFnqb8HW_L9qUVIpQUIqgfl0AYbxqTqjPL9w?dl=1"
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
config.vm.network :forwarded_port, guest: 8888, host: 8888, auto_correct: true
#config.vm.provider "virtualbox" do |v|
# v.memory = 1024
# v.cpus = 2
#end
$gitconfig =<<EOF
git config --global user.name \"NAME\"
git config --global user.email [email protected]
EOF
config.vm.provision :shell, :inline => $gitconfig, :privileged => false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment