-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
193 lines (157 loc) · 7.51 KB
/
Vagrantfile
File metadata and controls
193 lines (157 loc) · 7.51 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# -*- mode: ruby -*-
# vi: set ft=ruby :
# install dependencies
unless Vagrant.has_plugin?('vagrant-s3auth')
# Attempt to install ourself. Bail out on failure so we don't get stuck in an
# infinite loop.
system('vagrant plugin install vagrant-s3auth') || exit!
# Relaunch Vagrant so the plugin is detected. Exit with the same status code.
exit system('vagrant', *ARGV)
end
unless Vagrant.has_plugin?('vagrant-reload')
# Attempt to install ourself. Bail out on failure so we don't get stuck in an
# infinite loop.
system('vagrant plugin install vagrant-reload') || exit!
# Relaunch Vagrant so the plugin is detected. Exit with the same status code.
exit system('vagrant', *ARGV)
end
Vagrant.configure(2) do |config|
config.vm.define 'arch' do |arch|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
arch.vm.box = 'terrywang/archlinux'
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
arch.vm.network 'private_network', type: 'dhcp'
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
arch.vm.provider 'virtualbox' do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = false
vb.name = 'data-chan-arch'
# Customize the amount of memory on the VM:
vb.memory = '1024'
# Avoid ubuntu network problems at boot
vb.customize ['modifyvm', :id, '--cableconnected1', 'on']
# Limit CPU usage
vb.customize ['modifyvm', :id, '--cpuexecutioncap', '65']
end
###############################################################
arch.vm.provision 'shell', privileged: false, inline: <<-SHELL
sudo pacman --noconfirm -Syu
sudo pacman --noconfirm -S avr-gcc avr-libc avr-binutils libusb make doxygen git autogen autoconf clang avrdude python-pip
sudo pip install mkdocs
# link volume to home user folder
ln -s /vagrant /home/vagrant/data-chan
bash /vagrant/scripts/print-versions.sh
SHELL
end
config.vm.define 'ubuntu' do |ubuntu|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
ubuntu.vm.box = 'ubuntu/xenial64'
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
ubuntu.vm.network 'private_network', type: 'dhcp'
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
ubuntu.vm.provider 'virtualbox' do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = false
vb.name = 'data-chan-ubuntu'
# Customize the amount of memory on the VM:
vb.memory = '1024'
# Limit CPU usage
vb.customize ['modifyvm', :id, '--cpuexecutioncap', '65']
end
## Enable USB Controller on VirtualBox
# ubuntu.vm.provider 'virtualbox' do |vb|
# vb.customize ['modifyvm', :id, '--usb', 'on']
# vb.customize ['modifyvm', :id, '--usbehci', 'on']
# end
## Implement determined configuration attributes
# ubuntu.vm.provider 'virtualbox' do |vb|
# vb.customize ['usbfilter', 'add', '0',
# '--target', :id,
# '--name', 'datachan tester',
# '--product', 'datachan tester']
# end
# ubuntu.vm.provider 'virtualbox' do |vb|
# vb.customize ['usbfilter', 'add', '0',
# '--target', :id,
# '--name', 'USBasp',
# '--product', 'USBasp']
# end
###############################################################
ubuntu.vm.provision 'shell', privileged: false, inline: <<-SHELL
printf "\n\nInstalling software\n"
sudo apt-get update
sudo apt-get -y install byacc flex doxygen libpcre3 libpcre3-dev git openssl pkg-config libssl-dev wget libusb-1.0-0-dev zlib1g-dev unzip python python-dev openssh-client tar gcc g++ gcc-avr avr-libc avrdude binutils-avr make autogen autoconf curl build-essential clang
printf "\n\nInstalling pip and mkdocs\n"
sudo bash /vagrant/scripts/install-mkdocs.sh
# link volume to home user folder
ln -s /vagrant data-chan
bash /vagrant/scripts/print-versions.sh
printf "\n\n\n\nThe box is ready. Now simply run \"vagrant ssh\" to connect! \n"
SHELL
end
config.vm.define 'windows' do |windows|
# The following box is from a privte s3 bucket.
# To use it you need to install this vagrant plugin: https://github.com/WhoopInc/vagrant-s3auth
# You can build the box yourself following instructions from https://github.com/boxcutter/windows or https://github.com/fermiumlabs/boxcutter-windows
# If you are a company access to the boxes can be given through the "requester pays" feature of AWS
# If you're a nonprofit or an individual developing OSS, write to us at info (at) fermiumlabs (dot) com
# This box is maintaned by Fermium LABS srl (https://fermiumlabs.com)
windows.vm.box = 'eval-win2016-standard-ssh'
windows.vm.box_url = 's3://fermiumlabs-vagrant-boxes/virtualbox/eval-win2016-standard-ssh-nocm-1.0.4.box'
windows.vm.network 'private_network', type: 'dhcp'
windows.vm.provider :parallels do |prl, _override|
_override.vm.box_url = 's3://fermiumlabs-vagrant-boxes/parallels/eval-win2016-standard-ssh-nocm-1.0.4.box'
prl.memory = 3072
prl.cpus = 3
end
windows.vm.provider :vmware do |_vmw, _override|
_override.vm.box_url = 's3://fermiumlabs-vagrant-boxes/vmware/eval-win2016-standard-ssh-nocm-1.0.4.box'
end
# Let Vagrant know this is a windows box
windows.vm.communicator = 'winrm'
windows.vm.guest = :windows
# Wait a bit more for windows to shutdown
windows.windows.halt_timeout = 20
# Personalize VirtuabBox VM for windows
windows.vm.provider :virtualbox do |v, _override|
v.gui = true
v.customize ['modifyvm', :id, '--memory', 2048]
v.customize ['modifyvm', :id, '--cpus', 2]
v.customize ['modifyvm', :id, '--vram', '256']
v.customize ['modifyvm', :id, '--clipboard', 'bidirectional']
v.customize ['setextradata', 'global', 'GUI/MaxGuestResolution', 'any']
v.customize ['setextradata', :id, 'CustomVideoMode1', '1024x768x32']
end
## Enable USB Controller on VirtualBox
# windows.vm.provider 'virtualbox' do |vb|
# vb.customize ['modifyvm', :id, '--usb', 'on']
# vb.customize ['modifyvm', :id, '--usbehci', 'on']
# end
## Implement determined configuration attributes
# windows.vm.provider 'virtualbox' do |vb|
# vb.customize ['usbfilter', 'add', '0',
# '--target', :id,
# '--name', 'datachan tester',
# '--product', 'datachan tester']
# end
# windows.vm.provider 'virtualbox' do |vb|
# vb.customize ['usbfilter', 'add', '0',
# '--target', :id,
# '--name', 'USBasp',
# '--product', 'USBasp']
# end
###############################################################
windows.vm.provision :shell, path: 'scripts/desktopShortcut.ps1'
windows.vm.provision :shell, path: 'scripts/InstallChocolatey.ps1'
windows.vm.provision :shell, path: 'scripts/install.ps1'
windows.vm.provision :reload
end
end