├── .gitignore
├── LICENSE.txt
├── README.md
├── answer_files
├── 10
│ └── Autounattend.xml
├── 2016
│ └── Autounattend.xml
├── 2019
│ └── Autounattend.xml
└── 2016_core
│ └── Autounattend.xml
├── extras
├── biztalk
│ ├── BizTalkConfig-DSC-Example.ps1
│ ├── InstallBizTalk.ps1
│ └── Vagrantfile
├── devmachine
│ ├── Meslo LG M DZ Regular for Powerline.ttf
│ ├── Vagrantfile
│ ├── bare.ps1
│ ├── install-extra.ps1
│ └── install-minimal.ps1
└── ubuntu
│ ├── install.sh
│ └── kube.sh
├── scripts
├── bootstrap.ps1
├── oracle.cer
├── tools_and_stuff.ps1
├── unattend.xml
├── windows-base.ps1
├── windows-compress.ps1
└── windows-updates.ps1
├── templates
├── vagrantfile-windows-2016-core.template
├── vagrantfile-windows-2016.template
├── vagrantfile-windows-2019.template
└── vagrantfile-windows_10.template
├── virtualbox_windows_10_1_base.json
├── virtualbox_windows_10_2_updates.json
├── virtualbox_windows_10_3_package.json
├── virtualbox_windows_server_2016_1_base.json
├── virtualbox_windows_server_2016_2_updates.json
├── virtualbox_windows_server_2016_3_package.json
├── virtualbox_windows_server_2019_1_base.json
├── virtualbox_windows_server_2019_2_updates.json
├── virtualbox_windows_server_2019_3_package.json
├── virtualbox_windows_servercore_2016_1_base.json
└── virtualbox_windows_servercore_2016_3_package.json
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | *~
3 | output*
4 | packer_cachepacker-para*
5 | packer_cache
6 | *.box
7 | packer*
8 | .DS_Store
9 | .vagrant
10 | templates/parallels_windows_server_2016_4.vagrantcloud.json
11 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Jacqueline Portier
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Windows templates for Packer
2 |
3 | ## Introduction
4 | This repository contains Windows templates that can be used to create boxes for Vagrant using Packer.
5 | It is inspired by [https://github.com/mwrock/packer-templates](https://github.com/mwrock/packer-templates) and by [https://github.com/MattHodge/PackerTemplates](https://github.com/MattHodge/PackerTemplates).
6 | I was a bit stuck until I read [https://hodgkins.io/best-practices-with-packer-and-windows](https://hodgkins.io/best-practices-with-packer-and-windows). My previous approach of stuffing all box creating effort in 1 file was very cumbersome. Turns out you can use a modular approach with Packer by creating multiple artifacts and chain them together.
7 |
8 | ## How to
9 |
10 | ### Prerequisites
11 | The Windows boxes are created with Packer version 1.5.1 and are using WinRM.
12 | [Vagrant](https://www.vagrantup.com), [Packer](https://www.packer.io) and Virtualbox.
13 |
14 | **Linux:**
15 | Install them with your package provider or manually, for example like so:
16 |
17 | ```bash
18 | wget https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_linux_amd64.zip
19 | unzip vagrant_2.2.6_linux_amd64.zip
20 | sudo mv vagrant /usr/local/bin
21 |
22 | wget https://releases.hashicorp.com/packer/1.5.1/packer_1.5.1_linux_amd64.zip
23 | unzip packer_1.5.1_linux_amd64.zip
24 | sudo mv packer /usr/local/bin
25 | ```
26 |
27 | **Windows VirtualBox:**
28 |
29 | You can install the prerequisites with packagemanagement:
30 | ```Powershell
31 | Install-Package -ProviderName Chocolatey -ForceBootstrap -Force vagrant,virtualbox,packer
32 | ```
33 |
34 |
35 | ### Clone and run
36 |
37 | Clone the repository:
38 | ```
39 | git clone https://github.com/jacqinthebox/packer-templates.git; cd packer-templates
40 | ```
41 |
42 | ### Create a box
43 |
44 | Create a Windows 10 box:
45 |
46 | ```bash
47 | packer build --force virtualbox_windows_10_1_base.json
48 | packer build --force virtualbox_windows_10_2_updates.json
49 | packer build --force virtualbox_windows_10_3_package.json
50 | ```
51 |
52 | Create a Windows Server 2019 box:
53 |
54 | ```bash
55 | packer build --force virtualbox_windows_server_2019_1_base.json
56 | packer build --force virtualbox_windows_server_2019_2_updates.json
57 | packer build --force virtualbox_windows_server_2019_3_package.json
58 | ```
59 |
60 | ### Add the box to Vagrant
61 |
62 | ```bash
63 | vagrant box add --name windows_10 windows10_vbox.box
64 | ```
65 |
66 |
67 | ## Or just use the boxes from the Vagrant cloud
68 |
69 | Create a Vagrantfile
70 |
71 | ```ruby
72 | Vagrant.configure("2") do |config|
73 | config.vm.define "lab01" do |lab01_config|
74 | lab01_config.vm.box = "jacqinthebox/windows10"
75 | lab01_config.vm.hostname ="lab01"
76 |
77 | lab01_config.vm.provider "virtualbox" do |v|
78 | v.linked_clone = true
79 | end
80 | end
81 | end
82 | ```
83 | And do
84 |
85 | ```sh
86 | vagrant up
87 | ```
88 |
89 | This may take a while because the boxes are around 6 Gigabytes.
90 |
91 | [https://app.vagrantup.com/boxes/search?order=desc&page=1&provider=&q=jacqinthebox](https://app.vagrantup.com/boxes/search?order=desc&page=1&provider=&q=jacqinthebox)
--------------------------------------------------------------------------------
/answer_files/10/Autounattend.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 1
11 | Primary
12 | true
13 |
14 |
15 |
16 |
17 | false
18 | NTFS
19 | C
20 | 1
21 | 1
22 |
23 |
24 |
25 | 0
26 | true
27 |
28 | OnError
29 |
30 |
31 | true
32 | Vagrant Administrator
33 | Vagrant Inc.
34 |
35 |
47 |
48 |
49 | NPPR9-FWDCX-D2C8J-H872K-2YT43
50 | Never
51 |
52 |
53 |
54 |
55 |
56 | 0
57 | 1
58 |
59 | OnError
60 | false
61 |
62 |
63 | /IMAGE/NAME
64 | Windows 10 Enterprise LTSC 2019 Evaluation
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | en-US
73 |
74 | 0409:00000409
75 | en-US
76 | en-US
77 | en-US
78 | en-US
79 |
80 |
81 |
82 |
83 | false
84 |
85 |
86 |
87 |
88 | en-US
89 | en-US
90 | en-US
91 | en-US
92 | en-US
93 |
94 |
95 |
96 |
97 | vagrant
98 | true
99 |
100 |
101 |
102 |
103 | vagrant
104 | true
105 |
106 | Vagrant User
107 | vagrant
108 | administrators
109 | vagrant
110 |
111 |
112 |
113 |
114 | true
115 | true
116 | Work
117 | 1
118 |
119 |
120 |
121 | vagrant
122 | true
123 |
124 | vagrant
125 | true
126 |
127 |
128 |
129 | cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Force"
130 | Set Execution Policy 64 Bit
131 | 1
132 | true
133 |
134 |
135 | C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Force"
136 | Set Execution Policy 32 Bit
137 | 2
138 | true
139 |
140 |
141 | cmd.exe /c reg add "HKLM\System\CurrentControlSet\Control\Network\NewNetworkWindowOff"
142 | Network prompt
143 | 3
144 | true
145 |
146 |
147 | %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f
148 | 4
149 | Show file extensions in Explorer
150 |
151 |
152 | %SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f
153 | 5
154 | Enable QuickEdit mode
155 |
156 |
157 | %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f
158 | 6
159 | Show Run command in Start Menu
160 |
161 |
162 | %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f
163 | 7
164 | Show Administrative Tools in Start Menu
165 |
166 |
167 | cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
168 | 8
169 | Disable password expiration for vagrant user
170 |
171 |
172 | cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1
173 | Fix public network and enable WinRM
174 | 9
175 | true
176 |
177 |
178 | false
179 |
180 |
181 |
182 |
183 |
184 | false
185 |
186 |
187 | vagrant-w10
188 | UTC
189 |
190 |
191 |
192 | true
193 |
194 |
195 |
196 |
--------------------------------------------------------------------------------
/answer_files/2016/Autounattend.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | en-US
7 |
8 | en-US
9 | en-US
10 | en-US
11 | en-US
12 | en-US
13 |
14 |
15 |
16 |
17 |
18 |
19 | Primary
20 | 1
21 | 350
22 |
23 |
24 | 2
25 | Primary
26 | true
27 |
28 |
29 |
30 |
31 | true
32 | NTFS
33 |
34 | 1
35 | 1
36 |
37 |
38 | NTFS
39 |
40 | C
41 | 2
42 | 2
43 |
44 |
45 | 0
46 | true
47 |
48 |
49 |
50 |
51 |
52 |
53 | /IMAGE/NAME
54 | Windows Server 2016 SERVERSTANDARD
55 |
56 |
57 |
58 | 0
59 | 2
60 |
61 |
62 |
63 |
64 |
65 |
66 | OnError
67 |
68 | true
69 | Vagrant
70 | Hashicorp
71 |
72 |
73 |
74 |
75 |
76 |
77 | false
78 |
79 | vagrant-2016
80 | Pacific Standard Time
81 |
82 |
83 |
84 | true
85 |
86 |
87 | false
88 | false
89 |
90 |
91 | true
92 |
93 |
94 |
95 |
96 |
97 |
98 | vagrant
99 | true
100 |
101 | true
102 | vagrant
103 |
104 |
105 |
106 | cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
107 | Set Execution Policy 64 Bit
108 | 1
109 | true
110 |
111 |
112 | C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
113 | Set Execution Policy 32 Bit
114 | 2
115 | true
116 |
117 |
118 | cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1
119 | Fix public network
120 | 3
121 | true
122 |
123 |
124 | cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
125 | 4
126 | Disable password expiration for vagrant user
127 |
128 |
129 |
130 |
131 | vagrant
132 | true
133 |
134 |
135 |
136 |
137 | vagrant
138 | true
139 |
140 | Vagrant User
141 | Administrators
142 | vagrant
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 | false
151 |
152 |
153 |
154 |
155 |
--------------------------------------------------------------------------------
/answer_files/2016_core/Autounattend.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | en-US
7 |
8 | en-US
9 | en-US
10 | en-US
11 | en-US
12 | en-US
13 |
14 |
15 |
16 |
17 |
18 |
19 | Primary
20 | 1
21 | 350
22 |
23 |
24 | 2
25 | Primary
26 | true
27 |
28 |
29 |
30 |
31 | true
32 | NTFS
33 |
34 | 1
35 | 1
36 |
37 |
38 | NTFS
39 |
40 | C
41 | 2
42 | 2
43 |
44 |
45 | 0
46 | true
47 |
48 |
49 |
50 |
51 |
52 |
53 | /IMAGE/NAME
54 | Windows Server 2016 SERVERSTANDARDCORE
55 |
56 |
57 |
58 | 0
59 | 2
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | OnError
70 |
71 | true
72 | Vagrant
73 | Vagrant
74 |
75 |
76 |
77 |
78 |
79 |
80 | false
81 |
82 | vagrant-2016
83 | Pacific Standard Time
84 |
85 |
86 |
87 | true
88 |
89 |
90 | false
91 | false
92 |
93 |
94 | true
95 |
96 |
97 | true
98 |
99 |
100 |
101 |
102 |
103 |
104 | vagrant
105 | true
106 |
107 | true
108 | vagrant
109 |
110 |
111 |
112 | cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
113 | Set Execution Policy 64 Bit
114 | 1
115 | true
116 |
117 |
118 | C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
119 | Set Execution Policy 32 Bit
120 | 2
121 | true
122 |
123 |
124 | cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1
125 | Fix public network
126 | 3
127 | true
128 |
129 |
161 |
162 | cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
163 | 10
164 | Disable password expiration for vagrant user
165 |
166 |
167 |
168 | true
169 | true
170 | true
171 | true
172 | true
173 | Home
174 | 1
175 |
176 |
177 |
178 | vagrant
179 | true
180 |
181 |
182 |
183 |
184 | vagrant
185 | true
186 |
187 | administrators
188 | Vagrant
189 | vagrant
190 | Vagrant User
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 | false
200 |
201 |
202 |
203 |
204 |
--------------------------------------------------------------------------------
/answer_files/2019/Autounattend.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Primary
10 | 1
11 | 350
12 |
13 |
14 | 2
15 | Primary
16 | true
17 |
18 |
19 |
20 |
21 | true
22 | NTFS
23 |
24 | 1
25 | 1
26 |
27 |
28 | NTFS
29 |
30 | C
31 | 2
32 | 2
33 |
34 |
35 | 0
36 | true
37 |
38 |
39 |
40 |
41 |
42 |
43 | /IMAGE/NAME
44 | Windows Server 2019 SERVERDATACENTER
45 |
46 |
47 |
48 | 0
49 | 2
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | OnError
60 |
61 | true
62 | Vagrant
63 | Vagrant
64 |
65 |
66 |
67 |
68 | en-US
69 |
70 | 0409:00000409
71 | en-US
72 | en-US
73 | en-US
74 | en-US
75 |
76 |
77 |
78 |
79 |
80 | false
81 |
82 | vagrant-2019
83 | Pacific Standard Time
84 |
85 |
86 |
87 | true
88 |
89 |
90 | false
91 | false
92 |
93 |
94 | true
95 |
96 |
97 | true
98 |
99 |
100 |
101 |
102 | 1
103 | Set Execution Policy 64 Bit
104 | cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
105 |
106 |
107 | 2
108 | Set Execution Policy 32 Bit
109 | cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
110 |
111 |
112 |
113 |
114 |
115 |
116 | en-US
117 | en-US
118 | en-US
119 | en-US
120 | en-US
121 |
122 |
123 |
124 |
125 | vagrant
126 | true
127 |
128 | true
129 | vagrant
130 |
131 |
132 |
133 | cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
134 | Set Execution Policy 64 Bit
135 | 1
136 | true
137 |
138 |
139 | C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
140 | Set Execution Policy 32 Bit
141 | 2
142 | true
143 |
144 |
145 | %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f
146 | 4
147 | Show file extensions in Explorer
148 |
149 |
150 | %SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f
151 | 5
152 | Enable QuickEdit mode
153 |
154 |
155 | %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f
156 | 6
157 | Show Run command in Start Menu
158 |
159 |
160 | %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f
161 | 7
162 | Show Administrative Tools in Start Menu
163 |
164 |
165 | %SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f
166 | 8
167 | Zero Hibernation File
168 |
169 |
170 | %SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f
171 | 9
172 | Disable Hibernation Mode
173 |
174 |
175 | cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
176 | 10
177 | Disable password expiration for vagrant user
178 |
179 |
180 | cmd.exe /c a:\microsoft-updates.bat
181 | 98
182 | Enable Microsoft Updates
183 |
184 |
185 | cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\disable-screensaver.ps1
186 | Disable Screensaver
187 | 99
188 | true
189 |
190 |
191 | cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\windows-updates.ps1
192 | Install Windows Updates
193 | 100
194 | true
195 |
196 |
197 | cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1
198 | Fix public network and WinRM
199 | 101
200 | true
201 |
202 |
203 |
204 | true
205 | true
206 | true
207 | true
208 | true
209 | Home
210 | 1
211 |
212 |
213 |
214 | vagrant
215 | true
216 |
217 |
218 |
219 |
220 | vagrant
221 | true
222 |
223 | administrators
224 | Vagrant
225 | vagrant
226 | Vagrant User
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 | false
236 |
237 |
238 |
239 |
--------------------------------------------------------------------------------
/extras/biztalk/BizTalkConfig-DSC-Example.ps1:
--------------------------------------------------------------------------------
1 |
2 | Configuration BizTalkConfig {
3 |
4 | Import-DscResource -ModuleName PSDesiredStateConfiguration, cChoco
5 |
6 | $SqlIsoUrl = "https://s3-eu-west-1.amazonaws.com/freeze/SQLServer2016SP1-FullSlipstream-x64-ENU.iso"
7 | $SqlConfigurationUrl = "https://s3-eu-west-1.amazonaws.com/freeze/ConfigurationFile.ini"
8 | $BizTalkUrl = "http://care.dlservice.microsoft.com/dl/download/6/B/C/6BCBE623-03A5-42AC-95AC-2873B68D10B9/BTS2016Evaluation_EN.iso"
9 | $OdtUrl = "https://download.microsoft.com/download/2/7/A/27AF1BE6-DD20-4CB4-B154-EBAB8A7D4A7E/officedeploymenttool_8529.3600.exe"
10 |
11 | $SqlUser = "Vagrant"
12 | $ParametersPath = "C:\Parameters"
13 | New-Item -ItemType directory -Path $ParametersPath -Force
14 |
15 | $excel = @"
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | "@
38 | Set-Content -path "c:\parameters\excel.xml" -Value $excel
39 |
40 |
41 |
42 | $SqlUser = "$env:computername\$SqlUser"
43 | Set-Content -path "$ParametersPath\sqluser.txt" -Value $SqlUser
44 | Set-Content -path "$ParametersPath\nodename.txt" -Value $env:computername
45 | Set-Content -path "$ParametersPath\odturl.txt" -Value $OdtUrl
46 |
47 | @("Web-Server",
48 | "Web-Http-Errors",
49 | "Web-App-Dev",
50 | "Web-Asp-Net",
51 | "Web-Net-Ext",
52 | "Web-ASP",
53 | "Web-CGI",
54 | "Web-ISAPI-Ext",
55 | "Web-ISAPI-Filter",
56 | "Web-Includes",
57 | "Web-Basic-Auth",
58 | "Web-Windows-Auth",
59 | "Web-Mgmt-Compat",
60 | "Web-Metabase",
61 | "Web-WMI",
62 | "Web-Lgcy-Scripting",
63 | "Web-Lgcy-Mgmt-Console"
64 | )| Add-WindowsFeature
65 |
66 |
67 | Node localhost
68 | {
69 | LocalConfigurationManager
70 | {
71 | RebootNodeIfNeeded = $False
72 | }
73 |
74 | File InstallDir {
75 | DestinationPath = "c:\install"
76 | Ensure = "present"
77 | Type = "Directory"
78 | }
79 |
80 | cChocoInstaller installChoco
81 | {
82 | InstallDir = "c:\choco"
83 | }
84 |
85 | cChocoPackageInstaller notepadplusplus
86 | {
87 | Name = "notepadplusplus"
88 | DependsOn = "[cChocoInstaller]installChoco"
89 | }
90 |
91 |
92 | cChocoPackageInstaller installSumatra
93 | {
94 | Name = "sumatrapdf.install"
95 | DependsOn = "[cChocoInstaller]installChoco"
96 | }
97 |
98 | cChocoPackageInstaller installSoapui
99 | {
100 | Name = "soapui"
101 | DependsOn = "[cChocoInstaller]installChoco"
102 | }
103 |
104 | cChocoPackageInstaller install7zipcommandline
105 | {
106 | Ensure = 'Present'
107 | Name = "7zip.commandline"
108 | DependsOn = "[cChocoInstaller]installChoco"
109 | }
110 |
111 | cChocoPackageInstaller install7zipinstall
112 | {
113 | Name = "7zip.install"
114 | DependsOn = "[cChocoInstaller]installChoco"
115 | }
116 |
117 |
118 | cChocoPackageInstaller installSSMS
119 | {
120 | Name = "install sql-server-management-studio"
121 | Ensure = "present"
122 | Version = "13.0.15000.23"
123 | }
124 |
125 | cChocoPackageInstaller installVisualStudio
126 | {
127 | Name = "install visualstudio2015community"
128 | Ensure = "present"
129 | }
130 |
131 | Script PrepareSQLConfiguration {
132 | GetScript = {
133 | return @{ 'Result' = "PrepareSQLConfiguration" }
134 | }
135 |
136 | TestScript = {
137 | $Result = Test-Path "C:\Install\SQLServer2016SP1-FullSlipstream-x64-ENU.iso"
138 | return $Result
139 | }
140 |
141 | SetScript = {
142 | Invoke-WebRequest -Uri $using:SqlIsoUrl -OutFile C:\install\SQLServer2016SP1-FullSlipstream-x64-ENU.iso
143 | Invoke-WebRequest -Uri $using:SqlConfigurationUrl -OutFile C:\install\configurationfile.ini
144 | $sqluser = get-content c:\parameters\sqluser.txt
145 | (Get-Content c:\install\configurationfile.ini).replace("[ACCOUNT]", $sqluser ) | Set-Content c:\install\myconfigurationFile.ini
146 | }
147 | }
148 |
149 |
150 | Script ExpandSQLIso {
151 | GetScript ={
152 | return @{ 'Result' = "ExpandSQLIso" }
153 | }
154 | SetScript = {
155 | $TempExtractDir = 'c:\Install\SQLInstall'
156 | New-Item -ItemType Directory "$TempExtractDir" -Force
157 | $7zip = "C:\Program Files\7-Zip"
158 | & $7zip\7z.exe x c:\install\SQLServer2016SP1-FullSlipstream-x64-ENU.iso -oc:\install\sqlinstall
159 | Set-Location $TempExtractDir
160 |
161 | }
162 | TestScript = {
163 | Test-Path "c:\install\sqlinstall\setup.exe"
164 | }
165 |
166 | }
167 |
168 |
169 | Script InstallSQLServer2016 {
170 | GetScript = {
171 | return @{ 'Result' = "InstallSQLServer2016" }
172 | }
173 |
174 | TestScript = {
175 | $Result = Test-Path "C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn"
176 | return $Result
177 | }
178 |
179 | SetScript = {
180 | cd c:\install\SQLInstall
181 | .\Setup.exe /ConfigurationFile="c:\Install\MyConfigurationFile.ini"
182 | }
183 | DependsOn = "[Script]ExpandSQLIso"
184 | }
185 |
186 |
187 |
188 | Script InstallOffice2016 {
189 | GetScript = {
190 | return @{ 'OdtUrl' = "$OdtUrl" }
191 | }
192 |
193 | TestScript = {
194 | $Result = Test-Path "C:\Program Files (x86)\Microsoft Office\root\Office16\Excel.exe"
195 | return $Result
196 | }
197 |
198 | SetScript = {
199 | New-Item -ItemType Directory c:\Install\odt -force
200 | Invoke-WebRequest -Uri $using:OdtUrl -OutFile C:\install\officedeploymenttool.exe
201 | Set-Location \install
202 | .\officedeploymenttool.exe /quiet /extract:c:\install
203 | copy-item C:\Parameters\excel.xml -Destination c:\install
204 | $arglist1 = '/download excel.xml'
205 | $arglist2 = '/configure excel.xml'
206 | Start-Process -FilePath c:\install\setup.exe -ArgumentList $arglist1 -Wait -NoNewWindow
207 | Start-Process -FilePath c:\install\setup.exe -ArgumentList $arglist2 -Wait -NoNewWindow
208 | }
209 | }
210 |
211 |
212 |
213 | Script DownloadAndExtractBizTalk {
214 |
215 | GetScript = {
216 | return @{ 'Result' = "Extract BizTalk" }
217 |
218 | }
219 | TestScript = {
220 | $Result = Test-Path "C:\Install\BizTalkInstall\BizTalk Server\Setup.exe"
221 | return $Result
222 | }
223 |
224 | SetScript = {
225 | Invoke-WebRequest -Uri $using:BizTalkUrl -OutFile C:\install\BTS2016Evaluation_EN.iso
226 | $TempExtractDir = 'C:\Install\BizTalkInstall'
227 | New-Item -ItemType Directory "$TempExtractDir" -Force
228 | $7zip = "C:\Program Files\7-Zip"
229 | & $7zip\7z.exe x C:\install\BTS2016Evaluation_EN.iso -oc:\install\biztalkinstall
230 | Set-Location $TempExtractDir
231 | }
232 |
233 | }
234 |
235 |
236 |
237 | Script InstallBizTalk {
238 | GetScript = {
239 | return @{ 'Result' = "InstallBizTalk" }
240 | }
241 |
242 | TestScript = {
243 | Write-Verbose 'Testing Install of BizTalk Server 2016'
244 | $Result = Test-Path "C:\Program Files (x86)\Microsoft BizTalk Server 2016\Configuration.exe"
245 | If ($Result) { Write-Verbose "BizTalk already installed." } else { Write-Verbose "Not in desired state. Installing BizTalk." }
246 | Return $Result
247 | }
248 |
249 | SetScript = {
250 | Write-Verbose 'Installing BizTalk Server 2016'
251 | #some ugly code ensues here.
252 | $biztalkpath = 'C:\Install\BizTalkInstall\BizTalk Server'
253 |
254 | set-location $biztalkpath
255 | $argslist = @"
256 | /quiet /addlocal all /COMPANYNAME 'BizTalkLab' /USERNAME 'BizTalkUser' /L c:\install\BizTalkInstallLog.txt
257 | "@
258 | Start-Process -FilePath "C:\Install\BizTalkInstall\BizTalk Server\Setup.exe" -argumentlist $argslist -wait -NoNewWindow
259 | }
260 | DependsOn = "[Script]DownloadAndExtractBizTalk"
261 | }
262 |
263 | }
264 | }
--------------------------------------------------------------------------------
/extras/biztalk/InstallBizTalk.ps1:
--------------------------------------------------------------------------------
1 | # ugly BizTalk installation script for dev environment on evaluation software
2 | # assuming Vagrant & Choco
3 |
4 | $OdtUrl = "https://download.microsoft.com/download/2/7/A/27AF1BE6-DD20-4CB4-B154-EBAB8A7D4A7E/officedeploymenttool_8529.3600.exe"
5 | $SqlIsoUrl = "https://s3-eu-west-1.amazonaws.com/freeze/SQLServer2016SP1-FullSlipstream-x64-ENU.iso"
6 | $SqlConfigurationUrl = "https://raw.githubusercontent.com/jacqinthebox/biztalkinstall/master/ConfigurationFile.ini"
7 | $BizTalkUrl = "http://care.dlservice.microsoft.com/dl/download/6/B/C/6BCBE623-03A5-42AC-95AC-2873B68D10B9/BTS2016Evaluation_EN.iso"
8 | $SqlUser = "Vagrant"
9 |
10 |
11 | $ParametersPath = "C:\Parameters"
12 | New-Item -ItemType directory -Path $ParametersPath -Force
13 | New-Item -ItemType directory -Path c:\Install -Force
14 |
15 | $SqlUser = "$env:computername\$SqlUser"
16 | Set-Content -path "$ParametersPath\sqluser.txt" -Value $SqlUser
17 | Set-Content -path "$ParametersPath\nodename.txt" -Value $env:computername
18 | Set-Content -path "$ParametersPath\odturl.txt" -Value $OdtUrl
19 |
20 |
21 | choco install sql-server-management-studio -force -yes
22 | choco install visualstudio2015community -force -yes
23 | choco install soapui -force -yes
24 |
25 | # Windows Features
26 | @("Web-Server",
27 | "Web-Http-Errors",
28 | "Web-App-Dev",
29 | "Web-Asp-Net",
30 | "Web-Net-Ext",
31 | "Web-ASP",
32 | "Web-CGI",
33 | "Web-ISAPI-Ext",
34 | "Web-ISAPI-Filter",
35 | "Web-Includes",
36 | "Web-Basic-Auth",
37 | "Web-Windows-Auth",
38 | "Web-Mgmt-Compat",
39 | "Web-Metabase",
40 | "Web-WMI",
41 | "Web-Lgcy-Scripting",
42 | "Web-Lgcy-Mgmt-Console"
43 | )| Add-WindowsFeature
44 |
45 |
46 | # DTC
47 | Install-Dtc
48 | Set-DtcNetworkSetting -InboundTransactionsEnabled:$True -OutboundTransactionsEnabled:$True -AuthenticationLevel:NoAuth -LUTransactionsEnabled:$True -Confirm:$false
49 |
50 | # Excel
51 | $excel = @"
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | "@
74 | Set-Content -path "c:\install\excel.xml" -Value $excel
75 |
76 |
77 | New-Item -ItemType Directory c:\Install\odt -force
78 | Invoke-WebRequest $OdtUrl -OutFile C:\install\officedeploymenttool.exe
79 | Start-Sleep -s 10
80 |
81 | set-location c:\install
82 | $preArglist = '/quiet /extract:c:\install'
83 | Start-Process -FilePath c:\install\officedeploymenttool.exe $preArglist -Wait -NoNewWindow
84 |
85 | $arglist = '/download excel.xml'
86 | Start-Process -FilePath c:\install\setup.exe -ArgumentList $arglist -Wait -NoNewWindow
87 |
88 | set-location c:\install
89 | $arglist = '/configure excel.xml'
90 | Start-Process -FilePath c:\install\setup.exe -ArgumentList $arglist -Wait -NoNewWindow
91 |
92 |
93 | # SQL
94 | $source = $SqlIsoUrl
95 | $dest = "C:\Install\SQLServer2016SP1-FullSlipstream-x64-ENU.iso"
96 | Invoke-WebRequest $source -OutFile $dest
97 |
98 | $source = $SqlConfigurationUrl
99 | $dest = "C:\Install\ConfigurationFile.ini"
100 | Invoke-WebRequest $source -OutFile $dest
101 |
102 | $sqladmin = Get-Content 'c:\sqluser.txt'
103 | (Get-Content c:\install\configurationfile.ini).replace("[ACCOUNT]", $sqladmin ) | Set-Content C:\Install\MyConfigurationFile.ini
104 |
105 | $TempExtractDir = 'C:\Install\SQLInstall'
106 | New-Item -ItemType Directory "$TempExtractDir" -Force
107 | $7zip = "C:\Program Files\7-Zip"
108 | & $7zip\7z.exe x C:\install\SQLServer2016SP1-FullSlipstream-x64-ENU.iso -oc:\install\sqlinstall
109 | Set-Location $TempExtractDir
110 | Start-Process -FilePath c:\install\sqlinstall\setup.exe -ArgumentList '/ConfigurationFile="C:\Install\MyConfigurationFile.ini"' -Wait -NoNewWindow
111 |
112 | # BizTalk
113 | # download
114 | Invoke-WebRequest -Uri $BizTalkUrl -OutFile C:\install\BTS2016Evaluation_EN.iso
115 |
116 | $TempExtractDir = 'C:\Install\BizTalkInstall'
117 | New-Item -ItemType Directory "$TempExtractDir" -Force
118 |
119 | $7zip = "C:\Program Files\7-Zip"
120 | & $7zip\7z.exe x C:\install\BTS2016Evaluation_EN.iso -oc:\install\biztalkinstall
121 | Set-Location $TempExtractDir
122 |
123 | $argslist = @"
124 | /quiet /addlocal all /COMPANYNAME 'BizTalkLab' /USERNAME 'BizTalkUser' /L c:\install\BizTalkInstallLog.txt
125 | "@
126 | Start-Process -FilePath "$biztalkpath\setup.exe" -argumentlist $argslist -wait -NoNewWindow
--------------------------------------------------------------------------------
/extras/biztalk/Vagrantfile:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | $devenv = <<'DEVENV'
5 | $script = ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/jacqinthebox/packer-templates/master/extras/devmachine/install-extra.ps1')) | Invoke-Expression
6 | Add-Software -InstallVisualStudio $False
7 | DEVENV
8 |
9 | $devenv = <<'BIZTALK'
10 | $script = ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/jacqinthebox/packer-templates/master/extras/biztalk/InstallBizTalk.ps1')) | Invoke-Expression
11 | BIZTALK
12 |
13 | Vagrant.configure(2) do |config|
14 | config.vm.define "lab01"
15 | config.vm.box = "jacqinthebox/windowsserver2016"
16 | config.vm.hostname = "lab01"
17 | config.vm.communicator = "winrm"
18 | config.vm.guest = :windows
19 | config.winrm.username = "vagrant"
20 | config.winrm.password = "vagrant"
21 | config.vm.network "forwarded_port", guest: 3389, host: 13389, auto_correct: true
22 | config.vm.network "forwarded_port", guest: 5985, host: 15985, id: "winrm", auto_correct:true
23 |
24 | config.vm.provider 'parallels' do |prl|
25 | prl.linked_clone = true
26 | end
27 |
28 | config.vm.provider "virtualbox" do |v|
29 | v.linked_clone = true
30 | end
31 |
32 | config.vm.provision :shell, :inline => $devenv
33 | config.vm.provision :shell, :inline => $biztalk
34 |
35 | end
36 |
--------------------------------------------------------------------------------
/extras/devmachine/Meslo LG M DZ Regular for Powerline.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jacqinthebox/packer-templates/679be23ded8bff35ee86031cc1a192501aa75a76/extras/devmachine/Meslo LG M DZ Regular for Powerline.ttf
--------------------------------------------------------------------------------
/extras/devmachine/Vagrantfile:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | $devenv = <<'DEVENV'
5 | $script = ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/jacqinthebox/packer-templates/master/extras/devmachine/install-extra.ps1')) | Invoke-Expression
6 | DEVENV
7 |
8 | Vagrant.configure("2") do |config|
9 | config.vm.define "lab01" do |lab01_config|
10 | lab01_config.vm.box = "windows10"
11 | #lab01_config.vm.box = "jacqinthebox/windowsserver2016"
12 |
13 | lab01_config.vm.network "forwarded_port", guest: 3389, host: 13389, auto_correct: true
14 | lab01_config.vm.network "forwarded_port", guest: 5985, host: 15985, id: "winrm", auto_correct:true
15 | #config.vm.network "private_network", ip: "192.168.56.60"
16 |
17 | lab01_config.vm.provider "parallels" do |p|
18 | p.name = "lab01"
19 | p.memory = "4096"
20 | p.cpus = 2
21 | p.linked_clone = true
22 | p.update_guest_tools = true
23 | end
24 | lab01_config.vm.provider "virtualbox" do |v|
25 | v.linked_clone = true
26 | v.linked_clone = true
27 | v.customize ["modifyvm", :id, "--vram", "128"]
28 | v.customize ["modifyvm", :id, "--accelerate3d", "on"]
29 | end
30 | end
31 |
32 | config.vm.define "lab02" do |lab02_config|
33 | lab02_config.vm.box = "windows10"
34 | #lab02_config.vm.box = "jacqinthebox/windowsserver2016"
35 | lab02_config.vm.provider "parallels" do |p|
36 | p.name = "lab02"
37 | p.memory = "4096"
38 | p.cpus = 2
39 | p.linked_clone = true
40 | p.update_guest_tools = true
41 | end
42 |
43 | lab02_config.vm.provider "virtualbox" do |v|
44 | v.linked_clone = true
45 | v.linked_clone = true
46 | v.customize ["modifyvm", :id, "--vram", "128"]
47 | v.customize ["modifyvm", :id, "--accelerate3d", "on"]
48 | end
49 | end
50 | config.vm.provision :shell, :inline => $devenv
51 | end
52 |
--------------------------------------------------------------------------------
/extras/devmachine/bare.ps1:
--------------------------------------------------------------------------------
1 | # Set-ExecutionPolicy RemoteSigned -Confirm:$false -Force
2 | Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression
3 | Install-PackageProvider -Name Nuget -Force
4 |
5 | $software = @(
6 | 'googlechrome',
7 | 'firefox'
8 | )
9 |
10 |
11 | foreach ($s in $software) {
12 | choco install $s -yes
13 | }
14 |
15 | Install-Module posh-git -Scope CurrentUser -Force
16 | Install-Module oh-my-posh -Scope CurrentUser -Force
17 |
18 | Invoke-WebRequest https://github.com/jacqinthebox/packer-templates/blob/master/extras/devmachine/Meslo%20LG%20M%20DZ%20Regular%20for%20Powerline.ttf?raw=true -OutFile ~\Desktop\Meslo.ttf
19 |
--------------------------------------------------------------------------------
/extras/devmachine/install-extra.ps1:
--------------------------------------------------------------------------------
1 | # Set-ExecutionPolicy RemoteSigned -Confirm:$false -Force
2 | Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression
3 | Install-PackageProvider -Name Nuget -Force
4 |
5 | $software = @(
6 | 'visualstudiocode',
7 | 'git',
8 | 'conemu',
9 | 'googlechrome',
10 | 'notepadplusplus',
11 | 'az-cli',
12 | 'terraform',
13 | 'kubernetes-helm',
14 | 'kubernetes-cli',
15 | 'firefox',
16 | 'winscp',
17 | 'putty'
18 | )
19 |
20 |
21 | foreach ($s in $software) {
22 | choco install $s -yes
23 | }
24 |
25 | Install-Module posh-git -Scope CurrentUser -Force
26 | Install-Module oh-my-posh -Scope CurrentUser -Force
27 |
28 | Invoke-WebRequest https://github.com/jacqinthebox/packer-templates/blob/master/extras/devmachine/Meslo%20LG%20M%20DZ%20Regular%20for%20Powerline.ttf?raw=true -OutFile ~\Desktop\Meslo.ttf
29 |
--------------------------------------------------------------------------------
/extras/devmachine/install-minimal.ps1:
--------------------------------------------------------------------------------
1 | # Set-ExecutionPolicy RemoteSigned -Confirm:$false -Force
2 | Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression
3 | Install-PackageProvider -Name Nuget -Force
4 |
5 | $software = @(
6 | 'git',
7 | 'googlechrome',
8 | 'notepadplusplus',
9 | 'firefox',
10 | 'conemu',
11 | 'keepass',
12 | 'keybase',
13 | 'joplin',
14 | 'vscode'
15 | )
16 |
17 | foreach ($s in $software) {
18 | choco install $s -yes
19 | }
20 |
--------------------------------------------------------------------------------
/extras/ubuntu/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #Install Ubuntu 17.10 Desktop
3 |
4 | ##Init
5 | green=`tput setaf 2`
6 | echo "${green} updating system and installing essential software"
7 |
8 | # install essentials
9 | sudo apt-get install -y wget curl git gitk vim-nox chromium-browser build-essential linux-headers-$(uname -r) gparted nautilus-dropbox gdebi shutter gnome-tweak-tool
10 | sudo apt-get install keepass2 -y
11 | sudo apt-get install libunwind8 -y
12 |
13 | # install .net core
14 | sudo apt-get install -y dotnet-sdk-2.0.2
15 |
16 | mkdir ~/gitrepos
17 | cd gitrepos
18 | git clone https://github.com/powerline/fonts.git
19 | cd fonts
20 | ./install.sh
21 | echo "${green} Change the font in the terminal profile!"
22 |
23 | echo "${green} Node.js and npm fix"
24 | curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
25 | sudo apt-get install -y nodejs
26 |
27 | mkdir ~/npm-global -p
28 | echo "${green} setting permissions on new npm-global folder for $USER"
29 | sudo chown -R $USER:$USER ~/npm-global
30 | npm config set prefix '~/npm-global'
31 |
32 | #Open or create a ~/.profile file and add this line:
33 | echo "export PATH=~/npm-global/bin:$PATH" >> ~/.profile
34 | source ~/.profile
35 |
36 | #Docker
37 | curl -O https://download.docker.com/linux/ubuntu/dists/zesty/pool/stable/amd64/docker-ce_17.09.0\~ce-0\~ubuntu_amd64.deb
38 | sudo dpkg -i docker-ce_17.09.0\~ce-0\~ubuntu_amd64.deb
39 |
40 | #Fix sudo
41 | sudo usermod -aG docker $USER
42 | # Need to logout
43 |
44 |
45 |
46 | # install theme
47 | sudo apt-get install -y arc-theme
48 | sudo add-apt-repository ppa:noobslab/icons -y
49 | sudo add-apt-repository ppa:numix/ppa -y
50 | sudo apt-get update
51 | sudo apt-get install numix-icon-theme-circle -y
52 | sudo apt-get install -y ultra-flat-icons ultra-flat-icons-green ultra-flat-icons-orange
53 |
54 | echo "${green} installing and configuring zsh and oh-my-zsh"
55 | sudo apt-get install zsh git-core -y
56 | wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
57 | chsh -s `which zsh`
58 | git clone https://github.com/powerline/fonts.git
59 | cd fonts
60 | ./install.sh
61 | cd ..
62 | rm -rf fonts
63 |
64 | sed -i -e 's/agnoster/robbyrussel/g' ~/.zshrc
65 | echo "DEFAULT_USER="\""$USER"\""" >> ~/.zshrc
66 |
67 | echo "${green} configuring vim and enabling pathogen"
68 | mkdir -p ~/.vim/autoload ~/.vim/bundle && curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
69 | cd ~/.vim/bundle
70 | git clone https://github.com/scrooloose/nerdtree.git
71 | git clone https://github.com/Valloric/MatchTagAlways.git
72 | git clone https://github.com/ctrlpvim/ctrlp.vim.git
73 | git clone https://github.com/vim-airline/vim-airline ~/.vim/bundle/vim-airline
74 | git clone https://github.com/vim-airline/vim-airline-themes ~/.vim/bundle/vim-airline-themes
75 | git clone https://github.com/lukaszb/vim-web-indent.git
76 | git clone https://github.com/hashivim/vim-vagrant.git
77 | git clone https://github.com/altercation/vim-colors-solarized.git
78 | cd ~
79 | git clone https://github.com/flazz/vim-colorschemes.git
80 | cd vim-colorschemes
81 | mv colors ~/.vim/colors
82 | rm ~/vim-colorschemes -rf
83 |
84 | echo "${green} copying the vimrc"
85 | wget -O .vimrc http://files.in-the-box.nl/vimrc.txt
86 |
87 | echo "${green} git user config:"
88 | git config --global user.name $USER
89 | git config --global user.email $USER@$HOSTNAME.nl
90 |
91 | echo "${green} to add key to Github:"
92 | echo "${green} ssh-keygen -t rsa"
93 | echo "${green} xclip -sel clip < ~/.ssh/id_rsa.pub
94 |
--------------------------------------------------------------------------------
/extras/ubuntu/kube.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | #
3 | sudo apt-get update && sudo apt-get install -y apt-transport-https
4 | curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
5 | echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
6 | sudo apt-get update
7 | sudo apt-get install -y kubectl
8 |
9 | curl -L https://git.io/get_helm.sh | bash
10 |
11 | source <(kubectl completion bash) # setup autocomplete in bash into the current shell, bash-completion package should be installed first.
12 | echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell.
13 |
14 | cd $HOME && printf '"# Fix the use of keyboard arrows in vim. \n:set term=builtin_ansi' >> .vimrc
15 |
--------------------------------------------------------------------------------
/scripts/bootstrap.ps1:
--------------------------------------------------------------------------------
1 | # This script is called from the answerfile
2 |
3 | # You cannot enable Windows PowerShell Remoting on network connections that are set to Public
4 | # http://msdn.microsoft.com/en-us/library/windows/desktop/aa370750(v=vs.85).aspx
5 | # http://blogs.msdn.com/b/powershell/archive/2009/04/03/setting-network-location-to-private.aspx
6 |
7 | Write-Host "Copy unattend.xml to C:\Windows\Panther\Unattend\"
8 | New-Item C:\Windows\Panther\Unattend -Type Directory
9 | New-Item c:\Logs -Type Directory
10 | New-Item c:\Scripts -Type Directory
11 | Copy-Item a:\unattend.xml C:\Windows\Panther\Unattend\
12 |
13 | Write-Host "Copy Oracle root certificate and add to trusted publishers (for guest additions installation)"
14 | Copy-Item a:\oracle.cer c:\Scripts
15 | certutil -addstore -f "TrustedPublisher" c:\Scripts\oracle.cer
16 |
17 | # Get network connections
18 | $networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]'{DCB00C01-570F-4A9B-8D69-199FDBA5723B}'))
19 | $connections = $networkListManager.GetNetworkConnections()
20 |
21 | $connections |foreach {
22 | Write-Host "Setting network config"
23 | $_.GetNetwork().GetName() + 'category was previously set to' + $_.GetNetwork().GetCategory() | Out-File c:\logs\logfile.txt
24 | $_.GetNetwork().SetCategory(1)
25 | $_.GetNetwork().GetName() + 'change to ' + $_.GetNetwork().GetCategory() | Out-File C:\Logs\logfile.txt -Append
26 | }
27 |
28 | Function Enable-WinRM {
29 | Write-Host "Enable WinRM"
30 | netsh advfirewall firewall set rule group="remote administration" new enable=yes
31 | netsh advfirewall firewall add rule name="Open Port 5985" dir=in action=allow protocol=TCP localport=5985
32 |
33 | winrm quickconfig -q
34 | winrm quickconfig -transport:http
35 | winrm set winrm/config '@{MaxTimeoutms="7200000"}'
36 | winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'
37 | winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}'
38 | winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}'
39 | winrm set winrm/config/service '@{AllowUnencrypted="true"}'
40 | winrm set winrm/config/service/auth '@{Basic="true"}'
41 | winrm set winrm/config/client/auth '@{Basic="true"}'
42 |
43 | net stop winrm
44 | sc.exe config winrm start= auto
45 | net start winrm
46 |
47 | }
48 |
49 | Get-WmiObject -Class Win32_UserAccount -Filter "name = 'vagrant'" | Set-WmiInstance -Arguments @{PasswordExpires = 0 }
50 | Enable-WinRM
51 |
--------------------------------------------------------------------------------
/scripts/oracle.cer:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIFNzCCBB+gAwIBAgIQBTCLdqwuFbKXIPtDlfZfODANBgkqhkiG9w0BAQUFADBv
3 | MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
4 | d3cuZGlnaWNlcnQuY29tMS4wLAYDVQQDEyVEaWdpQ2VydCBBc3N1cmVkIElEIENv
5 | ZGUgU2lnbmluZyBDQS0xMB4XDTE5MDMxOTAwMDAwMFoXDTIyMDMyMzEyMDAwMFow
6 | gYIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEXMBUGA1UEBxMOUmVkd29vZCBT
7 | aG9yZXMxGzAZBgNVBAoTEk9yYWNsZSBDb3Jwb3JhdGlvbjETMBEGA1UECxMKVmly
8 | dHVhbGJveDEbMBkGA1UEAxMST3JhY2xlIENvcnBvcmF0aW9uMIIBIjANBgkqhkiG
9 | 9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtqeTgikxn1Dwcv2BY6K+LyCOciwaMraBGXkY
10 | VbhdOSkyySP5EUm798iHgU1cj/yKS1e2c0YOJnVZlTeAzyGZp9TiVO4HPNO2Q0cN
11 | wsNI8uLRChzfD0BqKvmhZyNC/shn8btp4HJ2VeaUiHzl+B7419nUXcL1gqW1Kpo1
12 | Jow98BHx59+TR90/47cR5C+6SDbjEcY2qVWmqN1QQmQtmKxFtuPRx6KQ0SRDwpDZ
13 | UcqdaLgFAwQxOrMCYDePRglf57KJhJlL4KevHOw3HutKIm/XlikyWSgDdZEzt4Yz
14 | y4GZeYyD2AYG7Pk4jSe5f4/TT5V54pz7EhrVPp1WhPwPTS/tGwIDAQABo4IBuTCC
15 | AbUwHwYDVR0jBBgwFoAUe2jOKarAF75JeuHlP9an90WPNTIwHQYDVR0OBBYEFFgK
16 | RlPhddNuWHAgJkHhRvQy83XOMA4GA1UdDwEB/wQEAwIHgDATBgNVHSUEDDAKBggr
17 | BgEFBQcDAzBtBgNVHR8EZjBkMDCgLqAshipodHRwOi8vY3JsMy5kaWdpY2VydC5j
18 | b20vYXNzdXJlZC1jcy1nMS5jcmwwMKAuoCyGKmh0dHA6Ly9jcmw0LmRpZ2ljZXJ0
19 | LmNvbS9hc3N1cmVkLWNzLWcxLmNybDBMBgNVHSAERTBDMDcGCWCGSAGG/WwDATAq
20 | MCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2VydC5jb20vQ1BTMAgGBmeB
21 | DAEEATCBggYIKwYBBQUHAQEEdjB0MCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5k
22 | aWdpY2VydC5jb20wTAYIKwYBBQUHMAKGQGh0dHA6Ly9jYWNlcnRzLmRpZ2ljZXJ0
23 | LmNvbS9EaWdpQ2VydEFzc3VyZWRJRENvZGVTaWduaW5nQ0EtMS5jcnQwDAYDVR0T
24 | AQH/BAIwADANBgkqhkiG9w0BAQUFAAOCAQEAPOD9kFcXdfjc5nfZeM2NJ3CSfXnx
25 | PlfQAT5Vq5CKJpyYS19MmzNMx9ejcCuhNs0xtAQ5CEx8IbhWBwFBaVQOMMKbcDxY
26 | H862qqwicxUHGE33PlrxDlonrggO6TmqL8t8ihbukfVAFeWIOwJn1Ng9YTVJLRhF
27 | eifqP2vzn66SA/6I2wGHP0m3kJi/nnrE/S9Qzu7dv+2xFeZoIeeFZ1skOxmYQi0x
28 | uzC+M5iSziFD3tr5BJa9Rvl1Uc28SVtqRS53qDSv6fn1LRhFns4WUZadZtb76Gij
29 | 61pEPzzvppViVwqbGAC66BhscTdm4ZYFCZazK9fn7/xxnBhZeEkgkWpypQ==
30 | -----END CERTIFICATE-----
--------------------------------------------------------------------------------
/scripts/tools_and_stuff.ps1:
--------------------------------------------------------------------------------
1 | # add your customizations here in this script.
2 | # e.g. install Chocolatey
3 | if (Test-Path "$env:windir\explorer.exe") {
4 | Invoke-Webrequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression
5 | }
6 |
7 | # adding a syscrep script to c:\scripts. This will set the winrm service to start manually
8 | # https://github.com/mwrock/packer-templates/issues/49
9 | Write-Host "Add sysprep script to c:\scripts to call when Packer performs a shutdown."
10 | $SysprepCmd = @"
11 | sc config winrm start=demand
12 | C:/windows/system32/sysprep/sysprep.exe /generalize /oobe /unattend:C:/Windows/Panther/Unattend/unattend.xml /quiet /shutdown
13 | "@
14 |
15 | Set-Content -path "C:\Scripts\sysprep.cmd" -Value $SysprepCmd
16 |
17 | # we need to set the winrm service to auto upon first boot
18 | # https://technet.microsoft.com/en-us/library/cc766314(v=ws.10).aspx
19 | $SetupComplete = @"
20 | cmd.exe /c sc config winrm start= auto
21 | cmd.exe /c net start winrm
22 | "@
23 |
24 | New-Item -Path 'C:\Windows\Setup\Scripts' -ItemType Directory -Force
25 | Set-Content -path "C:\Windows\Setup\Scripts\SetupComplete.cmd" -Value $SetupComplete
26 |
27 | # rearm script to exend the trial
28 | Write-Host "Add rearm script to desktop and c:\scripts to extend the trial."
29 | $rearmCmd = @"
30 | slmgr -rearm
31 | pause
32 | "@
33 |
34 | Set-Content -path "C:\Scripts\extend-trial.cmd" -Value $RearmCmd
35 | if (Test-Path "$env:windir\explorer.exe") {
36 | Set-Content -path "C:\Users\Vagrant\Desktop\extend-trial.cmd" -Value $RearmCmd
37 | }
38 |
39 | # Installing Guest Additions or Parallels tools
40 | Write-Host 'Installing Guest Additions or Parallels Tools'
41 |
42 | if (Test-Path d:\VBoxWindowsAdditions.exe) {
43 | Write-Host "Mounting Drive with VBoxWindowsAdditions"
44 | & d:\VBoxWindowsAdditions.exe /S
45 | Write-Host "Sleeping for 60 seconds so we are sure the tools are installed before reboot"
46 | Start-Sleep -s 60
47 | }
48 | if (Test-Path e:\VBoxWindowsAdditions.exe) {
49 | Write-Host "Mounting Drive with VBoxWindowsAdditions"
50 | & E:\VBoxWindowsAdditions.exe /S
51 | Write-Host "Sleeping for 60 seconds so we are sure the tools are installed before reboot"
52 | Start-Sleep -s 60
53 | }
54 |
55 | if (Test-Path c:\users\vagrant\prl-tools-win.iso) {
56 | Write-Host "Mounting Drive with Parallels Tools"
57 | $volume = Mount-DiskImage -PassThru C:\Users\vagrant\prl-tools-win.iso
58 | $drive = (Get-Volume -DiskImage $volume).DriveLetter
59 | $letter = $drive + ":"
60 | Write-Host "Installing tools"
61 | & $letter\PTAGENT.EXE /install_silent
62 | Write-Host "Sleeping for 60 seconds so we are sure the tools are installed before reboot"
63 | Start-Sleep -s 60
64 | }
65 |
--------------------------------------------------------------------------------
/scripts/unattend.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 1
6 |
7 |
8 | false
9 | false
10 |
11 |
12 |
13 |
14 | en-US
15 | en-US
16 | en-US
17 | en-US
18 |
19 |
20 |
21 | true
22 | 1
23 | true
24 |
25 | UTC
26 |
27 |
28 | dgBhAGcAcgBhAG4AdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=
29 | false
30 |
31 |
32 |
33 |
34 | dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA
35 | false
36 |
37 | administrators
38 | Vagrant
39 | vagrant
40 | Vagrant User
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | vagrant-2016
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/scripts/windows-base.ps1:
--------------------------------------------------------------------------------
1 | Write-Host "Enabling RDP, reset SysprepStatus and show file extensions"
2 |
3 | netsh advfirewall firewall add rule name="Remote Desktop" dir=in localport=3389 protocol=TCP action=allow
4 | reg add 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server' /v fDenyTSConnections /t REG_DWORD /d 0 /f
5 | Set-ItemProperty -Path 'HKLM:\SYSTEM\Setup\Status\SysprepStatus' -Name 'GeneralizationState' -Value 7
6 | Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'HideFileExt' -Value 0
7 | Set-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\UnattendBackup\ActiveSetup\DisableFirstRunWizard" -Name DisableFirstRunWizard -Value 1
8 |
9 |
--------------------------------------------------------------------------------
/scripts/windows-compress.ps1:
--------------------------------------------------------------------------------
1 | Write-Host "Cleaning updates.."
2 | Stop-Service -Name wuauserv -Force
3 | Remove-Item c:\Windows\SoftwareDistribution\Download\* -Recurse -Force
4 | Start-Service -Name wuauserv
5 |
6 | Write-Host "defragging..."
7 | if (Get-Command Optimize-Volume -ErrorAction SilentlyContinue) {
8 | Optimize-Volume -DriveLetter C
9 | } else {
10 | Defrag.exe c: /H
11 | }
12 |
13 | Write-Host "0ing out empty space..."
14 | $FilePath="c:\zero.tmp"
15 | $Volume = Get-WmiObject win32_logicaldisk -filter "DeviceID='C:'"
16 | $ArraySize= 64kb
17 | $SpaceToLeave= $Volume.Size * 0.05
18 | $FileSize= $Volume.FreeSpace - $SpacetoLeave
19 | $ZeroArray= new-object byte[]($ArraySize)
20 |
21 | $Stream= [io.File]::OpenWrite($FilePath)
22 | try {
23 | $CurFileSize = 0
24 | while($CurFileSize -lt $FileSize) {
25 | $Stream.Write($ZeroArray,0, $ZeroArray.Length)
26 | $CurFileSize +=$ZeroArray.Length
27 | }
28 | }
29 | finally {
30 | if($Stream) {
31 | $Stream.Close()
32 | }
33 | }
34 |
35 | Del $FilePath
36 |
--------------------------------------------------------------------------------
/scripts/windows-updates.ps1:
--------------------------------------------------------------------------------
1 | Install-PackageProvider -Name Nuget -Force
2 | Install-Module PSWindowsUpdate -Force
3 | Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d -Confirm:$False
--------------------------------------------------------------------------------
/templates/vagrantfile-windows-2016-core.template:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | Vagrant.configure(2) do |config|
5 | config.vm.guest = :windows
6 | config.vm.communicator = "winrm"
7 |
8 | config.vm.provider "virtualbox" do |vb|
9 | vb.gui = true
10 | vb.memory = "1024"
11 | end
12 |
13 | end
14 |
--------------------------------------------------------------------------------
/templates/vagrantfile-windows-2016.template:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | Vagrant.require_version ">= 1.6.2"
5 |
6 | Vagrant.configure("2") do |config|
7 | config.vm.define "vagrant-windows-2016"
8 | config.vm.box = "windows_2016"
9 | config.vm.communicator = "winrm"
10 |
11 | # Admin user name and password
12 | config.winrm.username = "vagrant"
13 | config.winrm.password = "vagrant"
14 |
15 | config.vm.guest = :windows
16 | config.windows.halt_timeout = 15
17 |
18 |
19 | config.vm.provider :virtualbox do |v, override|
20 | v.gui = true
21 | v.customize ["modifyvm", :id, "--memory", 2048]
22 | v.customize ["modifyvm", :id, "--cpus", 1]
23 | v.customize ["modifyvm", :id, "--vram", 128]
24 | v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
25 | end
26 |
27 | end
28 |
--------------------------------------------------------------------------------
/templates/vagrantfile-windows-2019.template:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | Vagrant.require_version ">= 1.6.2"
5 |
6 | Vagrant.configure("2") do |config|
7 | config.vm.define "vagrant-windows-2019"
8 | config.vm.box = "windows_2019"
9 | config.vm.communicator = "winrm"
10 |
11 | # Admin user name and password
12 | config.winrm.username = "vagrant"
13 | config.winrm.password = "vagrant"
14 |
15 | config.vm.guest = :windows
16 | config.windows.halt_timeout = 15
17 |
18 |
19 | config.vm.provider :virtualbox do |v, override|
20 | v.gui = true
21 | v.customize ["modifyvm", :id, "--memory", 4096]
22 | v.customize ["modifyvm", :id, "--cpus", 1]
23 | v.customize ["modifyvm", :id, "--vram", 128]
24 | v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
25 | end
26 |
27 | end
28 |
--------------------------------------------------------------------------------
/templates/vagrantfile-windows_10.template:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | Vagrant.require_version ">= 1.6.2"
5 |
6 | Vagrant.configure("2") do |config|
7 | config.vm.define "vagrant-windows-10-ltsc"
8 | config.vm.box = "windows_10_ltsc"
9 | config.vm.communicator = "winrm"
10 |
11 | # Admin user name and password
12 | config.winrm.username = "vagrant"
13 | config.winrm.password = "vagrant"
14 | config.vm.guest = :windows
15 | config.windows.halt_timeout = 15
16 |
17 | config.vm.provider :virtualbox do |v, override|
18 | v.gui = true
19 | v.customize ["modifyvm", :id, "--memory", 4092]
20 | v.customize ["modifyvm", :id, "--cpus", 1]
21 | v.customize ["modifyvm", :id, "--vram", 128]
22 | v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
23 | v.customize ["modifyvm", :id, "--vrde", "off"]
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/virtualbox_windows_10_1_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "builders": [
3 | {
4 | "communicator": "winrm",
5 | "floppy_files": [
6 | "answer_files/10/Autounattend.xml",
7 | "./scripts/bootstrap.ps1",
8 | "./scripts/oracle.cer",
9 | "./scripts/unattend.xml"
10 | ],
11 | "guest_additions_mode": "disable",
12 | "guest_os_type": "Windows10_64",
13 | "headless": true,
14 | "iso_checksum": "{{user `iso_checksum_type`}}:{{user `iso_checksum`}}",
15 | "iso_url": "{{ user `iso_url` }}",
16 | "output_directory": "./output-win10-base/",
17 | "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
18 | "shutdown_timeout": "15m",
19 | "type": "virtualbox-iso",
20 | "vboxmanage": [
21 | [
22 | "modifyvm",
23 | "{{.Name}}",
24 | "--natpf1",
25 | "guest_winrm,tcp,,55985,,5985"
26 | ],
27 | [
28 | "modifyvm",
29 | "{{.Name}}",
30 | "--memory",
31 | "4096"
32 | ],
33 | [
34 | "modifyvm",
35 | "{{.Name}}",
36 | "--vram",
37 | "128"
38 | ],
39 | [
40 | "modifyvm",
41 | "{{.Name}}",
42 | "--cpus",
43 | "1"
44 | ]
45 | ],
46 | "vm_name": "win10-base",
47 | "winrm_password": "vagrant",
48 | "winrm_timeout": "8h",
49 | "winrm_username": "vagrant"
50 | }
51 | ],
52 | "provisioners": [
53 | {
54 | "elevated_password": "vagrant",
55 | "elevated_user": "vagrant",
56 | "script": "./scripts/windows-base.ps1",
57 | "type": "powershell"
58 | }
59 | ],
60 | "variables": {
61 | "autounattend": "./answer_files/10/Autounattend.xml",
62 | "iso_checksum": "b254ba13c50d777e4776a98684e11e11",
63 | "iso_checksum_type": "md5",
64 | "iso_url": "https://software-download.microsoft.com/download/sg/17763.107.101029-1455.rs5_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso"
65 | }
66 | }
67 |
68 |
--------------------------------------------------------------------------------
/virtualbox_windows_10_2_updates.json:
--------------------------------------------------------------------------------
1 | {
2 | "builders": [
3 | {
4 | "communicator": "winrm",
5 | "guest_additions_mode": "disable",
6 | "headless": false,
7 | "output_directory": "./output-win10-updates/",
8 | "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
9 | "shutdown_timeout": "1h",
10 | "source_path": "./output-win10-base/win10-base.ovf",
11 | "type": "virtualbox-ovf",
12 | "vboxmanage": [
13 | [
14 | "modifyvm",
15 | "{{.Name}}",
16 | "--memory",
17 | "4096"
18 | ],
19 | [
20 | "modifyvm",
21 | "{{.Name}}",
22 | "--vram",
23 | "128"
24 | ],
25 | [
26 | "modifyvm",
27 | "{{.Name}}",
28 | "--cpus",
29 | "1"
30 | ]
31 | ],
32 | "vm_name": "win10-updates",
33 | "winrm_password": "vagrant",
34 | "winrm_timeout": "12h",
35 | "winrm_username": "vagrant"
36 | }
37 | ],
38 | "provisioners": [
39 | {
40 | "elevated_password": "vagrant",
41 | "elevated_user": "vagrant",
42 | "script": "./scripts/windows-updates.ps1",
43 | "type": "powershell"
44 | },
45 | {
46 | "restart_timeout": "1h",
47 | "type": "windows-restart"
48 | },
49 | {
50 | "elevated_password": "vagrant",
51 | "elevated_user": "vagrant",
52 | "inline": [
53 | "Get-WUInstall -MicrosoftUpdate -AcceptAll -Download -Install -IgnoreReboot"
54 | ],
55 | "type": "powershell"
56 | },
57 | {
58 | "restart_timeout": "1h",
59 | "type": "windows-restart"
60 | },
61 | {
62 | "elevated_password": "vagrant",
63 | "elevated_user": "vagrant",
64 | "inline": [
65 | "Get-WUInstall -MicrosoftUpdate -AcceptAll -Download -Install -IgnoreReboot"
66 | ],
67 | "type": "powershell"
68 | },
69 | {
70 | "restart_timeout": "1h",
71 | "type": "windows-restart"
72 | },
73 | {
74 | "elevated_password": "vagrant",
75 | "elevated_user": "vagrant",
76 | "inline": [
77 | "Get-WUInstall -MicrosoftUpdate -AcceptAll -Download -Install -IgnoreReboot"
78 | ],
79 | "type": "powershell"
80 | },
81 | {
82 | "restart_timeout": "1h",
83 | "type": "windows-restart"
84 | }
85 | ]
86 | }
87 |
88 |
--------------------------------------------------------------------------------
/virtualbox_windows_10_3_package.json:
--------------------------------------------------------------------------------
1 | {
2 | "builders": [
3 | {
4 | "communicator": "winrm",
5 | "floppy_files": [
6 | "./scripts/oracle.cer"
7 | ],
8 | "guest_additions_mode": "attach",
9 | "headless": true,
10 | "output_directory": "./output-win10-package/",
11 | "shutdown_command": "C:/Scripts/sysprep.cmd",
12 | "shutdown_timeout": "1h",
13 | "source_path": "./output-win10-updates/win10-updates.ovf",
14 | "type": "virtualbox-ovf",
15 | "vboxmanage": [
16 | [
17 | "modifyvm",
18 | "{{.Name}}",
19 | "--memory",
20 | "4096"
21 | ],
22 | [
23 | "modifyvm",
24 | "{{.Name}}",
25 | "--vram",
26 | "128"
27 | ],
28 | [
29 | "modifyvm",
30 | "{{.Name}}",
31 | "--cpus",
32 | "1"
33 | ]
34 | ],
35 | "vm_name": "win10-package",
36 | "winrm_password": "vagrant",
37 | "winrm_timeout": "12h",
38 | "winrm_username": "vagrant"
39 | }
40 | ],
41 | "post-processors": [
42 | {
43 | "keep_input_artifact": true,
44 | "output": "windows10_vbox.box",
45 | "type": "vagrant",
46 | "vagrantfile_template": "./templates/vagrantfile-windows_10.template"
47 | }
48 | ],
49 | "provisioners": [
50 | {
51 | "elevated_password": "vagrant",
52 | "elevated_user": "vagrant",
53 | "script": "./scripts/tools_and_stuff.ps1",
54 | "type": "powershell"
55 | },
56 | {
57 | "restart_timeout": "1h",
58 | "type": "windows-restart"
59 | },
60 | {
61 | "elevated_password": "vagrant",
62 | "elevated_user": "vagrant",
63 | "script": "./scripts/windows-compress.ps1",
64 | "type": "powershell"
65 | }
66 | ]
67 | }
68 |
69 |
--------------------------------------------------------------------------------
/virtualbox_windows_server_2016_1_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "builders": [
3 | {
4 | "type": "virtualbox-iso",
5 | "output_directory": "./output-base/",
6 | "vboxmanage": [
7 | [
8 | "modifyvm",
9 | "{{.Name}}",
10 | "--memory",
11 | "2048"
12 | ],
13 | [
14 | "modifyvm",
15 | "{{.Name}}",
16 | "--vram",
17 | "128"
18 | ],
19 | [
20 | "modifyvm",
21 | "{{.Name}}",
22 | "--cpus",
23 | "1"
24 | ]
25 | ],
26 | "vm_name": "vbox-base",
27 | "guest_additions_mode": "disable",
28 | "guest_os_type": "Windows2012_64",
29 | "iso_url": "{{ user `iso_url` }}",
30 | "iso_checksum_type": "{{user `iso_checksum_type`}}",
31 | "iso_checksum": "{{user `iso_checksum`}}",
32 | "disk_size": "60000",
33 | "headless": true,
34 | "communicator": "winrm",
35 | "winrm_username": "vagrant",
36 | "winrm_password": "vagrant",
37 | "winrm_timeout": "8h",
38 | "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
39 | "shutdown_timeout": "15m",
40 | "floppy_files": [
41 | "answer_files/2016/Autounattend.xml",
42 | "scripts/oracle.cer",
43 | "./scripts/bootstrap.ps1",
44 | "./scripts/unattend.xml"
45 | ]
46 | }
47 | ],
48 | "provisioners": [
49 | {
50 | "type": "powershell",
51 | "elevated_user": "vagrant",
52 | "elevated_password": "vagrant",
53 | "script": "./scripts/windows-base.ps1"
54 | }
55 | ],
56 | "variables": {
57 | "iso_url": "https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO",
58 | "iso_checksum_type": "md5",
59 | "iso_checksum": "70721288bbcdfe3239d8f8c0fae55f1f"
60 | }
61 | }
--------------------------------------------------------------------------------
/virtualbox_windows_server_2016_2_updates.json:
--------------------------------------------------------------------------------
1 | {
2 | "builders": [
3 | {
4 | "type": "virtualbox-ovf",
5 | "source_path": "./output-base/vbox-base.ovf",
6 | "output_directory": "./output-updates/",
7 | "vm_name": "vbox-updates",
8 | "guest_additions_mode" : "disable",
9 | "headless": false,
10 | "vboxmanage": [
11 | [ "modifyvm", "{{.Name}}", "--memory", "2048" ],
12 | [ "modifyvm", "{{.Name}}", "--vram", "128" ],
13 | [ "modifyvm", "{{.Name}}", "--cpus", "1" ]
14 | ],
15 | "communicator": "winrm",
16 | "winrm_username": "vagrant",
17 | "winrm_password": "vagrant",
18 | "winrm_timeout": "12h",
19 | "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
20 | "shutdown_timeout": "1h"
21 | }
22 | ],
23 | "provisioners": [
24 | {
25 | "type": "powershell",
26 | "elevated_user": "vagrant",
27 | "elevated_password": "vagrant",
28 | "script": "./scripts/windows-updates.ps1"
29 | },
30 | {
31 | "type": "windows-restart",
32 | "restart_timeout": "1h"
33 | },
34 | {
35 | "type": "powershell",
36 | "elevated_user": "vagrant",
37 | "elevated_password": "vagrant",
38 | "inline": ["Get-WUInstall -MicrosoftUpdate -AcceptAll -IgnoreReboot"]
39 | },
40 | {
41 | "type": "windows-restart",
42 | "restart_timeout": "1h"
43 | },
44 | {
45 | "type": "powershell",
46 | "elevated_user": "vagrant",
47 | "elevated_password": "vagrant",
48 | "inline": ["Get-WUInstall -MicrosoftUpdate -AcceptAll -IgnoreReboot"]
49 | },
50 | {
51 | "type": "windows-restart",
52 | "restart_timeout": "1h"
53 | }
54 | ]
55 | }
56 |
--------------------------------------------------------------------------------
/virtualbox_windows_server_2016_3_package.json:
--------------------------------------------------------------------------------
1 | {
2 | "builders": [
3 | {
4 | "type": "virtualbox-ovf",
5 | "source_path": "./output-updates/vbox-updates.ovf",
6 | "output_directory": "./output-export-vbox/",
7 | "vm_name": "vbox-package-vagrant",
8 | "headless": true,
9 | "vboxmanage": [
10 | [ "modifyvm", "{{.Name}}", "--memory", "2048" ],
11 | [ "modifyvm", "{{.Name}}", "--vram", "128" ],
12 | [ "modifyvm", "{{.Name}}", "--cpus", "1" ]
13 | ],
14 | "guest_additions_mode": "attach",
15 | "winrm_username": "vagrant",
16 | "winrm_password": "vagrant",
17 | "winrm_timeout": "12h",
18 | "shutdown_command": "C:/Scripts/sysprep.cmd",
19 | "shutdown_timeout": "1h",
20 | "communicator": "winrm"
21 | }
22 | ],
23 | "provisioners": [
24 | {
25 | "type": "powershell",
26 | "elevated_user": "vagrant",
27 | "elevated_password": "vagrant",
28 | "script": "./scripts/tools_and_stuff.ps1"
29 | },
30 | {
31 | "type": "windows-restart",
32 | "restart_timeout": "1h"
33 | },
34 | {
35 | "type": "powershell",
36 | "elevated_user": "vagrant",
37 | "elevated_password": "vagrant",
38 | "script": "./scripts/windows-compress.ps1"
39 | }
40 | ],
41 | "post-processors": [
42 | {
43 | "type": "vagrant",
44 | "keep_input_artifact": true,
45 | "output": "windows2016_vbox.box",
46 | "vagrantfile_template": "./templates/vagrantfile-windows-2016.template"
47 | }
48 | ]
49 | }
50 |
--------------------------------------------------------------------------------
/virtualbox_windows_server_2019_1_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "builders": [
3 | {
4 | "type": "virtualbox-iso",
5 | "output_directory": "./output-base/",
6 | "vboxmanage": [
7 | [
8 | "modifyvm",
9 | "{{.Name}}",
10 | "--memory",
11 | "4096"
12 | ],
13 | [
14 | "modifyvm",
15 | "{{.Name}}",
16 | "--vram",
17 | "128"
18 | ],
19 | [
20 | "modifyvm",
21 | "{{.Name}}",
22 | "--cpus",
23 | "1"
24 | ]
25 | ],
26 | "vm_name": "vbox-base",
27 | "guest_additions_mode": "disable",
28 | "guest_os_type": "Windows2012_64",
29 | "iso_url": "{{ user `iso_url` }}",
30 | "iso_checksum_type": "{{user `iso_checksum_type`}}",
31 | "iso_checksum": "{{user `iso_checksum`}}",
32 | "disk_size": "60000",
33 | "headless": true,
34 | "communicator": "winrm",
35 | "winrm_username": "vagrant",
36 | "winrm_password": "vagrant",
37 | "winrm_timeout": "8h",
38 | "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
39 | "shutdown_timeout": "15m",
40 | "floppy_files": [
41 | "answer_files/2019/Autounattend.xml",
42 | "scripts/oracle.cer",
43 | "./scripts/bootstrap.ps1",
44 | "./scripts/unattend.xml"
45 | ]
46 | }
47 | ],
48 | "provisioners": [
49 | {
50 | "type": "powershell",
51 | "elevated_user": "vagrant",
52 | "elevated_password": "vagrant",
53 | "script": "./scripts/windows-base.ps1"
54 | }
55 | ],
56 | "variables": {
57 | "iso_url": "https://software-download.microsoft.com/download/pr/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso",
58 | "iso_checksum_type" : "md5",
59 | "iso_checksum": "70fec2cb1d6759108820130c2b5496da"
60 | }
61 | }
--------------------------------------------------------------------------------
/virtualbox_windows_server_2019_2_updates.json:
--------------------------------------------------------------------------------
1 | {
2 | "builders": [
3 | {
4 | "type": "virtualbox-ovf",
5 | "source_path": "./output-base/vbox-base.ovf",
6 | "output_directory": "./output-updates/",
7 | "vm_name": "vbox-updates",
8 | "guest_additions_mode" : "disable",
9 | "headless": true,
10 | "vboxmanage": [
11 | [ "modifyvm", "{{.Name}}", "--memory", "2048" ],
12 | [ "modifyvm", "{{.Name}}", "--vram", "128" ],
13 | [ "modifyvm", "{{.Name}}", "--cpus", "1" ]
14 | ],
15 | "communicator": "winrm",
16 | "winrm_username": "vagrant",
17 | "winrm_password": "vagrant",
18 | "winrm_timeout": "12h",
19 | "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
20 | "shutdown_timeout": "1h"
21 | }
22 | ],
23 | "provisioners": [
24 | {
25 | "type": "powershell",
26 | "elevated_user": "vagrant",
27 | "elevated_password": "vagrant",
28 | "script": "./scripts/windows-updates.ps1"
29 | },
30 | {
31 | "type": "powershell",
32 | "elevated_user": "vagrant",
33 | "elevated_password": "vagrant",
34 | "inline": ["Get-WUInstall -MicrosoftUpdate -AcceptAll -Download -Install -IgnoreReboot"]
35 | },
36 | {
37 | "type": "windows-restart",
38 | "restart_timeout": "1h"
39 | },
40 | {
41 | "type": "powershell",
42 | "elevated_user": "vagrant",
43 | "elevated_password": "vagrant",
44 | "inline": ["Get-WUInstall -MicrosoftUpdate -AcceptAll -Download -Install -IgnoreReboot"]
45 | },
46 | {
47 | "type": "windows-restart",
48 | "restart_timeout": "1h"
49 | },
50 | {
51 | "type": "powershell",
52 | "elevated_user": "vagrant",
53 | "elevated_password": "vagrant",
54 | "inline": [
55 | "Get-WUInstall -MicrosoftUpdate -AcceptAll -Download -Install -IgnoreReboot"
56 | ]
57 | },
58 | {
59 | "type": "windows-restart",
60 | "restart_timeout": "1h"
61 | }
62 | ]
63 | }
64 |
--------------------------------------------------------------------------------
/virtualbox_windows_server_2019_3_package.json:
--------------------------------------------------------------------------------
1 | {
2 | "builders": [
3 | {
4 | "type": "virtualbox-ovf",
5 | "source_path": "./output-updates/vbox-updates.ovf",
6 | "output_directory": "./output-export-vbox/",
7 | "vm_name": "vbox-package-vagrant",
8 | "headless": true,
9 | "vboxmanage": [
10 | [ "modifyvm", "{{.Name}}", "--memory", "2048" ],
11 | [ "modifyvm", "{{.Name}}", "--vram", "128" ],
12 | [ "modifyvm", "{{.Name}}", "--cpus", "1" ]
13 | ],
14 | "guest_additions_mode": "attach",
15 | "winrm_username": "vagrant",
16 | "winrm_password": "vagrant",
17 | "winrm_timeout": "12h",
18 | "shutdown_command": "C:/Scripts/sysprep.cmd",
19 | "shutdown_timeout": "1h",
20 | "communicator": "winrm"
21 | }
22 | ],
23 | "provisioners": [
24 | {
25 | "type": "powershell",
26 | "elevated_user": "vagrant",
27 | "elevated_password": "vagrant",
28 | "script": "./scripts/tools_and_stuff.ps1"
29 | },
30 | {
31 | "type": "windows-restart",
32 | "restart_timeout": "1h"
33 | },
34 | {
35 | "type": "powershell",
36 | "elevated_user": "vagrant",
37 | "elevated_password": "vagrant",
38 | "script": "./scripts/windows-compress.ps1"
39 | }
40 | ],
41 | "post-processors": [
42 | {
43 | "type": "vagrant",
44 | "keep_input_artifact": true,
45 | "output": "windows2019_vbox.box",
46 | "vagrantfile_template": "./templates/vagrantfile-windows-2019.template"
47 | }
48 | ]
49 | }
50 |
--------------------------------------------------------------------------------
/virtualbox_windows_servercore_2016_1_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "builders": [
3 | {
4 | "type": "virtualbox-iso",
5 | "output_directory": "./output-base/",
6 | "vboxmanage": [
7 | [ "modifyvm", "{{.Name}}", "--natpf1", "guest_winrm,tcp,,55985,,5985" ],
8 | [ "modifyvm", "{{.Name}}", "--memory", "2048" ],
9 | [ "modifyvm", "{{.Name}}", "--cpus", "1" ]
10 | ],
11 | "vm_name" : "vbox-base",
12 | "guest_additions_mode": "disable",
13 | "guest_os_type": "Windows2012_64",
14 | "iso_url": "{{ user `iso_url` }}",
15 | "iso_checksum_type": "{{user `iso_checksum_type`}}",
16 | "iso_checksum": "{{user `iso_checksum`}}",
17 | "headless": true,
18 | "communicator": "winrm",
19 | "winrm_username": "vagrant",
20 | "winrm_password": "vagrant",
21 | "winrm_timeout": "8h",
22 | "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
23 | "shutdown_timeout": "15m",
24 | "floppy_files": [
25 | "answer_files/2016_core/Autounattend.xml",
26 | "scripts/oracle.cer",
27 | "./scripts/bootstrap.ps1",
28 | "./scripts/unattend.xml"
29 | ]
30 | }
31 | ],
32 | "provisioners" : [
33 | {
34 | "type": "powershell",
35 | "elevated_user": "vagrant",
36 | "elevated_password": "vagrant",
37 | "script": "./scripts/windows-base.ps1"
38 | }
39 | ],
40 | "variables": {
41 | "iso_url": "http://care.dlservice.microsoft.com/dl/download/1/4/9/149D5452-9B29-4274-B6B3-5361DBDA30BC/14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO",
42 | "iso_checksum_type": "md5",
43 | "iso_checksum": "70721288bbcdfe3239d8f8c0fae55f1f"
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/virtualbox_windows_servercore_2016_3_package.json:
--------------------------------------------------------------------------------
1 | {
2 | "builders": [
3 | {
4 | "type": "virtualbox-ovf",
5 | "source_path": "./output-updates/vbox-updates.ovf",
6 | "output_directory": "./output-export-vbox/",
7 | "vm_name": "vbox-package-vagrant",
8 | "headless": true,
9 | "guest_additions_mode": "disable",
10 | "vboxmanage": [
11 | [ "modifyvm", "{{.Name}}", "--memory", "2048" ],
12 | [ "modifyvm", "{{.Name}}", "--vram", "128" ],
13 | [ "modifyvm", "{{.Name}}", "--cpus", "1" ]
14 | ],
15 | "communicator": "winrm",
16 | "winrm_username": "vagrant",
17 | "winrm_password": "vagrant",
18 | "winrm_timeout": "12h",
19 | "shutdown_command": "C:/Scripts/sysprep.cmd",
20 | "shutdown_timeout": "1h"
21 |
22 | }
23 | ],
24 | "provisioners": [
25 | {
26 | "type": "powershell",
27 | "elevated_user": "vagrant",
28 | "elevated_password": "vagrant",
29 | "script": "./scripts/tools_and_stuff.ps1"
30 | },
31 | {
32 | "type": "windows-restart",
33 | "restart_timeout": "1h"
34 | },
35 | {
36 | "type": "powershell",
37 | "elevated_user": "vagrant",
38 | "elevated_password": "vagrant",
39 | "script": "./scripts/windows-compress.ps1"
40 | }
41 | ],
42 | "post-processors": [
43 | {
44 | "type": "vagrant",
45 | "keep_input_artifact": true,
46 | "output": "windows2016core_vbox.box",
47 | "vagrantfile_template": "./templates/vagrantfile-windows-2016-core.template"
48 | }
49 | ]
50 | }
51 |
--------------------------------------------------------------------------------