Skip to content

Instantly share code, notes, and snippets.

@newtover
Last active December 23, 2017 13:18
Show Gist options
  • Save newtover/365cd9df859008f8d6c3040dcf8248e1 to your computer and use it in GitHub Desktop.
Save newtover/365cd9df859008f8d6c3040dcf8248e1 to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
# https://www.vagrantup.com/docs/networking/forwarded_ports.html
# it's useful to have a predictable port pattern for different vagrant instances (here 10000 + n)
config.vm.network "forwarded_port", guest: 5000, host: 10080, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 22, host: 10022, id: "ssh"
# Work around disconnected virtual network cable.
config.vm.provider "VirtualBox" do |vb|
vb.customize ["modifyvm", :id, "--cableconnected1", "on", "--memory", "4096"]
vb.cpus = 2
end
# https://www.vagrantup.com/docs/provisioning/shell.html
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# fetch fresh apt lists
sudo apt-get -qqy update
# upgrade installed packages
# https://github.com/mitchellh/vagrant/issues/289
sudo DEBIAN_FRONTEND=noninteractive apt-get -qqy upgrade
# gcc, etc.
# sudo apt-get -qqy install build-essential
# required for uwsgi installed for built in python
# sudo apt-get -qqy install libpcre3 libpcre3-dev
curl -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b
printf "\nexport PATH=/home/vagrant/miniconda3/bin:\$PATH\n\n" >> ~/.bashrc
export PATH=/home/vagrant/miniconda3/bin:$PATH
vagrantTip="The shared directory is located at /vagrant\nTo access your shared files: cd /vagrant\n"
sudo sh -c "printf '$vagrantTip' > /etc/motd"
echo "Done installing your virtual machine!"
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment