diff --git a/answer_files/xp/WINNT.SIF b/answer_files/xp/WINNT.SIF new file mode 100644 index 00000000..3a1ec46c --- /dev/null +++ b/answer_files/xp/WINNT.SIF @@ -0,0 +1,52 @@ +[Data] +Autopartition=1 +MsDosInitiated=0 +UnattendedInstall="Yes" + +[Unattended] +Repartition=Yes +UnattendMode=FullUnattended +UnattendSwitch="Yes" +OemPreinstall="Yes" +OemSkipEula="Yes" +FileSystem=* +WaitForReboot="No" +NoWaitAfterTextMode=1 +NoWaitAfterGUIMode=1 +DriverSigningPolicy=Ignore +NonDriverSigningPolicy=Ignore + +[GuiUnattended] +EncryptedAdminPassword="No" +AutoLogon="Yes" +AdminPassword="vagrant" +TimeZone=020 +OEMSkipRegional=1 +OemSkipWelcome=1 + +[Components] + +[UserData] +ProductKey="QW4HD-DQCRG-HM64M-6GJRK-8K83T" +ComputerName=vagrant +FullName="vagrant" +OrgName="vagrant" + +[RegionalSettings] +LanguageGroup=1 +Language="0409" + +[Networking] +InstallDefaultComponents="Yes" + +[Identification] +JoinWorkgroup="WORKGROUP" + +[GuiRunOnce] +Command0="cmd /c mkdir c:\temp" +Command1="cmd /c cscript a:\extract_wget_zip.vbs" +Command2="cmd /c c:\temp\bin\wget https://download.microsoft.com/download/0/8/c/08c19fa4-4c4f-4ffb-9d6c-150906578c9e/NetFx20SP1_x86.exe -O c:\temp\dotnet.exe --no-check-certificate" +Command3="cmd /c start /w c:\temp\dotnet.exe /passive /norestart" +Command4="cmd /c c:\temp\bin\wget https://download.microsoft.com/download/E/C/E/ECE99583-2003-455D-B681-68DB610B44A4/WindowsXP-KB968930-x86-ENG.exe -O c:\temp\winrm.exe --no-check-certificate" +Command5="cmd /c start /w c:\temp\winrm.exe /passive /norestart" +Command6="cmd /c a:\setup_winrm.bat" diff --git a/scripts/extract_wget_zip.vbs b/scripts/extract_wget_zip.vbs new file mode 100644 index 00000000..74904a33 --- /dev/null +++ b/scripts/extract_wget_zip.vbs @@ -0,0 +1,17 @@ +'The location of the zip file. +ZipFile="a:\wget-win32-static.zip" +'The folder the contents should be extracted to. +ExtractTo="c:\temp\" + +'If the extraction location does not exist create it. +Set fso = CreateObject("Scripting.FileSystemObject") +If NOT fso.FolderExists(ExtractTo) Then + fso.CreateFolder(ExtractTo) +End If + +'Extract the contants of the zip file. +set objShell = CreateObject("Shell.Application") +set FilesInZip=objShell.NameSpace(ZipFile).items +objShell.NameSpace(ExtractTo).CopyHere(FilesInZip) +Set fso = Nothing +Set objShell = Nothing diff --git a/scripts/setup_winrm.bat b/scripts/setup_winrm.bat new file mode 100644 index 00000000..c510f0d5 --- /dev/null +++ b/scripts/setup_winrm.bat @@ -0,0 +1,11 @@ +powershell.exe -Command "Enable-PSRemoting -Force" + +cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"} +cmd.exe /c winrm set winrm/config/winrs @{MaxConcurrentUsers="100"} +cmd.exe /c winrm set winrm/config/winrs @{MaxProcessesPerShell="100"} +cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="1024"} +cmd.exe /c winrm set winrm/config/winrs @{MaxShellsPerUser="100"} +cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"} +cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"} + +REG add "HKLM\SYSTEM\CurrentControlSet\services\WinRM" /v DelayedAutostart /t REG_DWORD /d 0 /f diff --git a/scripts/wget-win32-static.zip b/scripts/wget-win32-static.zip new file mode 100644 index 00000000..42e2bef7 Binary files /dev/null and b/scripts/wget-win32-static.zip differ diff --git a/winxp.json b/winxp.json new file mode 100644 index 00000000..5cd30f6f --- /dev/null +++ b/winxp.json @@ -0,0 +1,42 @@ +{ + "builders": [ + { + "type": "qemu", + "accelerator": "kvm", + "vm_name": "winxp", + "iso_url": "{{user `iso_url`}}", + "iso_checksum_type": "{{user `iso_checksum_type`}}", + "iso_checksum": "{{user `iso_checksum`}}", + "headless": true, + "skip_compaction": true, + "boot_wait": "2m", + "communicator": "winrm", + "winrm_username": "vagrant", + "winrm_password": "vagrant", + "winrm_timeout": "8h", + "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"", + "disk_size": 20000, + "disk_interface": "ide", + "net_device": "rtl8139", + "http_directory": "http", + "http_port_min": 8500, + "http_port_max": 8500, + "qemuargs": [ + [ "-smp", "2,sockets=1,cores=2,threads=1" ], + [ "-m", "1024" ] + ], + "floppy_files": [ + "{{user `autounattend`}}", + "scripts/wget-win32-static.zip", + "scripts/extract_wget_zip.vbs", + "scripts/setup_winrm.bat" + ] + } + ], + "variables": { + "iso_url": "iso/en_windows_xp_professional_sp3_Nov_2013_Incl_SATA_Drivers.iso", + "iso_checksum_type": "sha256", + "iso_checksum": "3855a4049663edb2c7b7b11b448a86e01274a4d1a9bb49392420bdb61f830a0e", + "autounattend": "answer_files/xp/WINNT.SIF" + } +}