Commit 3ab0140d authored by Stefan Scherer's avatar Stefan Scherer
Browse files

more WinRM

parent f89a515e
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend"> <unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE"> <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"> <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">
<SetupUILanguage> <SetupUILanguage>
<UILanguage>en-US</UILanguage> <UILanguage>en-US</UILanguage>
</SetupUILanguage> </SetupUILanguage>
<InputLocale>de-DE</InputLocale> <InputLocale>en-US</InputLocale>
<SystemLocale>de-DE</SystemLocale> <SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage> <UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback> <UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>de-DE</UserLocale> <UserLocale>en-US</UserLocale>
</component> </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"> <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">
<DiskConfiguration> <DiskConfiguration>
<Disk wcm:action="add"> <Disk wcm:action="add">
<CreatePartitions> <CreatePartitions>
...@@ -75,30 +75,49 @@ ...@@ -75,30 +75,49 @@
</component> </component>
</settings> </settings>
<settings pass="specialize"> <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"> <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">
<OEMInformation> <OEMInformation>
<HelpCustomized>false</HelpCustomized> <HelpCustomized>false</HelpCustomized>
</OEMInformation> </OEMInformation>
<ComputerName>vagrant-2012-r2</ComputerName> <ComputerName>vagrant-2012-r2</ComputerName>
<TimeZone>W. Europe Standard Time</TimeZone> <TimeZone>W. Europe Standard Time</TimeZone>
<RegisteredOwner/> <RegisteredOwner />
</component> </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"> <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">
<DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
</component> </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"> <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">
<IEHardenAdmin>false</IEHardenAdmin> <IEHardenAdmin>false</IEHardenAdmin>
<IEHardenUser>false</IEHardenUser> <IEHardenUser>false</IEHardenUser>
</component> </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"> <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">
<DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
</component> </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"> <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">
<SkipAutoActivation>true</SkipAutoActivation> <SkipAutoActivation>true</SkipAutoActivation>
</component> </component>
<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">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Set Execution Policy 64 Bit</Description>
<Path>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Set Execution Policy 32 Bit</Description>
<Path>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Description>Disable WinRM</Description>
<Path>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\disable-winrm.ps1</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings> </settings>
<settings pass="oobeSystem"> <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"> <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">
<AutoLogon> <AutoLogon>
<Password> <Password>
<Value>vagrant</Value> <Value>vagrant</Value>
...@@ -121,143 +140,63 @@ ...@@ -121,143 +140,63 @@
<RequiresUserInput>true</RequiresUserInput> <RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c winrm quickconfig -q</CommandLine> <CommandLine>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\disable-winrm.ps1</CommandLine>
<Description>winrm quickconfig -q</Description> <Description>Disable WinRM</Description>
<Order>3</Order> <Order>3</Order>
<RequiresUserInput>true</RequiresUserInput> <RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c winrm quickconfig -transport:http</CommandLine>
<Description>winrm quickconfig -transport:http</Description>
<Order>4</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}</CommandLine>
<Description>Win RM MaxTimoutms</Description>
<Order>5</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="800"}</CommandLine>
<Description>Win RM MaxMemoryPerShellMB</Description>
<Order>6</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}</CommandLine>
<Description>Win RM AllowUnencrypted</Description>
<Order>7</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}</CommandLine>
<Description>Win RM auth Basic</Description>
<Order>8</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}</CommandLine>
<Description>Win RM client auth Basic</Description>
<Order>9</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"} </CommandLine>
<Description>Win RM listener Address/Port</Description>
<Order>10</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes </CommandLine>
<Description>Win RM adv firewall enable</Description>
<Order>11</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985" </CommandLine>
<Description>Win RM port open</Description>
<Order>12</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c net stop winrm </CommandLine>
<Description>Stop Win RM Service </Description>
<Order>13</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c sc config winrm start= auto</CommandLine>
<Description>Win RM Autostart</Description>
<Order>14</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c net start winrm</CommandLine>
<Description>Start Win RM Service</Description>
<Order>15</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add"> <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> <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine>
<Order>16</Order> <Order>4</Order>
<Description>Show file extensions in Explorer</Description> <Description>Show file extensions in Explorer</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f</CommandLine> <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f</CommandLine>
<Order>17</Order> <Order>5</Order>
<Description>Enable QuickEdit mode</Description> <Description>Enable QuickEdit mode</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <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> <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f</CommandLine>
<Order>18</Order> <Order>6</Order>
<Description>Show Run command in Start Menu</Description> <Description>Show Run command in Start Menu</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <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> <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f</CommandLine>
<Order>19</Order> <Order>7</Order>
<Description>Show Administrative Tools in Start Menu</Description> <Description>Show Administrative Tools in Start Menu</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f</CommandLine> <CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f</CommandLine>
<Order>20</Order> <Order>8</Order>
<Description>Zero Hibernation File</Description> <Description>Zero Hibernation File</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f</CommandLine> <CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f</CommandLine>
<Order>21</Order> <Order>9</Order>
<Description>Disable Hibernation Mode</Description> <Description>Disable Hibernation Mode</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine>
<Order>22</Order> <Order>10</Order>
<Description>Disable password expiration for vagrant user</Description> <Description>Disable password expiration for vagrant user</Description>
</SynchronousCommand> </SynchronousCommand>
<!-- WITHOUT WINDOWS UPDATES --> <!-- WITHOUT WINDOWS UPDATES -->
<!-- <!--
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\dis-updates.ps1</CommandLine> <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\enable-winrm.ps1</CommandLine>
<Description>Disable Automatic Updates</Description> <Description>Enable WinRM</Description>
<Order>97</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1 -AutoStart</CommandLine>
<Description>Install OpenSSH</Description>
<Order>99</Order> <Order>99</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand> </SynchronousCommand>
--> -->
<!-- END WITHOUT WINDOWS UPDATES --> <!-- END WITHOUT WINDOWS UPDATES -->
<!-- WITH WINDOWS UPDATES --> <!-- WITH WINDOWS UPDATES -->
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\dis-updates.ps1</CommandLine> <CommandLine>cmd.exe /c a:\microsoft-updates.bat</CommandLine>
<Description>Disable Automatic Updates</Description> <Order>98</Order>
<Order>97</Order> <Description>Enable Microsoft Updates</Description>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\win-updates.ps1 -MaxUpdatesPerCycle 30</CommandLine> <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\win-updates.ps1</CommandLine>
<Description>Install Windows Updates</Description> <Description>Install Windows Updates</Description>
<Order>100</Order> <Order>100</Order>
<RequiresUserInput>true</RequiresUserInput> <RequiresUserInput>true</RequiresUserInput>
...@@ -291,13 +230,13 @@ ...@@ -291,13 +230,13 @@
</LocalAccount> </LocalAccount>
</LocalAccounts> </LocalAccounts>
</UserAccounts> </UserAccounts>
<RegisteredOwner/> <RegisteredOwner />
</component> </component>
</settings> </settings>
<settings pass="offlineServicing"> <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"> <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">
<EnableLUA>false</EnableLUA> <EnableLUA>false</EnableLUA>
</component> </component>
</settings> </settings>
<cpi:offlineImage xmlns:cpi="urn:schemas-microsoft-com:cpi" cpi:source="wim:c:/wim/install.wim#Windows Server 2012 R2 SERVERSTANDARD"/> <cpi:offlineImage cpi:source="wim:c:/wim/install.wim#Windows Server 2012 R2 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend> </unattend>
...@@ -2,25 +2,27 @@ ...@@ -2,25 +2,27 @@
"builders": [ "builders": [
{ {
"type": "vmware-iso", "type": "vmware-iso",
"iso_url": "http://care.dlservice.microsoft.com/dl/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO", "communicator": "winrm",
"iso_checksum_type": "md5", "iso_url": "{{user `iso_url`}}",
"iso_checksum": "5b5e08c490ad16b59b1d9fab0def883a", "iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": true, "headless": true,
"boot_wait": "2m", "boot_wait": "2m",
"ssh_username": "vagrant", "winrm_username": "vagrant",
"ssh_password": "vagrant", "winrm_password": "vagrant",
"ssh_wait_timeout": "6h", "winrm_timeout": "6h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"", "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"guest_os_type": "windows8srv-64", "guest_os_type": "windows8srv-64",
"tools_upload_flavor": "windows", "disk_size": 61440,
"disk_size": 131072,
"vnc_port_min": 5900, "vnc_port_min": 5900,
"vnc_port_max": 5980, "vnc_port_max": 5980,
"skip_compaction": true,
"floppy_files": [ "floppy_files": [
"./answer_files/2012_r2/Autounattend.xml", "{{user `autounattend`}}",
"./scripts/disable-winrm.ps1",
"./scripts/enable-winrm.ps1",
"./scripts/microsoft-updates.bat", "./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1", "./scripts/win-updates.ps1"
"./scripts/openssh.ps1"
], ],
"vmx_data": { "vmx_data": {
"RemoteDisplay.vnc.enabled": "false", "RemoteDisplay.vnc.enabled": "false",
...@@ -32,22 +34,25 @@ ...@@ -32,22 +34,25 @@
}, },
{ {
"type": "virtualbox-iso", "type": "virtualbox-iso",
"iso_url": "http://care.dlservice.microsoft.com/dl/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO", "communicator": "winrm",
"iso_checksum_type": "md5", "iso_url": "{{user `iso_url`}}",
"iso_checksum": "5b5e08c490ad16b59b1d9fab0def883a", "iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": true, "headless": true,
"boot_wait": "2m", "boot_wait": "2m",
"ssh_username": "vagrant", "winrm_username": "vagrant",
"ssh_password": "vagrant", "winrm_password": "vagrant",
"ssh_wait_timeout": "6h", "winrm_timeout": "6h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"", "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"guest_os_type": "Windows2012_64", "guest_os_type": "Windows2012_64",
"disk_size": 131072, "guest_additions_mode": "disable",
"disk_size": 61440,
"floppy_files": [ "floppy_files": [
"./answer_files/2012_r2/Autounattend.xml", "{{user `autounattend`}}",
"./scripts/disable-winrm.ps1",
"./scripts/enable-winrm.ps1",
"./scripts/microsoft-updates.bat", "./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1", "./scripts/win-updates.ps1",
"./scripts/openssh.ps1",
"./scripts/oracle-cert.cer" "./scripts/oracle-cert.cer"
], ],
"vboxmanage": [ "vboxmanage": [
...@@ -68,24 +73,13 @@ ...@@ -68,24 +73,13 @@
], ],
"provisioners": [ "provisioners": [
{ {
"type": "shell", "type": "windows-shell",
"remote_path": "/tmp/script.bat",
"execute_command": "{{.Vars}} cmd /c C:/Windows/Temp/script.bat",
"scripts": [ "scripts": [
"./scripts/vm-guest-tools.bat", "./scripts/vm-guest-tools.bat",
"./scripts/chef.bat",
"./scripts/vagrant-ssh.bat",
"./scripts/enable-rdp.bat", "./scripts/enable-rdp.bat",
"./scripts/compile-dotnet-assemblies.bat", "./scripts/compile-dotnet-assemblies.bat",
"./scripts/disable-auto-logon.bat",
"./scripts/compact.bat" "./scripts/compact.bat"
] ]
},
{
"type": "shell",
"inline": [
"rm -rf /tmp/*"
]
} }
], ],
"post-processors": [ "post-processors": [
...@@ -95,5 +89,11 @@ ...@@ -95,5 +89,11 @@
"output": "windows_2012_r2_{{.Provider}}.box", "output": "windows_2012_r2_{{.Provider}}.box",
"vagrantfile_template": "vagrantfile-windows_2012_r2.template" "vagrantfile_template": "vagrantfile-windows_2012_r2.template"
} }
] ],
"variables": {
"iso_url": "http://care.dlservice.microsoft.com/dl/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO",
"iso_checksum_type": "md5",
"iso_checksum": "5b5e08c490ad16b59b1d9fab0def883a",
"autounattend": "./answer_files/2012_r2/Autounattend.xml"
}
} }
...@@ -71,12 +71,8 @@ ...@@ -71,12 +71,8 @@
} }
], ],
"provisioners": [ "provisioners": [
{
"type": "windows-restart"
},
{ {
"type": "windows-shell", "type": "windows-shell",
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
"scripts": [ "scripts": [
"./scripts/vm-guest-tools.bat", "./scripts/vm-guest-tools.bat",
"./scripts/enable-rdp.bat", "./scripts/enable-rdp.bat",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment