diff --git a/packer/windows_10_x64/Autounattend.xml b/packer/windows_10_x64/Autounattend.xml new file mode 100644 index 0000000..c3a6b57 --- /dev/null +++ b/packer/windows_10_x64/Autounattend.xml @@ -0,0 +1,156 @@ + + + + + + + + + + 1 + Primary + true + + + + + false + NTFS + C + 1 + 1 + + + + 0 + true + + OnError + + + true + + + + + NPPR9-FWDCX-D2C8J-H872K-2YT43 + Never + + + + + + 0 + 1 + + OnError + false + + + /IMAGE/NAME + Windows 10 Enterprise Evaluation + + + + + + + + en-US + + en-US + en-US + en-US + en-US + en-US + + + + + + + + V@grant123 + true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>V@grant123</Value> + <PlainText>true</PlainText> + </Password> + <Description>Vagrant User</Description> + <DisplayName>vagrant</DisplayName> + <Group>administrators</Group> + <Name>vagrant</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Home</NetworkLocation> + <ProtectYourPC>1</ProtectYourPC> + </OOBE> + <AutoLogon> + <Password> + <Value>V@grant123</Value> + <PlainText>true</PlainText> + </Password> + <Username>vagrant</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -ExecutionPolicy Unrestricted -Command "Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force"</CommandLine> + <Description>Set Execution Policy</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + + <SynchronousCommand wcm:action="add"> + <!-- This task MUST include enabling winrm for Packer to be able to continue --> + <CommandLine>powershell.exe -File A:\autounattend-postinstall.ps1</CommandLine> + <Description>Run Postinstall Script</Description> + <Order>99</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + + </FirstLogonCommands> + <ShowWindowsLive>false</ShowWindowsLive> + </component> + </settings> + <settings pass="specialize"> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <OEMInformation> + <HelpCustomized>false</HelpCustomized> + </OEMInformation> + <!-- Rename computer here. --> + <ComputerName>vagrant-10-amd64</ComputerName> + <TimeZone>Central 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-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <SkipAutoActivation>true</SkipAutoActivation> + </component> + </settings> + <cpi:offlineImage xmlns:cpi="urn:schemas-microsoft-com:cpi" cpi:source="catalog:d:/sources/install_windows 7 ENTERPRISE.clg"/> +</unattend> diff --git a/packer/windows_10_x64/vagrantfile-windows_10_x64.template b/packer/windows_10_x64/vagrantfile-windows_10_x64.template new file mode 100644 index 0000000..75936e8 --- /dev/null +++ b/packer/windows_10_x64/vagrantfile-windows_10_x64.template @@ -0,0 +1,31 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.require_version ">= 1.6.2" + +Vagrant.configure("2") do |config| + config.vm.define "vagrant-windows-10" + config.vm.box = "windows_10_x64_virtualbox.box" + config.vm.communicator = "winrm" + + # Admin user name and password + config.winrm.username = "vagrant" + config.winrm.password = "V@grant123" + + config.vm.guest = :windows + config.windows.halt_timeout = 15 + + config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true + + config.vm.provider :virtualbox do |v, override| + #v.gui = true + v.customize ["modifyvm", :id, "--memory", 2048] + v.customize ["modifyvm", :id, "--cpus", 1] + v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ] + v.customize ["modifyvm", :id, "--accelerate2dvideo", "on"] + v.customize ["modifyvm", :id, "--vram", 128] + v.customize ["modifyvm", :id, "--clipboard", "bidirectional"] + v.customize ["modifyvm", :id, "--draganddrop", "bidirectional"] + end + +end diff --git a/packer/windows_10_x64/windows_10_x64.packerfile.json b/packer/windows_10_x64/windows_10_x64.packerfile.json new file mode 100644 index 0000000..1e3b2a6 --- /dev/null +++ b/packer/windows_10_x64/windows_10_x64.packerfile.json @@ -0,0 +1,56 @@ +{ + "variables": { + "output_directory": "packer-output" + }, + "builders": [ + { + "type": "virtualbox-iso", + "iso_url": "http://care.dlservice.microsoft.com/dl/download/C/3/9/C399EEA8-135D-4207-92C9-6AAB3259F6EF/10240.16384.150709-1700.TH1_CLIENTENTERPRISEEVAL_OEMRET_X64FRE_EN-US.ISO", + "iso_checksum_type": "sha1", + "iso_checksum": "56ab095075be28a90bc0b510835280975c6bb2ce", + "headless": true, + "boot_wait": "2m", + "communicator": "winrm", + "winrm_username": "vagrant", + "winrm_password": "V@grant123", + "winrm_timeout": "24h", + "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"", + "guest_os_type": "Windows10_64", + "disk_size": 61440, + "guest_additions_mode": "attach", + "floppy_files": [ + "./Autounattend.xml", + "../../scripts/win-updates.ps1", + "../../scripts/enable-winrm.ps1", + "../../scripts/wintriallab-postinstall.psm1", + "../../scripts/autounattend-postinstall.ps1", + "../../scripts/provisioner-postinstall.ps1" + ], + "vboxmanage": [ + ["setextradata", "global", "GUI/SuppressMessages", "all" ], + ["modifyvm", "{{.Name}}", "--memory", "2048" ], + ["modifyvm", "{{.Name}}", "--cpus", "2" ], + ["modifyvm", "{{.Name}}", "--clipboard", "bidirectional"], + ["modifyvm", "{{.Name}}", "--draganddrop", "bidirectional"], + ["modifyvm", "{{.Name}}", "--accelerate2dvideo", "on"], + ["modifyvm", "{{.Name}}", "--vram", 128] + ] + } + ], + "provisioners": [ + + { + "type": "powershell", + "inline": ["A:\\provisioner-postinstall.ps1 -Verbose"] + } + + ], + "post-processors": [ + { + "type": "vagrant", + "keep_input_artifact": false, + "output": "{{user `output_directory`}}/windows_10_x64_{{.Provider}}.box", + "vagrantfile_template": "vagrantfile-windows_10_x64.template" + } + ] +}