Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Bob Tanner
packer-windows
Commits
643e5813
Unverified
Commit
643e5813
authored
Jul 10, 2017
by
Stefan Scherer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start a Windows Server Insider template
parent
51690ebd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
375 additions
and
0 deletions
+375
-0
answer_files/2016_insider/Autounattend.xml
answer_files/2016_insider/Autounattend.xml
+227
-0
windows_2016_insider.json
windows_2016_insider.json
+148
-0
No files found.
answer_files/2016_insider/Autounattend.xml
0 → 100644
View file @
643e5813
<?xml version="1.0" encoding="utf-8"?>
<unattend
xmlns=
"urn:schemas-microsoft-com:unattend"
>
<settings
pass=
"windowsPE"
>
<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"
>
<SetupUILanguage>
<UILanguage>
en-US
</UILanguage>
</SetupUILanguage>
<InputLocale>
en-US
</InputLocale>
<SystemLocale>
en-US
</SystemLocale>
<UILanguage>
en-US
</UILanguage>
<UILanguageFallback>
en-US
</UILanguageFallback>
<UserLocale>
en-US
</UserLocale>
</component>
<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"
>
<DiskConfiguration>
<Disk
wcm:action=
"add"
>
<CreatePartitions>
<CreatePartition
wcm:action=
"add"
>
<Type>
Primary
</Type>
<Order>
1
</Order>
<Size>
350
</Size>
</CreatePartition>
<CreatePartition
wcm:action=
"add"
>
<Order>
2
</Order>
<Type>
Primary
</Type>
<Extend>
true
</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition
wcm:action=
"add"
>
<Active>
true
</Active>
<Format>
NTFS
</Format>
<Label>
boot
</Label>
<Order>
1
</Order>
<PartitionID>
1
</PartitionID>
</ModifyPartition>
<ModifyPartition
wcm:action=
"add"
>
<Format>
NTFS
</Format>
<Label>
Windows 2016
</Label>
<Letter>
C
</Letter>
<Order>
2
</Order>
<PartitionID>
2
</PartitionID>
</ModifyPartition>
</ModifyPartitions>
<DiskID>
0
</DiskID>
<WillWipeDisk>
true
</WillWipeDisk>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData
wcm:action=
"add"
>
<Key>
/IMAGE/NAME
</Key>
<Value>
Windows Server 2016 SERVERDATACENTERCORE
</Value>
</MetaData>
</InstallFrom>
<InstallTo>
<DiskID>
0
</DiskID>
<PartitionID>
2
</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
<UserData>
<ProductKey>
<!-- Windows Server Insider product key -->
<Key>
XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
</Key>
<WillShowUI>
OnError
</WillShowUI>
</ProductKey>
<AcceptEula>
true
</AcceptEula>
<FullName>
Vagrant
</FullName>
<Organization>
Vagrant
</Organization>
</UserData>
</component>
</settings>
<settings
pass=
"specialize"
>
<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"
>
<OEMInformation>
<HelpCustomized>
false
</HelpCustomized>
</OEMInformation>
<ComputerName>
vagrant-2016
</ComputerName>
<TimeZone>
Pacific Standard Time
</TimeZone>
<RegisteredOwner/>
</component>
<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"
>
<DoNotOpenServerManagerAtLogon>
true
</DoNotOpenServerManagerAtLogon>
</component>
<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"
>
<IEHardenAdmin>
false
</IEHardenAdmin>
<IEHardenUser>
false
</IEHardenUser>
</component>
<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"
>
<DoNotOpenInitialConfigurationTasksAtLogon>
true
</DoNotOpenInitialConfigurationTasksAtLogon>
</component>
<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"
>
<SkipAutoActivation>
true
</SkipAutoActivation>
</component>
</settings>
<settings
pass=
"oobeSystem"
>
<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"
>
<AutoLogon>
<Password>
<Value>
vagrant
</Value>
<PlainText>
true
</PlainText>
</Password>
<Enabled>
true
</Enabled>
<Username>
vagrant
</Username>
</AutoLogon>
<FirstLogonCommands>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
</CommandLine>
<Description>
Set Execution Policy 64 Bit
</Description>
<Order>
1
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
</CommandLine>
<Description>
Set Execution Policy 32 Bit
</Description>
<Order>
2
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\disable-winrm.ps1
</CommandLine>
<Description>
Disable WinRM
</Description>
<Order>
3
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f
</CommandLine>
<Order>
4
</Order>
<Description>
Show file extensions in Explorer
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f
</CommandLine>
<Order>
5
</Order>
<Description>
Enable QuickEdit mode
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f
</CommandLine>
<Order>
6
</Order>
<Description>
Show Run command in Start Menu
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f
</CommandLine>
<Order>
7
</Order>
<Description>
Show Administrative Tools in Start Menu
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f
</CommandLine>
<Order>
8
</Order>
<Description>
Zero Hibernation File
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f
</CommandLine>
<Order>
9
</Order>
<Description>
Disable Hibernation Mode
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
</CommandLine>
<Order>
10
</Order>
<Description>
Disable password expiration for vagrant user
</Description>
</SynchronousCommand>
<!-- WITHOUT WINDOWS UPDATES -->
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\enable-winrm.ps1
</CommandLine>
<Description>
Enable WinRM
</Description>
<Order>
99
</Order>
</SynchronousCommand>
<!-- END WITHOUT WINDOWS UPDATES -->
<!-- WITH WINDOWS UPDATES -->
<!--
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c a:\microsoft-updates.bat</CommandLine>
<Order>98</Order>
<Description>Enable Microsoft Updates</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\disable-screensaver.ps1</CommandLine>
<Description>Disable Screensaver</Description>
<Order>99</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\win-updates.ps1</CommandLine>
<Description>Install Windows Updates</Description>
<Order>100</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
-->
<!-- END WITH WINDOWS UPDATES -->
</FirstLogonCommands>
<OOBE>
<HideEULAPage>
true
</HideEULAPage>
<HideLocalAccountScreen>
true
</HideLocalAccountScreen>
<HideOEMRegistrationScreen>
true
</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>
true
</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>
true
</HideWirelessSetupInOOBE>
<NetworkLocation>
Home
</NetworkLocation>
<ProtectYourPC>
1
</ProtectYourPC>
</OOBE>
<UserAccounts>
<AdministratorPassword>
<Value>
vagrant
</Value>
<PlainText>
true
</PlainText>
</AdministratorPassword>
<LocalAccounts>
<LocalAccount
wcm:action=
"add"
>
<Password>
<Value>
vagrant
</Value>
<PlainText>
true
</PlainText>
</Password>
<Group>
administrators
</Group>
<DisplayName>
Vagrant
</DisplayName>
<Name>
vagrant
</Name>
<Description>
Vagrant User
</Description>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOwner/>
</component>
</settings>
<settings
pass=
"offlineServicing"
>
<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"
>
<EnableLUA>
false
</EnableLUA>
</component>
</settings>
<cpi:offlineImage
xmlns:cpi=
"urn:schemas-microsoft-com:cpi"
cpi:source=
"wim:c:/wim/install.wim#Windows Server 2016 SERVERSTANDARD"
/>
</unattend>
windows_2016_insider.json
0 → 100644
View file @
643e5813
{
"builders"
:
[
{
"vm_name"
:
"WindowsServer2016Insider"
,
"type"
:
"hyperv-iso"
,
"disk_size"
:
41440
,
"boot_wait"
:
"0s"
,
"guest_additions_mode"
:
"disable"
,
"iso_url"
:
"{{user `iso_url`}}"
,
"iso_checksum_type"
:
"{{user `iso_checksum_type`}}"
,
"iso_checksum"
:
"{{user `iso_checksum`}}"
,
"floppy_files"
:
[
"{{user `autounattend`}}"
,
"./scripts/disable-screensaver.ps1"
,
"./scripts/disable-winrm.ps1"
,
"./scripts/enable-winrm.ps1"
],
"communicator"
:
"winrm"
,
"winrm_username"
:
"vagrant"
,
"winrm_password"
:
"vagrant"
,
"winrm_timeout"
:
"4h"
,
"shutdown_command"
:
"shutdown /s /t 10 /f /d p:4:1 /c
\"
Packer Shutdown
\"
"
,
"ram_size"
:
2048
,
"cpu"
:
2
,
"switch_name"
:
"{{user `hyperv_switchname`}}"
,
"enable_secure_boot"
:
true
},
{
"type"
:
"vmware-iso"
,
"communicator"
:
"winrm"
,
"iso_url"
:
"{{user `iso_url`}}"
,
"iso_checksum_type"
:
"{{user `iso_checksum_type`}}"
,
"iso_checksum"
:
"{{user `iso_checksum`}}"
,
"headless"
:
false
,
"boot_wait"
:
"2m"
,
"winrm_username"
:
"vagrant"
,
"winrm_password"
:
"vagrant"
,
"winrm_timeout"
:
"6h"
,
"shutdown_command"
:
"shutdown /s /t 10 /f /d p:4:1 /c
\"
Packer Shutdown
\"
"
,
"guest_os_type"
:
"windows9srv-64"
,
"disk_size"
:
61440
,
"vnc_port_min"
:
5900
,
"vnc_port_max"
:
5980
,
"floppy_files"
:
[
"{{user `autounattend`}}"
,
"./scripts/disable-winrm.ps1"
,
"./scripts/enable-winrm.ps1"
],
"vmx_data"
:
{
"RemoteDisplay.vnc.enabled"
:
"false"
,
"RemoteDisplay.vnc.port"
:
"5900"
,
"memsize"
:
"2048"
,
"numvcpus"
:
"2"
,
"scsi0.virtualDev"
:
"lsisas1068"
,
"virtualHW.version"
:
"12"
}
},
{
"type"
:
"virtualbox-iso"
,
"communicator"
:
"winrm"
,
"iso_url"
:
"{{user `iso_url`}}"
,
"iso_checksum_type"
:
"{{user `iso_checksum_type`}}"
,
"iso_checksum"
:
"{{user `iso_checksum`}}"
,
"headless"
:
false
,
"boot_wait"
:
"2m"
,
"winrm_username"
:
"vagrant"
,
"winrm_password"
:
"vagrant"
,
"winrm_timeout"
:
"6h"
,
"shutdown_command"
:
"shutdown /s /t 10 /f /d p:4:1 /c
\"
Packer Shutdown
\"
"
,
"guest_os_type"
:
"Windows2012_64"
,
"guest_additions_mode"
:
"disable"
,
"disk_size"
:
61440
,
"floppy_files"
:
[
"{{user `autounattend`}}"
,
"./scripts/disable-screensaver.ps1"
,
"./scripts/disable-winrm.ps1"
,
"./scripts/enable-winrm.ps1"
,
"./scripts/oracle-cert.cer"
],
"vboxmanage"
:
[
[
"modifyvm"
,
"{{.Name}}"
,
"--memory"
,
"2048"
],
[
"modifyvm"
,
"{{.Name}}"
,
"--cpus"
,
"2"
]
]
}
],
"provisioners"
:
[
{
"type"
:
"windows-shell"
,
"scripts"
:
[
"./scripts/vm-guest-tools.bat"
,
"./scripts/enable-rdp.bat"
]
},
{
"type"
:
"powershell"
,
"scripts"
:
[
"./scripts/docker/2016/install-containers-feature.ps1"
]
},
{
"type"
:
"windows-restart"
},
{
"type"
:
"powershell"
,
"scripts"
:
[
"./scripts/docker/add-docker-group.ps1"
,
"./scripts/docker/10/install-docker.ps1"
,
"./scripts/docker/open-docker-insecure-port.ps1"
,
"./scripts/docker/remove-docker-key-json.ps1"
,
"./scripts/docker/disable-windows-defender.ps1"
]
},
{
"type"
:
"windows-restart"
},
{
"type"
:
"windows-shell"
,
"scripts"
:
[
"./scripts/compile-dotnet-assemblies.bat"
,
"./scripts/compact.bat"
]
}
],
"post-processors"
:
[
{
"type"
:
"vagrant"
,
"keep_input_artifact"
:
false
,
"output"
:
"windows_2016_insider_{{.Provider}}.box"
,
"vagrantfile_template"
:
"vagrantfile-windows_2016.template"
}
],
"variables"
:
{
"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"
,
"iso_checksum_type"
:
"md5"
,
"iso_checksum"
:
"70721288BBCDFE3239D8F8C0FAE55F1F"
,
"autounattend"
:
"./answer_files/2016_insider/Autounattend.xml"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment