Skip to content

Commit 33bddf5

Browse files
committed
Added a Vagrantfile to create Vagrant virtual machines
1 parent 4b5a7fc commit 33bddf5

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

Vagrantfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
## Define variables
2+
VAGRANTFILE_API_VERSION = 2
3+
VM_BOX_NAME = "basic-base"
4+
5+
# Specify the minimum Vagrant version
6+
Vagrant.require_version ">= 1.4.2"
7+
8+
## Check for the required plugins
9+
unless Vagrant.has_plugin?("vagrant-list")
10+
raise "Vagrant-list plugin is not installed!"
11+
end
12+
unless Vagrant.has_plugin?("vagrant-vbguest")
13+
raise "Vagrant-vbguest plugin is not installed!"
14+
end
15+
16+
## Configure the vagrant virtual machine
17+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
18+
19+
# Define the "buildpack" VM and set it as the primary machine
20+
config.vm.define "buildpack", primary: true do |buildpack|
21+
# Define the base box to use.
22+
buildpack.vm.box = VM_BOX_NAME
23+
24+
# Share an additional folder to the guest VM.
25+
#buildpack.vm.synced_folder "./data", "/vagrant_data"
26+
27+
# Enable provisioning with a shell script.
28+
#buildpack.vm.provision "shell", path: "data/buildpack_install.sh"
29+
30+
# Configure network
31+
#buildpack.vm.network "private_network", ip: "192.168.50.1"
32+
#buildpack.vm.network "forwarded_port", guest: 8000, host: 8088 # Web server
33+
end
34+
35+
#### Set common VM settings ####
36+
## vagrant-vbguest plugin configuration ##
37+
# The VBoxGuestAdditions.iso path should be auto-detected.
38+
# However, if this fails then it can be specified by:
39+
#config.vbguest.iso_path = "#{ENV['HOME']}/Downloads/VBoxGuestAdditions.iso"
40+
# or
41+
#config.vbguest.iso_path = "http://company.server/VirtualBox/%{version}/VBoxGuestAdditions.iso"
42+
43+
# Set auto_update to false if you do NOT want to check the correct
44+
# additions version when booting this machine.
45+
config.vbguest.auto_update = true
46+
47+
# Do NOT download the iso file from a webserver.
48+
config.vbguest.no_remote = true
49+
50+
config.vm.provider "virtualbox" do |vb|
51+
# Set memory to 512MB to match Heroku limits.
52+
vb.customize [
53+
"modifyvm", :id,
54+
"--memory", "512",
55+
"--cpus", "2"
56+
]
57+
end
58+
end

0 commit comments

Comments
 (0)