-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathVagrantfile
111 lines (83 loc) · 3.23 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
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require_relative 'lib/better_usb.rb'
require_relative 'lib/calculate_hardware.rb'
require_relative 'lib/os_detector.rb'
puts "Vagrant's Ruby Version: #{RUBY_VERSION}"
if ARGV[0] == "up" then
has_installed_plugins = false
#unless Vagrant.has_plugin?("vagrant-vbguest")
# system("vagrant plugin install vagrant-vbguest")
# has_installed_plugins = true
#end
if has_installed_plugins then
puts "Vagrant plugins were installed. Please run vagrant up again to install the VM"
exit
end
end
vagrant_dir = File.expand_path(File.dirname(__FILE__))
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#
# Ubuntu 14.04 minimal desktop.
#
# The following modifications are made to this image:
#
# Installed vim
# Performed Updates and dist-upgrade ( on 06.06.2014 )
# Removed network-manager
# Disabled apparmor
# Removed older kernels
#
# The following packages were removed:
#
# thunderbird
# rythmbox
# empathy
# ubuntu-docs
# gnome-user-guide
# deja-dup
# xterm
# remmina
# transmission
# brasero
# cheese
# totem
config.vm.box = "kumichou/ce_embedded"
config.vm.hostname = "ce-virtual-machine"
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
config.vm.synced_folder(".", "/vagrant",
:owner => "vagrant",
:group => "vagrant",
:mount_options => ['dmode=777','fmode=777']
)
config.vm.provider "virtualbox" do |vb|
# Tell VirtualBox that we're expecting a UI for the VM
vb.gui = true
# Give the virtual machine a name
vb.name = "ContextualElectronics"
# Turn on USB 2.0 support, requires the VirtualBox Extras to be installed
vb.customize ["modifyvm", :id, "--usb", "on", "--usbehci", "on"]
# Enable sharing the clipboard
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
# Set # of CPUs and the amount of RAM, in MB, that the VM should allocate for itself, from the host
CalculateHardware.set_minimum_cpu_and_memory(vb, 2, 2048)
# Set Northbridge
vb.customize ["modifyvm", :id, "--chipset", "ich9"]
# Set the amount of RAM that the virtual graphics card should have
vb.customize ["modifyvm", :id, "--vram", "128"]
# Advanced Programmable Interrupt Controllers (APICs) are a newer x86 hardware feature
vb.customize ["modifyvm", :id, "--ioapic", "on"]
# Enable the use of hardware virtualization extensions (Intel VT-x or AMD-V) in the processor of your host system
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
# Enable, if Guest Additions are installed, whether hardware 3D acceleration should be available
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
# Setup rule to automatically attach ST Link v2.1 Debugger when plugging in Nucleo board
BetterUSB.usbfilter_add(vb, "0x0483", "0x374b", "ST Link v2.1 Nucleo")
# Setup rule to automatically attach Freescale Debugger when plugging in Nucleo board
BetterUSB.usbfilter_add(vb, "0x0d28", "0x0204", "Freescale freedom")
# Set the timesync threshold to 10 seconds, instead of the default 20 minutes.
vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
end
end