-
Notifications
You must be signed in to change notification settings - Fork 10
Window Server 2022 Auto Install Authoring #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
bobsira
wants to merge
9
commits into
vrapolinario:main
from
bobsira:user/bosira/autounattended-windows-install
Closed
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7f57213
intial authoring of auto install file
d291652
BIOS/MBR-Based Hard Disk answer file
7ae051c
setup file to test the configuration
58c3230
updates for testing
5306cf7
add auto-unattend iso file
iankingori 6109743
Merge pull request #1 from iankingori/bob/iso-setup
bobsira 80d31ee
Merge branch 'vrapolinario:main' into user/bosira/autounattended-wind…
bobsira b4aae2e
generic computer name
4aa93e9
computer name changes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| $SwitchName = "External VM Switch" | ||
| $ISOFile = "$HOME\Downloads\SERVER_EVAL_x64FRE_en-us-uni.iso" | ||
| $VMName = 'minikube-m05' | ||
| $VM = @{ | ||
| Name = $VMName; | ||
| MemoryStartupBytes = 1GB; | ||
| NewVHDPath = "${env:homepath}\.minikube\machines\$VMName\VHD.vhdx"; | ||
| NewVHDSizeBytes = 10GB; | ||
| BootDevice = "VHD"; | ||
| Path = "${env:homepath}\.minikube\machines\"; | ||
| SwitchName = $SwitchName | ||
| } | ||
| New-VM @VM | ||
| Set-VM -Name $VMName -ProcessorCount 2 -AutomaticCheckpointsEnabled $false | ||
| Set-VMProcessor -VMName $VMName -ExposeVirtualizationExtensions $true | ||
| Set-VMDvdDrive -VMName $VMName -Path $ISOFile | ||
bobsira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Start-VM -Name $VMName | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <unattend xmlns="urn:schemas-microsoft-com:unattend"> | ||
| <settings pass="windowsPE"> | ||
| <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> | ||
| <UILanguage>en-US</UILanguage> | ||
| </SetupUILanguage> | ||
| <InputLocale>en-US</InputLocale> | ||
| <SystemLocale>en-US</SystemLocale> | ||
| <UILanguage>en-US</UILanguage> | ||
| <UserLocale>en-US</UserLocale> | ||
| </component> | ||
| <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> | ||
| <Disk wcm:action="add"> | ||
| <CreatePartitions> | ||
| <CreatePartition wcm:action="add"> | ||
| <Size>250</Size> | ||
| <Order>1</Order> | ||
| <Type>Primary</Type> | ||
| </CreatePartition> | ||
| <CreatePartition wcm:action="add"> | ||
| <Order>2</Order> | ||
| <Extend>true</Extend> | ||
| <Type>Primary</Type> | ||
| </CreatePartition> | ||
| </CreatePartitions> | ||
| <ModifyPartitions> | ||
| <ModifyPartition wcm:action="add"> | ||
| <Order>1</Order> | ||
| <PartitionID>1</PartitionID> | ||
| <Format>NTFS</Format> | ||
| <Label>Boot</Label> | ||
| <Active>true</Active> | ||
| </ModifyPartition> | ||
| <ModifyPartition wcm:action="add"> | ||
| <Order>2</Order> | ||
| <PartitionID>2</PartitionID> | ||
| <Format>NTFS</Format> | ||
| <Label>System</Label> | ||
| </ModifyPartition> | ||
| </ModifyPartitions> | ||
| <DiskID>0</DiskID> | ||
| <WillWipeDisk>true</WillWipeDisk> | ||
| </Disk> | ||
| </DiskConfiguration> | ||
| <ImageInstall> | ||
| <OSImage> | ||
| <InstallFrom> | ||
| <!-- https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-setup-imageinstall-dataimage-installfrom-metadata-key --> | ||
| <!-- Get-WindowsImage -ImagePath D:\sources\install.wim --> | ||
| <MetaData wcm:action="add"> | ||
| <Key>/IMAGE/INDEX </Key> | ||
| <Value>2</Value> | ||
| </MetaData> | ||
| </InstallFrom> | ||
| <InstallTo> | ||
| <DiskID>0</DiskID> | ||
| <PartitionID>2</PartitionID> | ||
| </InstallTo> | ||
| <WillShowUI>OnError</WillShowUI> | ||
| <InstallToAvailablePartition>false</InstallToAvailablePartition> | ||
| </OSImage> | ||
| </ImageInstall> | ||
| <UserData> | ||
| <AcceptEula>true</AcceptEula> | ||
| <ProductKey> | ||
| <WillShowUI>Never</WillShowUI> | ||
| <!-- Do not uncomment the Key element if you are using trial ISOs --> | ||
| <!-- You must uncomment the Key element (and optionally insert your own key) if you are using retail or volume license ISOs --> | ||
| <!-- <Key>11111-22222-33333-44444-55555</Key> --> | ||
| </ProductKey> | ||
| </UserData> | ||
| </component> | ||
| </settings> | ||
| <settings pass="specialize"> | ||
| <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"> | ||
| <!-- https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-international-core --> | ||
| <InputLocale>en-US</InputLocale> | ||
| <SystemLocale>en-US</SystemLocale> | ||
| <UILanguage>en-US</UILanguage> | ||
| <UILanguageFallback>en-US</UILanguageFallback> | ||
| <UserLocale>en-US</UserLocale> | ||
| </component> | ||
| <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"> | ||
| <!-- https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup --> | ||
| <ComputerName>minikube-m05</ComputerName> | ||
bobsira marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <TimeZone>Central Standard Time</TimeZone> | ||
| <CopyProfile>true</CopyProfile> | ||
| </component> | ||
| <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"> | ||
| <!-- https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-security-spp-ux --> | ||
| <SkipAutoActivation>true</SkipAutoActivation> | ||
| </component> | ||
| </settings> | ||
| <settings pass="oobeSystem"> | ||
| <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"> | ||
| <!-- https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup --> | ||
| <AutoLogon> | ||
| <Password> | ||
| <Value>Minikube@2024</Value> | ||
| <PlainText>true</PlainText> | ||
| </Password> | ||
| <Username>Administrator</Username> | ||
| <Enabled>true</Enabled> | ||
| </AutoLogon> | ||
| <FirstLogonCommands> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "WinRMCertificate"</CommandLine> | ||
| <Description>Certificate for WinRM</Description> | ||
| <Order>1</Order> | ||
| <RequiresUserInput>true</RequiresUserInput> | ||
| </SynchronousCommand> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command Enable-PSRemoting -SkipNetworkProfileCheck -Force</CommandLine> | ||
| <Description>Enable WinRM</Description> | ||
| <Order>2</Order> | ||
| <RequiresUserInput>true</RequiresUserInput> | ||
| </SynchronousCommand> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command ($cert = gci Cert:\LocalMachine\My\) -and (New-Item -Path WSMan:\LocalHost\Listener -Transport HTTPS -Address * -CertificateThumbPrint $cert.Thumbprint –Force)</CommandLine> | ||
| <Description>Add HTTPS WinRM listener with previously generated certificate</Description> | ||
| <Order>3</Order> | ||
| <RequiresUserInput>true</RequiresUserInput> | ||
| </SynchronousCommand> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command New-NetFirewallRule -DisplayName 'Windows Remote Management (HTTPS-In)' -Name 'Windows Remote Management (HTTPS-In)' -Profile Any -LocalPort 5986 -Protocol TCP</CommandLine> | ||
| <Description>Add firewall exception to TCP port 5986 for WinRM over HTTPS</Description> | ||
| <Order>4</Order> | ||
| <RequiresUserInput>true</RequiresUserInput> | ||
| </SynchronousCommand> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command Set-Item WSMan:\localhost\Service\Auth\Basic -Value $true</CommandLine> | ||
| <Description>Enable Basic authentication</Description> | ||
| <Order>5</Order> | ||
| <RequiresUserInput>true</RequiresUserInput> | ||
| </SynchronousCommand> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command Stop-Service WinRM</CommandLine> | ||
| <Description>Stop the WinRM service to allow the dism process to finish before packer executes scripts</Description> | ||
| <Order>6</Order> | ||
| <RequiresUserInput>true</RequiresUserInput> | ||
| </SynchronousCommand> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command Install-WindowsFeature -Name containers</CommandLine> | ||
| <Order>7</Order> | ||
| <Description>Installs Containers feature</Description> | ||
| </SynchronousCommand> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command Set-SConfig -AutoLaunch $false</CommandLine> | ||
| <Order>8</Order> | ||
| <Description>Turns off Server Configuration tool (SConfig)</Description> | ||
| </SynchronousCommand> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command Restart-Computer -Force</CommandLine> | ||
| <Order>9</Order> | ||
| <Description>Restart computer to apply changes</Description> | ||
| </SynchronousCommand> | ||
| </FirstLogonCommands> | ||
| <UserAccounts> | ||
| <AdministratorPassword> | ||
| <Value>Minikube@2024</Value> | ||
| <PlainText>true</PlainText> | ||
| </AdministratorPassword> | ||
| </UserAccounts> | ||
| </component> | ||
| </settings> | ||
| <cpi:offlineImage cpi:source="wim:c:/wims/install.wim#Windows Server 2022 SERVERDATACENTER" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> | ||
| </unattend> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.