diff --git a/assets/win2019-hv.xml b/assets/win2019-hv.xml new file mode 100644 index 0000000..3ce3690 --- /dev/null +++ b/assets/win2019-hv.xml @@ -0,0 +1,341 @@ + + + + + + en-US + + 0409:00000409 + en-US + en-US + en-US + en-US + + + + + 0 + true + + + + 1 + EFI + 128 + + + + 2 + MSR + 128 + + + + 3 + Primary + true + + + + + + 1 + 1 + + FAT32 + + + + 2 + 2 + + + + 3 + 3 + + C + NTFS + + + + + + + + + /IMAGE/NAME + Hyper-V Server 2019 SERVERHYPERCORE + + + + 0 + 3 + + OnError + false + + + + true + Never + + + false + Never + + + true + Docker + Windows for Docker + + false + + false + + + + + + false + + + + + true + + + 1 + + + + + true + + + * + + Dockur + Windows for Docker + 24/7 + + Dockur + https://github.com/dockur/windows/issues + + Windows for Docker + + + 1 + + + true + true + https://google.com + about:blank + + + true + true + https://google.com + about:blank + + + 0 + + + 1 + + + 0409:00000409 + en-US + en-US + en-US + en-US + + + + + 1 + reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f + Set Network Location to Home + + + + + true + + + true + + + false + + + 0 + + + + + true + all + @FirewallAPI.dll,-28752 + + + + + + + true + + + 1 + + + + + + Docker + Administrators + + + true</PlainText> + </Password> + </LocalAccount> + </LocalAccounts> + <AdministratorPassword> + <Value>password</Value> + <PlainText>true</PlainText> + </AdministratorPassword> + </UserAccounts> + <AutoLogon> + <Username>Docker</Username> + <Enabled>true</Enabled> + <LogonCount>65432</LogonCount> + <Password> + <Value /> + <PlainText>true</PlainText> + </Password> + </AutoLogon> + <Display> + <ColorDepth>32</ColorDepth> + <HorizontalResolution>1920</HorizontalResolution> + <VerticalResolution>1080</VerticalResolution> + </Display> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Home</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + <SkipUserOOBE>true</SkipUserOOBE> + <SkipMachineOOBE>true</SkipMachineOOBE> + </OOBE> + <RegisteredOrganization>Dockur</RegisteredOrganization> + <RegisteredOwner>Windows for Docker</RegisteredOwner> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <Order>1</Order> + <CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "AllowInsecureGuestAuth" /t REG_DWORD /d 1 /f</CommandLine> + <Description>Allow guest access to network shares</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>2</Order> + <CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v LimitBlankPasswordUse /t REG_DWORD /d 0 /f</CommandLine> + <Description>Allow RDP login with blank password</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>3</Order> + <CommandLine>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v "DevicePasswordLessBuildVersion" /t REG_DWORD /d 0 /f</CommandLine> + <Description>Enable option for passwordless sign-in</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>4</Order> + <CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine> + <Description>Password Never Expires</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>5</Order> + <CommandLine>cmd /C POWERCFG -H OFF</CommandLine> + <Description>Disable Hibernation</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>6</Order> + <CommandLine>cmd /C POWERCFG -X -monitor-timeout-ac 0</CommandLine> + <Description>Disable monitor blanking</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>7</Order> + <CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /v "HideFirstRunExperience" /t REG_DWORD /d 1 /f</CommandLine> + <Description>Disable first-run experience in Edge</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>8</Order> + <CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f</CommandLine> + <Description>Show file extensions in Explorer</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>9</Order> + <CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateFileSizePercent" /t REG_DWORD /d 0 /f</CommandLine> + <Description>Zero Hibernation File</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>10</Order> + <CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateEnabled" /t REG_DWORD /d 0 /f</CommandLine> + <Description>Disable Hibernation</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>11</Order> + <CommandLine>cmd /C POWERCFG -X -standby-timeout-ac 0</CommandLine> + <Description>Disable Sleep</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>12</Order> + <CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "fAllowUnlistedRemotePrograms" /t REG_DWORD /d 1 /f</CommandLine> + <Description>Enable RemoteAPP to launch unlisted programs</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>13</Order> + <CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f</CommandLine> + <Description>Remove Search from the Taskbar</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>14</Order> + <CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowTaskViewButton" /t REG_DWORD /d 0 /f</CommandLine> + <Description>Remove Task View from the Taskbar</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>15</Order> + <CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarDa" /t REG_DWORD /d 0 /f</CommandLine> + <Description>Remove Widgets from the Taskbar</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>16</Order> + <CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d 0 /f</CommandLine> + <Description>Remove Chat from the Taskbar</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>17</Order> + <CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /t REG_DWORD /d 1 /f</CommandLine> + <Description>Turn off Windows Update auto download</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>18</Order> + <CommandLine>netsh advfirewall firewall set rule group="@FirewallAPI.dll,-32752" new enable=Yes</CommandLine> + <Description>Enable Network Discovery</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>19</Order> + <CommandLine>netsh advfirewall firewall set rule group="@FirewallAPI.dll,-28502" new enable=Yes</CommandLine> + <Description>Enable File Sharing</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <Order>20</Order> + <CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> + <Description>Execute custom script from the OEM folder if exists</Description> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> +</unattend> diff --git a/readme.md b/readme.md index edb7f66..9492054 100644 --- a/readme.md +++ b/readme.md @@ -211,11 +211,20 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas ### How do I set the product key? - By default, an evaluation version of Windows will be installed, but if you have product key you can add a `KEY` variable like this (before installation): + By default, an evaluation version of Windows will be installed, but if you have a product key you can add a `KEY` variable like this (before installation): ```yaml environment: - KEY: "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + KEY: "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx" + ``` + +### How do I select the edition? + + Windows Server offers a minimalistic Core edition without a GUI. To select those non-standard editions, you can add a `EDITION` variable like this (before installation): + + ```yaml + environment: + EDITION: "core" ``` ### How do I install a custom image? diff --git a/src/define.sh b/src/define.sh index 04cdf82..1b70ad0 100644 --- a/src/define.sh +++ b/src/define.sh @@ -102,6 +102,9 @@ parseVersion() { "16" | "2016" | "win16" | "win2016" | "windows2016" | "windows 2016" ) VERSION="win2016-eval" ;; + "hv" | "hyperv" | "hyper v" | "hyper-v" | "19hv" | "2019hv" | "win2019hv") + VERSION="win2019-hv" + ;; "2012" | "2012r2" | "win2012" | "win2012r2" | "windows2012" | "windows 2012" ) VERSION="win2012r2-eval" ;; @@ -418,6 +421,7 @@ printVersion() { "win95"* ) desc="Windows 95" ;; "win2k"* ) desc="Windows 2000" ;; "winvista"* ) desc="Windows Vista" ;; + "win2019-hv"* ) desc="Hyper-V Server" ;; "win2003"* ) desc="Windows Server 2003" ;; "win2008"* ) desc="Windows Server 2008" ;; "win2012"* ) desc="Windows Server 2012" ;; @@ -462,6 +466,9 @@ printEdition() { *"-education" ) edition="Education" ;; + *"-hv" ) + edition="2019" + ;; *"-iot" | *"-iot-eval" ) edition="LTSC" ;; @@ -483,11 +490,12 @@ printEdition() { "winvista"* ) edition="Business" ;; - "win2025"* | "win2022"* | "win2019"* | "win2016"* ) - edition="Standard" - ;; - "win2012"* | "win2008"* | "win2003"* ) - edition="Standard" + "win2025"* | "win2022"* | "win2019"* | "win2016"* | "win2012"* | "win2008"* | "win2003"* ) + case "${EDITION^^}" in + *"DATACENTER"* ) edition="Datacenter" ;; + "CORE" | "STANDARDCORE" ) edition="Core" ;; + * ) edition="Standard" ;; + esac ;; esac @@ -550,6 +558,9 @@ fromFile() { "tiny10"* | "tiny_10"* ) id="tiny10" ;; + *"_serverhypercore_"* ) + id="win2019${add}-hv" + ;; *"server2025"* | *"server_2025"* ) id="win2025${add}" ;; @@ -605,6 +616,7 @@ fromName() { *"server 2012"* ) id="win2012r2${add}" ;; *"server 2008"* ) id="win2008r2${add}" ;; *"server 2003"* ) id="win2003r2${add}" ;; + *"hyper-v server"* ) id="win2019${add}" ;; esac echo "$id" @@ -648,6 +660,7 @@ getVersion() { "win2025"* | "win2022"* | "win2019"* | "win2016"* | "win2012"* | "win2008"* | "win2003"* ) case "${name,,}" in *" evaluation"* ) id="$id-eval" ;; + *"hyper-v server"* ) id="$id-hv" ;; esac ;; esac @@ -749,6 +762,11 @@ getMido() { sum="6dae072e7f78f4ccab74a45341de0d6e2d45c39be25f1f5920a2ab4f51d7bcbb" url="https://software-download.microsoft.com/download/pr/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso" ;; + "win2019-hv" ) + size=3072712704 + sum="48e9b944518e5bbc80876a9a7ff99716f386f404f4be48dca47e16a66ae7872c" + url="https://software-download.microsoft.com/download/pr/17763.557.190612-0019.rs5_release_svc_refresh_SERVERHYPERCORE_OEM_x64FRE_en-us.ISO" + ;; "win2016-eval" ) size=6972221440 sum="1ce702a578a3cb1ac3d14873980838590f06d5b7101c5daaccbac9d73f1fb50f" @@ -1282,6 +1300,7 @@ prepareInstall() { [ -n "$PASSWORD" ] && password="$PASSWORD" [ -n "$USERNAME" ] && username=$(echo "$USERNAME" | sed 's/[^[:alnum:]@!._-]//g') + # These are not pirated keys, they come from the official MS documentation. if [[ "${driver,,}" == "xp" ]]; then if [[ "${arch,,}" == "x86" ]]; then # Windows XP Professional x86 generic key (no activation, trial-only) diff --git a/src/mido.sh b/src/mido.sh index 9e62f25..df6d147 100644 --- a/src/mido.sh +++ b/src/mido.sh @@ -208,6 +208,9 @@ download_windows_eval() { "win2022-eval" ) enterprise_type="server" windows_version="windows-server-2022" ;; + "win2019-hv" ) + enterprise_type="server" + windows_version="hyper-v-server-2019" ;; "win2019-eval" ) enterprise_type="server" windows_version="windows-server-2019" ;; @@ -335,7 +338,7 @@ getWindows() { "win11${PLATFORM,,}-enterprise"* | "win10${PLATFORM,,}-enterprise"* ) download_windows_eval "$version" "$lang" "$edition" && return 0 ;; - "win2025-eval" | "win2022-eval" | "win2019-eval" | "win2016-eval" | "win2012r2-eval" ) + "win2025-eval" | "win2022-eval" | "win2019-eval" | "win2019-hv" | "win2016-eval" | "win2012r2-eval" ) download_windows_eval "$version" "$lang" "$edition" && return 0 ;; "win7${PLATFORM,,}"* | "win81${PLATFORM,,}-enterprise"* | "win2008r2" )