forked from chocolatey-community/chocolatey-test-environment
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Vagrantfile
74 lines (65 loc) · 3.14 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
Vagrant.require_version ">= 1.8"
# http://docs.vagrantup.com/v2/vagrantfile/machine_settings.html
Vagrant.configure("2") do |config|
# This setting will download the atlas box at https://atlas.hashicorp.com/ferventcoder/boxes/win2012r2-x64-nocm
config.vm.box = "ferventcoder/win2012r2-x64-nocm"
# http://docs.vagrantup.com/v2/virtualbox/configuration.html
config.vm.provider :virtualbox do |v|
v.gui = true
v.linked_clone = true
v.customize ["modifyvm", :id, "--memory", "4096"]
v.customize ["modifyvm", :id, "--cpus", "2"]
v.customize ["modifyvm", :id, "--vram", 32]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--audio", "none"]
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
v.customize ["modifyvm", :id, "--draganddrop", "hosttoguest"]
v.customize ["modifyvm", :id, "--usb", "off"]
end
# https://www.vagrantup.com/docs/hyperv/configuration.html
# https://technet.microsoft.com/en-us/library/dn798297(v=ws.11).aspx
config.vm.provider :hyperv do |v|
v.memory = 4096
v.cpus = 2
v.ip_address_timeout = 130
v.linked_clone = true
v.vm_integration_services = {
guest_service_interface: true,
heartbeat: true,
key_value_pair_exchange: true,
shutdown: true,
time_synchronization: true,
vss: true
}
end
config.windows.halt_timeout = 20 # timeout of waiting for image to stop running - may be a deprecated setting
config.winrm.username = "vagrant"
config.winrm.password = "vagrant"
config.vm.guest = :windows
config.vm.communicator = "winrm"
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
# Synced folders - http://docs.vagrantup.com/v2/synced-folders/
config.vm.synced_folder "packages", "/packages"
config.vm.synced_folder "shell", "/scripts"
#config.vm.synced_folder "temp", "/Users/vagrant/AppData/Local/Temp/chocolatey"
# not recommended for sharing, it may have issues with `vagrant sandbox rollback`
#config.vm.synced_folder "chocolatey", "/ProgramData/chocolatey"
# Port forward WinRM / RDP
config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true
# http://docs.vagrantup.com/v2/provisioning/shell.html
scripts = [
{ :path => "shell/PrepareWindows.ps1" },
{ :path => "shell/InstallNet4.ps1" },
{ :path => "shell/InstallChocolatey.ps1" },
{ :path => "shell/NotifyGuiAppsOfEnvironmentChanges.ps1"},
# { :path => "shell/InstallTools.ps1" },
{ :path => "shell/TestPackages.ps1", :args => ENV['PACKAGES'], :run => "always" },
{ :path => "User.ps1", :run => "always" }
]
scripts.each do |s|
s[:powershell_elevated_interactive] = true if Vagrant::VERSION >= '1.8.0'
config.vm.provision :shell, s
end
end