Commit ad8f6f7c authored by Stefan Scherer's avatar Stefan Scherer

Merge branch 'my' of github.com-home:StefanScherer/packer-windows into my

# By Stefan Scherer (9) and others
* 'my' of github.com-home:StefanScherer/packer-windows:
  Revert "Fix Install-ContainerHost.ps1 by downloading older commit" as fixed in upstream.
  Use VBoxGuestAdditions.iso 5.0.14
  Fix Install-ContainerHost.ps1 by downloading older commit
  sysprep to generate new SID
  Build windows_2016_docker with VirtualBox
  Revert "Merge pull request #195 from williamtsoi1/master"
  Install TP4 docker as default
  Stop Docker Engine and remvoe key.json to recreate on first Vagrant up
  Switch back to en-US and PST
  Download latest docker.exe 1.10.0-dev
  Update compact.bat
parents 2822dba3 69c89a9e
......@@ -71,11 +71,11 @@
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>de-DE</InputLocale>
<SystemLocale>de-DE</SystemLocale>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>de-DE</UserLocale>
<UserLocale>en-US</UserLocale>
</component>
</settings>
<settings pass="offlineServicing">
......@@ -216,7 +216,7 @@
</OEMInformation>
<!-- Rename computer here. -->
<ComputerName>vagrant-10</ComputerName>
<TimeZone>W. Europe Standard Time</TimeZone>
<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-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
......
......@@ -5,11 +5,11 @@
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>de-DE</InputLocale>
<SystemLocale>de-DE</SystemLocale>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>de-DE</UserLocale>
<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>
......@@ -80,7 +80,7 @@
<HelpCustomized>false</HelpCustomized>
</OEMInformation>
<ComputerName>vagrant-2016</ComputerName>
<TimeZone>W. Europe Standard Time</TimeZone>
<TimeZone>Pacific Standard Time</TimeZone>
<RegisteredOwner/>
</component>
<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">
......
......@@ -5,11 +5,11 @@
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>de-DE</InputLocale>
<SystemLocale>de-DE</SystemLocale>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>de-DE</UserLocale>
<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>
......@@ -80,7 +80,7 @@
<HelpCustomized>false</HelpCustomized>
</OEMInformation>
<ComputerName>vagrant-2016</ComputerName>
<TimeZone>W. Europe Standard Time</TimeZone>
<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">
......
......@@ -12,9 +12,13 @@ winrm set winrm/config/listener?Address=*+Transport=HTTP '@{Port="5985"}'
Write-Host "Install Containers"
Install-WindowsFeature -Name Containers
Write-Host "Install Hyper-V"
Install-WindowsFeature -Name Hyper-V
Install-WindowsFeature Hyper-V-Tools
if (Test-Path a:\oracle-cert.cer) {
Write-Host "Skipping installation of Hyper-V in VirtualBox basebox"
} else {
Write-Host "Install Hyper-V"
Install-WindowsFeature -Name Hyper-V
Install-WindowsFeature Hyper-V-Tools
}
Stop-Service winrm
. sc.exe config winrm start= delayed-auto
......
......@@ -6,9 +6,15 @@ if (!(Get-NetFirewallRule | where {$_.Name -eq "DockerUnsecure2375"})) {
}
Write-Host "Enabling Docker to listen on unsecure port 2375"
cp C:\programdata\docker\runDockerDaemon.cmd C:\programdata\docker\runDockerDaemon.cmd.bak
cat C:\programdata\docker\runDockerDaemon.cmd.bak | %{$_ -replace '^docker daemon -D -b "Virtual Switch"$','docker daemon -D -b "Virtual Switch" -H 0.0.0.0:2375'} | Set-Content C:\programdata\docker\runDockerDaemon.cmd
cp C:\ProgramData\docker\runDockerDaemon.cmd C:\ProgramData\docker\runDockerDaemon.cmd.bak
cat C:\ProgramData\docker\runDockerDaemon.cmd.bak | %{$_ -replace '^docker daemon -D -b "Virtual Switch"$','docker daemon -D -b "Virtual Switch" -H 0.0.0.0:2375'} | Set-Content C:\ProgramData\docker\runDockerDaemon.cmd
Write-Host "Restarting Docker"
Write-Host "Stopping Docker"
Stop-Service docker
Start-Service docker
# Do not restart Docker as it creates the key.json with an unique ID
# This should not exist in the Vagrant basebox so you can spin up
# multiple Vagrant boxes for a Docker swarm etc.
Write-Host "Removing key.json to recreate key.json on first vagrant up"
rm C:\ProgramData\docker\config\key.json
......@@ -79,6 +79,22 @@ function Run-Interactive {
& schtasks /Delete /F /TN InstallContainerHost
}
Run-Interactive -commandline "C:\Install-ContainerHost.ps1 -HyperV"
if (Test-Path a:\oracle-cert.cer) {
Write-Host "Skip installation of Hyper-V on VirtualBox Container Host"
$installOptions = ""
} else {
Write-Host "Add installation of Hyper-V on Container Host"
$installOptions = "-HyperV"
}
# Download latest nightly build of docker engine
$wantNightlyDocker = $false
if ($wantNightlyDocker) {
$ExeFile = "C:\Users\vagrant\Downloads\docker.exe"
wget -o $ExeFile https://master.dockerproject.org/windows/amd64/docker.exe
Run-Interactive -commandline "C:\Install-ContainerHost.ps1 $installOptions -DockerPath $ExeFile"
} else {
Run-Interactive -commandline "C:\Install-ContainerHost.ps1 $installOptions"
}
# https://msdn.microsoft.com/virtualization/windowscontainers/quick_start/manage_docker
......@@ -37,7 +37,7 @@ if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
)
if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.0.6/VBoxGuestAdditions_5.0.6.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.0.14/VBoxGuestAdditions_5.0.14.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
......
......@@ -11,7 +11,7 @@
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout": "6h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"shutdown_command": "c:/windows/system32/sysprep/sysprep.exe /generalize /oobe /quiet /shutdown /unattend:a:/unattend.xml",
"guest_os_type": "windows8srv-64",
"disk_size": 61440,
"vnc_port_min": 5900,
......@@ -22,6 +22,7 @@
"./scripts/disable-winrm.ps1",
"./scripts/enable-winrm.ps1",
"./scripts/microsoft-updates.bat",
"./scripts/unattend.xml",
"./scripts/win-updates.ps1"
],
"vmx_data": {
......@@ -43,7 +44,7 @@
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout": "6h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"shutdown_command": "c:/windows/system32/sysprep/sysprep.exe /generalize /oobe /quiet /shutdown /unattend:a:/unattend.xml",
"guest_os_type": "Windows2012_64",
"guest_additions_mode": "disable",
"disk_size": 61440,
......@@ -52,6 +53,7 @@
"./scripts/disable-winrm.ps1",
"./scripts/enable-winrm.ps1",
"./scripts/microsoft-updates.bat",
"./scripts/unattend.xml",
"./scripts/win-updates.ps1",
"./scripts/oracle-cert.cer"
],
......
......@@ -42,7 +42,7 @@
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"boot_wait": "6m",
"boot_wait": "7m",
"boot_command": [ "{{user `product_key`}}<enter>" ],
"winrm_username": "vagrant",
"winrm_password": "vagrant",
......
......@@ -43,7 +43,7 @@
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": false,
"boot_wait": "6m",
"boot_wait": "7m",
"boot_command": [ "{{user `product_key`}}<enter>" ],
"winrm_username": "vagrant",
"winrm_password": "vagrant",
......
Markdown is supported
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