-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrantfile
45 lines (37 loc) · 1.75 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- mode: ruby -*-
# vi: set ft=ruby :
# if there are any problems with these required gems, vagrant
# apparently has its own ruby environment (which makes sense). To
# install these gems (iniparse, for example), you need to run
# something like:
#
# [unix]$ vagrant package install iniparse
require 'iniparse'
Vagrant.configure("2") do |config|
# preliminaries
root_dir = File.dirname(__FILE__)
ini = IniParse.parse( File.read(root_dir + '/config.ini') )
#################################################### VIRTUALBOX PROVIDER SETUP
# global configuration on the virtualbox provider. for all available
# options, see http://www.virtualbox.org/manual/ch08.html
virtualbox_server_name = ini['servers']['virtualbox']
config.vm.provider :virtualbox do |vb, override_config|
vb.gui = false
override_config.vm.box = "trusty64"
override_config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
override_config.vm.network :forwarded_port, guest: 8000, host: 8000
# override_config.vm.network :forwarded_port, guest: 80, host: 8080
# http://stackoverflow.com/a/17126363/892506
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--memory", "2048"]
# super slow network connection for some reason. delightful.
# http://serverfault.com/a/595010/127012
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
################################################################# LOCAL SERVER
config.vm.define virtualbox_server_name do |server_config|
server_config.vm.hostname = virtualbox_server_name
end
end