├── .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</PlainText> 99 | </AdministratorPassword> 100 | <LocalAccounts> 101 | <LocalAccount wcm:action="add"> 102 | <Password> 103 | <Value>vagrant</Value> 104 | <PlainText>true</PlainText> 105 | </Password> 106 | <Description>Vagrant User</Description> 107 | <DisplayName>vagrant</DisplayName> 108 | <Group>administrators</Group> 109 | <Name>vagrant</Name> 110 | </LocalAccount> 111 | </LocalAccounts> 112 | </UserAccounts> 113 | <OOBE> 114 | <HideEULAPage>true</HideEULAPage> 115 | <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> 116 | <NetworkLocation>Work</NetworkLocation> 117 | <ProtectYourPC>1</ProtectYourPC> 118 | </OOBE> 119 | <AutoLogon> 120 | <Password> 121 | <Value>vagrant</Value> 122 | <PlainText>true</PlainText> 123 | </Password> 124 | <Username>vagrant</Username> 125 | <Enabled>true</Enabled> 126 | </AutoLogon> 127 | <FirstLogonCommands> 128 | <SynchronousCommand wcm:action="add"> 129 | <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Force"</CommandLine> 130 | <Description>Set Execution Policy 64 Bit</Description> 131 | <Order>1</Order> 132 | <RequiresUserInput>true</RequiresUserInput> 133 | </SynchronousCommand> 134 | <SynchronousCommand wcm:action="add"> 135 | <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Force"</CommandLine> 136 | <Description>Set Execution Policy 32 Bit</Description> 137 | <Order>2</Order> 138 | <RequiresUserInput>true</RequiresUserInput> 139 | </SynchronousCommand> 140 | <SynchronousCommand wcm:action="add"> 141 | <CommandLine>cmd.exe /c reg add "HKLM\System\CurrentControlSet\Control\Network\NewNetworkWindowOff"</CommandLine> 142 | <Description>Network prompt</Description> 143 | <Order>3</Order> 144 | <RequiresUserInput>true</RequiresUserInput> 145 | </SynchronousCommand> 146 | <SynchronousCommand wcm:action="add"> 147 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine> 148 | <Order>4</Order> 149 | <Description>Show file extensions in Explorer</Description> 150 | </SynchronousCommand> 151 | <SynchronousCommand wcm:action="add"> 152 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f</CommandLine> 153 | <Order>5</Order> 154 | <Description>Enable QuickEdit mode</Description> 155 | </SynchronousCommand> 156 | <SynchronousCommand wcm:action="add"> 157 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f</CommandLine> 158 | <Order>6</Order> 159 | <Description>Show Run command in Start Menu</Description> 160 | </SynchronousCommand> 161 | <SynchronousCommand wcm:action="add"> 162 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f</CommandLine> 163 | <Order>7</Order> 164 | <Description>Show Administrative Tools in Start Menu</Description> 165 | </SynchronousCommand> 166 | <SynchronousCommand wcm:action="add"> 167 | <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> 168 | <Order>8</Order> 169 | <Description>Disable password expiration for vagrant user</Description> 170 | </SynchronousCommand> 171 | <SynchronousCommand wcm:action="add"> 172 | <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1</CommandLine> 173 | <Description>Fix public network and enable WinRM</Description> 174 | <Order>9</Order> 175 | <RequiresUserInput>true</RequiresUserInput> 176 | </SynchronousCommand> 177 | </FirstLogonCommands> 178 | <ShowWindowsLive>false</ShowWindowsLive> 179 | </component> 180 | </settings> 181 | <settings pass="specialize"> 182 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 183 | <OEMInformation> 184 | <HelpCustomized>false</HelpCustomized> 185 | </OEMInformation> 186 | <!-- Rename computer here. --> 187 | <ComputerName>vagrant-w10</ComputerName> 188 | <TimeZone>UTC</TimeZone> 189 | <RegisteredOwner/> 190 | </component> 191 | <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 192 | <SkipAutoActivation>true</SkipAutoActivation> 193 | </component> 194 | </settings> 195 | <cpi:offlineImage xmlns:cpi="urn:schemas-microsoft-com:cpi" cpi:source="catalog:d:/sources/install_windows 7 ENTERPRISE.clg"/> 196 | </unattend> -------------------------------------------------------------------------------- /answer_files/2016/Autounattend.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <unattend xmlns="urn:schemas-microsoft-com:unattend"> 3 | <settings pass="windowsPE"> 4 | <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 5 | <SetupUILanguage> 6 | <UILanguage>en-US</UILanguage> 7 | </SetupUILanguage> 8 | <InputLocale>en-US</InputLocale> 9 | <SystemLocale>en-US</SystemLocale> 10 | <UILanguage>en-US</UILanguage> 11 | <UILanguageFallback>en-US</UILanguageFallback> 12 | <UserLocale>en-US</UserLocale> 13 | </component> 14 | <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 15 | <DiskConfiguration> 16 | <Disk wcm:action="add"> 17 | <CreatePartitions> 18 | <CreatePartition wcm:action="add"> 19 | <Type>Primary</Type> 20 | <Order>1</Order> 21 | <Size>350</Size> 22 | </CreatePartition> 23 | <CreatePartition wcm:action="add"> 24 | <Order>2</Order> 25 | <Type>Primary</Type> 26 | <Extend>true</Extend> 27 | </CreatePartition> 28 | </CreatePartitions> 29 | <ModifyPartitions> 30 | <ModifyPartition wcm:action="add"> 31 | <Active>true</Active> 32 | <Format>NTFS</Format> 33 | <Label>boot</Label> 34 | <Order>1</Order> 35 | <PartitionID>1</PartitionID> 36 | </ModifyPartition> 37 | <ModifyPartition wcm:action="add"> 38 | <Format>NTFS</Format> 39 | <Label>Windows 2016</Label> 40 | <Letter>C</Letter> 41 | <Order>2</Order> 42 | <PartitionID>2</PartitionID> 43 | </ModifyPartition> 44 | </ModifyPartitions> 45 | <DiskID>0</DiskID> 46 | <WillWipeDisk>true</WillWipeDisk> 47 | </Disk> 48 | </DiskConfiguration> 49 | <ImageInstall> 50 | <OSImage> 51 | <InstallFrom> 52 | <MetaData wcm:action="add"> 53 | <Key>/IMAGE/NAME </Key> 54 | <Value>Windows Server 2016 SERVERSTANDARD</Value> 55 | </MetaData> 56 | </InstallFrom> 57 | <InstallTo> 58 | <DiskID>0</DiskID> 59 | <PartitionID>2</PartitionID> 60 | </InstallTo> 61 | </OSImage> 62 | </ImageInstall> 63 | <UserData> 64 | <ProductKey> 65 | <!-- <Key>6XBNX-4JQGW-QX6QG-74P76-72V67</Key> --> 66 | <WillShowUI>OnError</WillShowUI> 67 | </ProductKey> 68 | <AcceptEula>true</AcceptEula> 69 | <FullName>Vagrant</FullName> 70 | <Organization>Hashicorp</Organization> 71 | </UserData> 72 | </component> 73 | </settings> 74 | <settings pass="specialize"> 75 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 76 | <OEMInformation> 77 | <HelpCustomized>false</HelpCustomized> 78 | </OEMInformation> 79 | <ComputerName>vagrant-2016</ComputerName> 80 | <TimeZone>Pacific Standard Time</TimeZone> 81 | <RegisteredOwner /> 82 | </component> 83 | <component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 84 | <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> 85 | </component> 86 | <component name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 87 | <IEHardenAdmin>false</IEHardenAdmin> 88 | <IEHardenUser>false</IEHardenUser> 89 | </component> 90 | <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 91 | <SkipAutoActivation>true</SkipAutoActivation> 92 | </component> 93 | </settings> 94 | <settings pass="oobeSystem"> 95 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 96 | <AutoLogon> 97 | <Password> 98 | <Value>vagrant</Value> 99 | <PlainText>true</PlainText> 100 | </Password> 101 | <Enabled>true</Enabled> 102 | <Username>vagrant</Username> 103 | </AutoLogon> 104 | <FirstLogonCommands> 105 | <SynchronousCommand wcm:action="add"> 106 | <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> 107 | <Description>Set Execution Policy 64 Bit</Description> 108 | <Order>1</Order> 109 | <RequiresUserInput>true</RequiresUserInput> 110 | </SynchronousCommand> 111 | <SynchronousCommand wcm:action="add"> 112 | <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> 113 | <Description>Set Execution Policy 32 Bit</Description> 114 | <Order>2</Order> 115 | <RequiresUserInput>true</RequiresUserInput> 116 | </SynchronousCommand> 117 | <SynchronousCommand wcm:action="add"> 118 | <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1</CommandLine> 119 | <Description>Fix public network</Description> 120 | <Order>3</Order> 121 | <RequiresUserInput>true</RequiresUserInput> 122 | </SynchronousCommand> 123 | <SynchronousCommand wcm:action="add"> 124 | <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> 125 | <Order>4</Order> 126 | <Description>Disable password expiration for vagrant user</Description> 127 | </SynchronousCommand> 128 | </FirstLogonCommands> 129 | <UserAccounts> 130 | <AdministratorPassword> 131 | <Value>vagrant</Value> 132 | <PlainText>true</PlainText> 133 | </AdministratorPassword> 134 | <LocalAccounts> 135 | <LocalAccount wcm:action="add"> 136 | <Password> 137 | <Value>vagrant</Value> 138 | <PlainText>true</PlainText> 139 | </Password> 140 | <DisplayName>Vagrant User</DisplayName> 141 | <Group>Administrators</Group> 142 | <Name>vagrant</Name> 143 | </LocalAccount> 144 | </LocalAccounts> 145 | </UserAccounts> 146 | </component> 147 | </settings> 148 | <settings pass="offlineServicing"> 149 | <component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 150 | <EnableLUA>false</EnableLUA> 151 | </component> 152 | </settings> 153 | <cpi:offlineImage cpi:source="wim://vboxsrv/vagrant/iso%202016/sources/install.wim#Windows Server 2016 Technical Preview 5 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> 154 | </unattend> 155 | -------------------------------------------------------------------------------- /answer_files/2016_core/Autounattend.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <unattend xmlns="urn:schemas-microsoft-com:unattend"> 3 | <settings pass="windowsPE"> 4 | <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 5 | <SetupUILanguage> 6 | <UILanguage>en-US</UILanguage> 7 | </SetupUILanguage> 8 | <InputLocale>en-US</InputLocale> 9 | <SystemLocale>en-US</SystemLocale> 10 | <UILanguage>en-US</UILanguage> 11 | <UILanguageFallback>en-US</UILanguageFallback> 12 | <UserLocale>en-US</UserLocale> 13 | </component> 14 | <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 15 | <DiskConfiguration> 16 | <Disk wcm:action="add"> 17 | <CreatePartitions> 18 | <CreatePartition wcm:action="add"> 19 | <Type>Primary</Type> 20 | <Order>1</Order> 21 | <Size>350</Size> 22 | </CreatePartition> 23 | <CreatePartition wcm:action="add"> 24 | <Order>2</Order> 25 | <Type>Primary</Type> 26 | <Extend>true</Extend> 27 | </CreatePartition> 28 | </CreatePartitions> 29 | <ModifyPartitions> 30 | <ModifyPartition wcm:action="add"> 31 | <Active>true</Active> 32 | <Format>NTFS</Format> 33 | <Label>boot</Label> 34 | <Order>1</Order> 35 | <PartitionID>1</PartitionID> 36 | </ModifyPartition> 37 | <ModifyPartition wcm:action="add"> 38 | <Format>NTFS</Format> 39 | <Label>Windows 2016</Label> 40 | <Letter>C</Letter> 41 | <Order>2</Order> 42 | <PartitionID>2</PartitionID> 43 | </ModifyPartition> 44 | </ModifyPartitions> 45 | <DiskID>0</DiskID> 46 | <WillWipeDisk>true</WillWipeDisk> 47 | </Disk> 48 | </DiskConfiguration> 49 | <ImageInstall> 50 | <OSImage> 51 | <InstallFrom> 52 | <MetaData wcm:action="add"> 53 | <Key>/IMAGE/NAME </Key> 54 | <Value>Windows Server 2016 SERVERSTANDARDCORE</Value> 55 | </MetaData> 56 | </InstallFrom> 57 | <InstallTo> 58 | <DiskID>0</DiskID> 59 | <PartitionID>2</PartitionID> 60 | </InstallTo> 61 | </OSImage> 62 | </ImageInstall> 63 | <UserData> 64 | <!-- Product Key from http://technet.microsoft.com/en-us/library/jj612867.aspx --> 65 | <ProductKey> 66 | <!-- Do not uncomment the Key element if you are using trial ISOs --> 67 | <!-- You must uncomment the Key element (and optionally insert your own key) if you are using retail or volume license ISOs --> 68 | <!-- <Key>MFY9F-XBN2F-TYFMP-CCV49-RMYVH</Key> --> 69 | <WillShowUI>OnError</WillShowUI> 70 | </ProductKey> 71 | <AcceptEula>true</AcceptEula> 72 | <FullName>Vagrant</FullName> 73 | <Organization>Vagrant</Organization> 74 | </UserData> 75 | </component> 76 | </settings> 77 | <settings pass="specialize"> 78 | <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 79 | <OEMInformation> 80 | <HelpCustomized>false</HelpCustomized> 81 | </OEMInformation> 82 | <ComputerName>vagrant-2016</ComputerName> 83 | <TimeZone>Pacific Standard Time</TimeZone> 84 | <RegisteredOwner/> 85 | </component> 86 | <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 87 | <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> 88 | </component> 89 | <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 90 | <IEHardenAdmin>false</IEHardenAdmin> 91 | <IEHardenUser>false</IEHardenUser> 92 | </component> 93 | <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 94 | <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> 95 | </component> 96 | <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 97 | <SkipAutoActivation>true</SkipAutoActivation> 98 | </component> 99 | </settings> 100 | <settings pass="oobeSystem"> 101 | <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 102 | <AutoLogon> 103 | <Password> 104 | <Value>vagrant</Value> 105 | <PlainText>true</PlainText> 106 | </Password> 107 | <Enabled>true</Enabled> 108 | <Username>vagrant</Username> 109 | </AutoLogon> 110 | <FirstLogonCommands> 111 | <SynchronousCommand wcm:action="add"> 112 | <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> 113 | <Description>Set Execution Policy 64 Bit</Description> 114 | <Order>1</Order> 115 | <RequiresUserInput>true</RequiresUserInput> 116 | </SynchronousCommand> 117 | <SynchronousCommand wcm:action="add"> 118 | <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> 119 | <Description>Set Execution Policy 32 Bit</Description> 120 | <Order>2</Order> 121 | <RequiresUserInput>true</RequiresUserInput> 122 | </SynchronousCommand> 123 | <SynchronousCommand wcm:action="add"> 124 | <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1</CommandLine> 125 | <Description>Fix public network</Description> 126 | <Order>3</Order> 127 | <RequiresUserInput>true</RequiresUserInput> 128 | </SynchronousCommand> 129 | <!-- 130 | <SynchronousCommand wcm:action="add"> 131 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine> 132 | <Order>4</Order> 133 | <Description>Show file extensions in Explorer</Description> 134 | </SynchronousCommand> 135 | <SynchronousCommand wcm:action="add"> 136 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f</CommandLine> 137 | <Order>5</Order> 138 | <Description>Enable QuickEdit mode</Description> 139 | </SynchronousCommand> 140 | <SynchronousCommand wcm:action="add"> 141 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f</CommandLine> 142 | <Order>6</Order> 143 | <Description>Show Run command in Start Menu</Description> 144 | </SynchronousCommand> 145 | <SynchronousCommand wcm:action="add"> 146 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f</CommandLine> 147 | <Order>7</Order> 148 | <Description>Show Administrative Tools in Start Menu</Description> 149 | </SynchronousCommand> 150 | <SynchronousCommand wcm:action="add"> 151 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f</CommandLine> 152 | <Order>8</Order> 153 | <Description>Zero Hibernation File</Description> 154 | </SynchronousCommand> 155 | <SynchronousCommand wcm:action="add"> 156 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f</CommandLine> 157 | <Order>9</Order> 158 | <Description>Disable Hibernation Mode</Description> 159 | </SynchronousCommand> 160 | --> 161 | <SynchronousCommand wcm:action="add"> 162 | <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> 163 | <Order>10</Order> 164 | <Description>Disable password expiration for vagrant user</Description> 165 | </SynchronousCommand> 166 | </FirstLogonCommands> 167 | <OOBE> 168 | <HideEULAPage>true</HideEULAPage> 169 | <HideLocalAccountScreen>true</HideLocalAccountScreen> 170 | <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> 171 | <HideOnlineAccountScreens>true</HideOnlineAccountScreens> 172 | <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> 173 | <NetworkLocation>Home</NetworkLocation> 174 | <ProtectYourPC>1</ProtectYourPC> 175 | </OOBE> 176 | <UserAccounts> 177 | <AdministratorPassword> 178 | <Value>vagrant</Value> 179 | <PlainText>true</PlainText> 180 | </AdministratorPassword> 181 | <LocalAccounts> 182 | <LocalAccount wcm:action="add"> 183 | <Password> 184 | <Value>vagrant</Value> 185 | <PlainText>true</PlainText> 186 | </Password> 187 | <Group>administrators</Group> 188 | <DisplayName>Vagrant</DisplayName> 189 | <Name>vagrant</Name> 190 | <Description>Vagrant User</Description> 191 | </LocalAccount> 192 | </LocalAccounts> 193 | </UserAccounts> 194 | <RegisteredOwner/> 195 | </component> 196 | </settings> 197 | <settings pass="offlineServicing"> 198 | <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 199 | <EnableLUA>false</EnableLUA> 200 | </component> 201 | </settings> 202 | <cpi:offlineImage cpi:source="wim:c:/temp/iso2016/sources/install.wim#Windows Server 2016 Technical Preview 5 SERVERSTANDARDCORE" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> 203 | </unattend> 204 | -------------------------------------------------------------------------------- /answer_files/2019/Autounattend.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <unattend xmlns="urn:schemas-microsoft-com:unattend"> 3 | <settings pass="windowsPE"> 4 | <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 5 | <DiskConfiguration> 6 | <Disk wcm:action="add"> 7 | <CreatePartitions> 8 | <CreatePartition wcm:action="add"> 9 | <Type>Primary</Type> 10 | <Order>1</Order> 11 | <Size>350</Size> 12 | </CreatePartition> 13 | <CreatePartition wcm:action="add"> 14 | <Order>2</Order> 15 | <Type>Primary</Type> 16 | <Extend>true</Extend> 17 | </CreatePartition> 18 | </CreatePartitions> 19 | <ModifyPartitions> 20 | <ModifyPartition wcm:action="add"> 21 | <Active>true</Active> 22 | <Format>NTFS</Format> 23 | <Label>boot</Label> 24 | <Order>1</Order> 25 | <PartitionID>1</PartitionID> 26 | </ModifyPartition> 27 | <ModifyPartition wcm:action="add"> 28 | <Format>NTFS</Format> 29 | <Label>Windows 2019</Label> 30 | <Letter>C</Letter> 31 | <Order>2</Order> 32 | <PartitionID>2</PartitionID> 33 | </ModifyPartition> 34 | </ModifyPartitions> 35 | <DiskID>0</DiskID> 36 | <WillWipeDisk>true</WillWipeDisk> 37 | </Disk> 38 | </DiskConfiguration> 39 | <ImageInstall> 40 | <OSImage> 41 | <InstallFrom> 42 | <MetaData wcm:action="add"> 43 | <Key>/IMAGE/NAME</Key> 44 | <Value>Windows Server 2019 SERVERDATACENTER</Value> 45 | </MetaData> 46 | </InstallFrom> 47 | <InstallTo> 48 | <DiskID>0</DiskID> 49 | <PartitionID>2</PartitionID> 50 | </InstallTo> 51 | </OSImage> 52 | </ImageInstall> 53 | <UserData> 54 | <!-- Product Key from https://www.microsoft.com/de-de/evalcenter/evaluate-windows-server-technical-preview?i=1 --> 55 | <ProductKey> 56 | <!-- Do not uncomment the Key element if you are using trial ISOs --> 57 | <!-- You must uncomment the Key element (and optionally insert your own key) if you are using retail or volume license ISOs --> 58 | <!-- <Key>6XBNX-4JQGW-QX6QG-74P76-72V67</Key> --> 59 | <WillShowUI>OnError</WillShowUI> 60 | </ProductKey> 61 | <AcceptEula>true</AcceptEula> 62 | <FullName>Vagrant</FullName> 63 | <Organization>Vagrant</Organization> 64 | </UserData> 65 | </component> 66 | <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> 67 | <SetupUILanguage> 68 | <UILanguage>en-US</UILanguage> 69 | </SetupUILanguage> 70 | <InputLocale>0409:00000409</InputLocale> 71 | <SystemLocale>en-US</SystemLocale> 72 | <UILanguage>en-US</UILanguage> 73 | <UILanguageFallback>en-US</UILanguageFallback> 74 | <UserLocale>en-US</UserLocale> 75 | </component> 76 | </settings> 77 | <settings pass="specialize"> 78 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 79 | <OEMInformation> 80 | <HelpCustomized>false</HelpCustomized> 81 | </OEMInformation> 82 | <ComputerName>vagrant-2019</ComputerName> 83 | <TimeZone>Pacific Standard Time</TimeZone> 84 | <RegisteredOwner/> 85 | </component> 86 | <component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 87 | <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> 88 | </component> 89 | <component name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 90 | <IEHardenAdmin>false</IEHardenAdmin> 91 | <IEHardenUser>false</IEHardenUser> 92 | </component> 93 | <component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 94 | <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> 95 | </component> 96 | <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 97 | <SkipAutoActivation>true</SkipAutoActivation> 98 | </component> 99 | <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 100 | <RunSynchronous> 101 | <RunSynchronousCommand wcm:action="add"> 102 | <Order>1</Order> 103 | <Description>Set Execution Policy 64 Bit</Description> 104 | <Path>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</Path> 105 | </RunSynchronousCommand> 106 | <RunSynchronousCommand wcm:action="add"> 107 | <Order>2</Order> 108 | <Description>Set Execution Policy 32 Bit</Description> 109 | <Path>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</Path> 110 | </RunSynchronousCommand> 111 | </RunSynchronous> 112 | </component> 113 | </settings> 114 | <settings pass="oobeSystem"> 115 | <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 116 | <InputLocale>en-US</InputLocale> 117 | <SystemLocale>en-US</SystemLocale> 118 | <UILanguage>en-US</UILanguage> 119 | <UILanguageFallback>en-US</UILanguageFallback> 120 | <UserLocale>en-US</UserLocale> 121 | </component> 122 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 123 | <AutoLogon> 124 | <Password> 125 | <Value>vagrant</Value> 126 | <PlainText>true</PlainText> 127 | </Password> 128 | <Enabled>true</Enabled> 129 | <Username>vagrant</Username> 130 | </AutoLogon> 131 | <FirstLogonCommands> 132 | <SynchronousCommand wcm:action="add"> 133 | <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> 134 | <Description>Set Execution Policy 64 Bit</Description> 135 | <Order>1</Order> 136 | <RequiresUserInput>true</RequiresUserInput> 137 | </SynchronousCommand> 138 | <SynchronousCommand wcm:action="add"> 139 | <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> 140 | <Description>Set Execution Policy 32 Bit</Description> 141 | <Order>2</Order> 142 | <RequiresUserInput>true</RequiresUserInput> 143 | </SynchronousCommand> 144 | <SynchronousCommand wcm:action="add"> 145 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine> 146 | <Order>4</Order> 147 | <Description>Show file extensions in Explorer</Description> 148 | </SynchronousCommand> 149 | <SynchronousCommand wcm:action="add"> 150 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f</CommandLine> 151 | <Order>5</Order> 152 | <Description>Enable QuickEdit mode</Description> 153 | </SynchronousCommand> 154 | <SynchronousCommand wcm:action="add"> 155 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f</CommandLine> 156 | <Order>6</Order> 157 | <Description>Show Run command in Start Menu</Description> 158 | </SynchronousCommand> 159 | <SynchronousCommand wcm:action="add"> 160 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f</CommandLine> 161 | <Order>7</Order> 162 | <Description>Show Administrative Tools in Start Menu</Description> 163 | </SynchronousCommand> 164 | <SynchronousCommand wcm:action="add"> 165 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f</CommandLine> 166 | <Order>8</Order> 167 | <Description>Zero Hibernation File</Description> 168 | </SynchronousCommand> 169 | <SynchronousCommand wcm:action="add"> 170 | <CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f</CommandLine> 171 | <Order>9</Order> 172 | <Description>Disable Hibernation Mode</Description> 173 | </SynchronousCommand> 174 | <SynchronousCommand wcm:action="add"> 175 | <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> 176 | <Order>10</Order> 177 | <Description>Disable password expiration for vagrant user</Description> 178 | </SynchronousCommand> 179 | <SynchronousCommand wcm:action="add"> 180 | <CommandLine>cmd.exe /c a:\microsoft-updates.bat</CommandLine> 181 | <Order>98</Order> 182 | <Description>Enable Microsoft Updates</Description> 183 | </SynchronousCommand> 184 | <SynchronousCommand wcm:action="add"> 185 | <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\disable-screensaver.ps1</CommandLine> 186 | <Description>Disable Screensaver</Description> 187 | <Order>99</Order> 188 | <RequiresUserInput>true</RequiresUserInput> 189 | </SynchronousCommand> 190 | <SynchronousCommand wcm:action="add"> 191 | <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\windows-updates.ps1</CommandLine> 192 | <Description>Install Windows Updates</Description> 193 | <Order>100</Order> 194 | <RequiresUserInput>true</RequiresUserInput> 195 | </SynchronousCommand> 196 | <SynchronousCommand wcm:action="add"> 197 | <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\bootstrap.ps1</CommandLine> 198 | <Description>Fix public network and WinRM</Description> 199 | <Order>101</Order> 200 | <RequiresUserInput>true</RequiresUserInput> 201 | </SynchronousCommand> 202 | </FirstLogonCommands> 203 | <OOBE> 204 | <HideEULAPage>true</HideEULAPage> 205 | <HideLocalAccountScreen>true</HideLocalAccountScreen> 206 | <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> 207 | <HideOnlineAccountScreens>true</HideOnlineAccountScreens> 208 | <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> 209 | <NetworkLocation>Home</NetworkLocation> 210 | <ProtectYourPC>1</ProtectYourPC> 211 | </OOBE> 212 | <UserAccounts> 213 | <AdministratorPassword> 214 | <Value>vagrant</Value> 215 | <PlainText>true</PlainText> 216 | </AdministratorPassword> 217 | <LocalAccounts> 218 | <LocalAccount wcm:action="add"> 219 | <Password> 220 | <Value>vagrant</Value> 221 | <PlainText>true</PlainText> 222 | </Password> 223 | <Group>administrators</Group> 224 | <DisplayName>Vagrant</DisplayName> 225 | <Name>vagrant</Name> 226 | <Description>Vagrant User</Description> 227 | </LocalAccount> 228 | </LocalAccounts> 229 | </UserAccounts> 230 | <RegisteredOwner /> 231 | </component> 232 | </settings> 233 | <settings pass="offlineServicing"> 234 | <component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 235 | <EnableLUA>false</EnableLUA> 236 | </component> 237 | </settings> 238 | <cpi:offlineImage cpi:source="wim:c:/wim/install.wim#Windows Server 2012 R2 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> 239 | </unattend> -------------------------------------------------------------------------------- /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 | <Configuration> 17 | <Add SourcePath="c:\install\odt" OfficeClientEdition="32"> 18 | <Product ID="O365ProPlusRetail"> 19 | <Language ID="en-us" /> 20 | <ExcludeApp ID="Access" /> 21 | <ExcludeApp ID="Groove" /> 22 | <ExcludeApp ID="InfoPath" /> 23 | <ExcludeApp ID="Lync" /> 24 | <ExcludeApp ID="OneDrive" /> 25 | <ExcludeApp ID="OneNote" /> 26 | <ExcludeApp ID="Outlook" /> 27 | <ExcludeApp ID="PowerPoint" /> 28 | <ExcludeApp ID="Project" /> 29 | <ExcludeApp ID="Publisher" /> 30 | <ExcludeApp ID="SharePointDesigner" /> 31 | <ExcludeApp ID="Visio" /> 32 | <ExcludeApp ID="Word" /> 33 | </Product> 34 | </Add> 35 | <Display Level="None" AcceptEULA="TRUE" /> 36 | </Configuration> 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 | <Configuration> 53 | <Add SourcePath="c:\install\odt" OfficeClientEdition="32"> 54 | <Product ID="O365ProPlusRetail"> 55 | <Language ID="en-us" /> 56 | <ExcludeApp ID="Access" /> 57 | <ExcludeApp ID="Groove" /> 58 | <ExcludeApp ID="InfoPath" /> 59 | <ExcludeApp ID="Lync" /> 60 | <ExcludeApp ID="OneDrive" /> 61 | <ExcludeApp ID="OneNote" /> 62 | <ExcludeApp ID="Outlook" /> 63 | <ExcludeApp ID="PowerPoint" /> 64 | <ExcludeApp ID="Project" /> 65 | <ExcludeApp ID="Publisher" /> 66 | <ExcludeApp ID="SharePointDesigner" /> 67 | <ExcludeApp ID="Visio" /> 68 | <ExcludeApp ID="Word" /> 69 | </Product> 70 | </Add> 71 | <Display Level="None" AcceptEULA="TRUE" /> 72 | </Configuration> 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 | <?xml version="1.0" encoding="utf-8"?> 2 | <unattend xmlns="urn:schemas-microsoft-com:unattend"> 3 | <settings pass="generalize"> 4 | <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 5 | <SkipRearm>1</SkipRearm> 6 | </component> 7 | <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 8 | <PersistAllDeviceInstalls>false</PersistAllDeviceInstalls> 9 | <DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices> 10 | </component> 11 | </settings> 12 | <settings pass="oobeSystem"> 13 | <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 14 | <InputLocale>en-US</InputLocale> 15 | <SystemLocale>en-US</SystemLocale> 16 | <UILanguage>en-US</UILanguage> 17 | <UserLocale>en-US</UserLocale> 18 | </component> 19 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 20 | <OOBE> 21 | <HideEULAPage>true</HideEULAPage> 22 | <ProtectYourPC>1</ProtectYourPC> 23 | <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> 24 | </OOBE> 25 | <TimeZone>UTC</TimeZone> 26 | <UserAccounts> 27 | <AdministratorPassword> 28 | <Value>dgBhAGcAcgBhAG4AdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value> 29 | <PlainText>false</PlainText> 30 | </AdministratorPassword> 31 | <LocalAccounts> 32 | <LocalAccount wcm:action="add"> 33 | <Password> 34 | <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value> 35 | <PlainText>false</PlainText> 36 | </Password> 37 | <Group>administrators</Group> 38 | <DisplayName>Vagrant</DisplayName> 39 | <Name>vagrant</Name> 40 | <Description>Vagrant User</Description> 41 | </LocalAccount> 42 | </LocalAccounts> 43 | </UserAccounts> 44 | </component> 45 | </settings> 46 | <settings pass="specialize"> 47 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 48 | <!--<ProductKey>6XBNX-4JQGW-QX6QG-74P76-72V67</ProductKey>--> 49 | <ComputerName>vagrant-2016</ComputerName> 50 | </component> 51 | </settings> 52 | <cpi:offlineImage cpi:source="wim:c:/users/jacqueline/desktop/iso%202016/sources/install.wim#Windows Server 2016 Technical Preview 5 SERVERSTANDARDCORE" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> 53 | </unattend> 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 | --------------------------------------------------------------------------------