Merge branch 'gytsto/wait-for-interface-to-be-up' into 'master'

wait for interface to be up

See merge request low-level-hacks/third-party-build/dockur_windows!6
This commit is contained in:
Gytis Stoškevičius 2025-04-08 11:50:56 +00:00
commit 7eddae1316
51 changed files with 1296 additions and 1004 deletions

6
.devcontainer.json Normal file
View file

@ -0,0 +1,6 @@
{
"name": "windows",
"service": "windows",
"forwardPorts": [8006],
"dockerComposeFile": "compose.yml"
}

View file

@ -1,7 +1,7 @@
ARG VERSION_ARG="latest" ARG VERSION_ARG="latest"
FROM scratch AS build-amd64 FROM scratch AS build-amd64
COPY --from=qemux/qemu-docker:6.13 / / COPY --from=qemux/qemu:7.10 / /
ARG DEBCONF_NOWARNINGS="yes" ARG DEBCONF_NOWARNINGS="yes"
ARG DEBIAN_FRONTEND="noninteractive" ARG DEBIAN_FRONTEND="noninteractive"
@ -10,19 +10,14 @@ ARG DEBCONF_NONINTERACTIVE_SEEN="true"
RUN set -eu && \ RUN set -eu && \
apt-get update && \ apt-get update && \
apt-get --no-install-recommends -y install \ apt-get --no-install-recommends -y install \
bc \
jq \
curl \
7zip \
wsdd \ wsdd \
samba \ samba \
xz-utils \
wimtools \ wimtools \
dos2unix \ dos2unix \
cabextract \ cabextract \
genisoimage \
libxml2-utils \ libxml2-utils \
libarchive-tools && \ libarchive-tools \
netcat-openbsd && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

View file

@ -415,6 +415,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -418,6 +418,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -424,6 +424,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -421,6 +421,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -418,6 +418,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -102,6 +102,10 @@
<Order>4</Order> <Order>4</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand> </RunSynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>5</Order>
<Path>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\msiserver" /v Start /t REG_DWORD /d 2 /f</Path>
</SynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
</settings> </settings>
@ -264,6 +268,11 @@
<Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path>
<Description>Set Network Location to Home</Description> <Description>Set Network Location to Home</Description>
</RunSynchronousCommand> </RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>26</Order>
<Path>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</Path>
<Description>Install VirtIO display driver</Description>
</RunSynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
@ -443,19 +452,29 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</CommandLine>
<Description>Install VirtIO display driver</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C rd /q C:\Windows.old</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>24</Order> <Order>24</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <CommandLine>cmd /C if exist "C:\OEM\install.bat" cmd /C C:\OEM\install.bat</CommandLine>
<Description>Execute custom script from the OEM folder if exists</Description> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>25</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "IPAutoconfigurationEnabled" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable ip autoconfiguration for network interfaces</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>26</Order>
<CommandLine>cmd /C "type nul > \\host.lan\Data\prepared"</CommandLine>
<Description>Let host known that all configuration is done</Description>
</SynchronousCommand>
</FirstLogonCommands> </FirstLogonCommands>
</component> </component>
</settings> </settings>

View file

@ -105,6 +105,10 @@
<Order>4</Order> <Order>4</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand> </RunSynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>5</Order>
<Path>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\msiserver" /v Start /t REG_DWORD /d 2 /f</Path>
</SynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
</settings> </settings>
@ -267,6 +271,11 @@
<Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path>
<Description>Set Network Location to Home</Description> <Description>Set Network Location to Home</Description>
</RunSynchronousCommand> </RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>26</Order>
<Path>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</Path>
<Description>Install VirtIO display driver</Description>
</RunSynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
@ -446,21 +455,30 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</CommandLine>
<Description>Install VirtIO display driver</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C rd /q C:\Windows.old</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>24</Order> <Order>24</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <CommandLine>cmd /C if exist "C:\OEM\install.bat" cmd /C C:\OEM\install.bat</CommandLine>
<Description>Execute custom script from the OEM folder if exists</Description> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>25</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "IPAutoconfigurationEnabled" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable ip autoconfiguration for network interfaces</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>26</Order>
<CommandLine>cmd /C "type nul > \\host.lan\Data\prepared"</CommandLine>
<Description>Let host known that all configuration is done</Description>
</SynchronousCommand>
</FirstLogonCommands> </FirstLogonCommands>
</component> </component>
</settings> </settings>
</unattend> </unattend>

View file

@ -105,6 +105,10 @@
<Order>4</Order> <Order>4</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand> </RunSynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>5</Order>
<Path>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\msiserver" /v Start /t REG_DWORD /d 2 /f</Path>
</SynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
</settings> </settings>
@ -267,6 +271,11 @@
<Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path>
<Description>Set Network Location to Home</Description> <Description>Set Network Location to Home</Description>
</RunSynchronousCommand> </RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>26</Order>
<Path>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</Path>
<Description>Install VirtIO display driver</Description>
</RunSynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
@ -446,19 +455,29 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</CommandLine>
<Description>Install VirtIO display driver</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C rd /q C:\Windows.old</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>24</Order> <Order>24</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <CommandLine>cmd /C if exist "C:\OEM\install.bat" cmd /C C:\OEM\install.bat</CommandLine>
<Description>Execute custom script from the OEM folder if exists</Description> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>25</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "IPAutoconfigurationEnabled" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable ip autoconfiguration for network interfaces</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>26</Order>
<CommandLine>cmd /C "type nul > \\host.lan\Data\prepared"</CommandLine>
<Description>Let host known that all configuration is done</Description>
</SynchronousCommand>
</FirstLogonCommands> </FirstLogonCommands>
</component> </component>
</settings> </settings>

View file

@ -105,6 +105,10 @@
<Order>4</Order> <Order>4</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand> </RunSynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>5</Order>
<Path>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\msiserver" /v Start /t REG_DWORD /d 2 /f</Path>
</SynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
</settings> </settings>
@ -267,6 +271,11 @@
<Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path>
<Description>Set Network Location to Home</Description> <Description>Set Network Location to Home</Description>
</RunSynchronousCommand> </RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>26</Order>
<Path>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</Path>
<Description>Install VirtIO display driver</Description>
</RunSynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
@ -446,19 +455,29 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</CommandLine>
<Description>Install VirtIO display driver</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C rd /q C:\Windows.old</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>24</Order> <Order>24</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <CommandLine>cmd /C if exist "C:\OEM\install.bat" cmd /C C:\OEM\install.bat</CommandLine>
<Description>Execute custom script from the OEM folder if exists</Description> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>25</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "IPAutoconfigurationEnabled" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable ip autoconfiguration for network interfaces</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>26</Order>
<CommandLine>cmd /C "type nul > \\host.lan\Data\prepared"</CommandLine>
<Description>Let host known that all configuration is done</Description>
</SynchronousCommand>
</FirstLogonCommands> </FirstLogonCommands>
</component> </component>
</settings> </settings>

View file

@ -105,6 +105,10 @@
<Order>4</Order> <Order>4</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand> </RunSynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>5</Order>
<Path>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\msiserver" /v Start /t REG_DWORD /d 2 /f</Path>
</SynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
</settings> </settings>
@ -267,6 +271,11 @@
<Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path>
<Description>Set Network Location to Home</Description> <Description>Set Network Location to Home</Description>
</RunSynchronousCommand> </RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>26</Order>
<Path>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</Path>
<Description>Install VirtIO display driver</Description>
</RunSynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
@ -446,19 +455,29 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</CommandLine>
<Description>Install VirtIO display driver</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C rd /q C:\Windows.old</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>24</Order> <Order>24</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <CommandLine>cmd /C if exist "C:\OEM\install.bat" cmd /C C:\OEM\install.bat</CommandLine>
<Description>Execute custom script from the OEM folder if exists</Description> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>25</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "IPAutoconfigurationEnabled" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable ip autoconfiguration for network interfaces</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>26</Order>
<CommandLine>cmd /C "type nul > \\host.lan\Data\prepared"</CommandLine>
<Description>Let host known that all configuration is done</Description>
</SynchronousCommand>
</FirstLogonCommands> </FirstLogonCommands>
</component> </component>
</settings> </settings>

View file

@ -290,6 +290,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>19</Order> <Order>19</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</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> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -293,6 +293,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>19</Order> <Order>19</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</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> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -308,6 +308,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>16</Order> <Order>16</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>17</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -311,6 +311,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>16</Order> <Order>16</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>17</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -328,6 +328,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -331,6 +331,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -332,6 +332,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -8,6 +8,7 @@
<InputLocale>0409:00000409</InputLocale> <InputLocale>0409:00000409</InputLocale>
<SystemLocale>en-US</SystemLocale> <SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage> <UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>en-US</UserLocale> <UserLocale>en-US</UserLocale>
</component> </component>
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
@ -61,10 +62,17 @@
</DiskConfiguration> </DiskConfiguration>
<ImageInstall> <ImageInstall>
<OSImage> <OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/NAME</Key>
<Value>Hyper-V Server 2019 SERVERHYPERCORE</Value>
</MetaData>
</InstallFrom>
<InstallTo> <InstallTo>
<DiskID>0</DiskID> <DiskID>0</DiskID>
<PartitionID>3</PartitionID> <PartitionID>3</PartitionID>
</InstallTo> </InstallTo>
<WillShowUI>OnError</WillShowUI>
<InstallToAvailablePartition>false</InstallToAvailablePartition> <InstallToAvailablePartition>false</InstallToAvailablePartition>
</OSImage> </OSImage>
</ImageInstall> </ImageInstall>
@ -80,36 +88,11 @@
<AcceptEula>true</AcceptEula> <AcceptEula>true</AcceptEula>
<FullName>Docker</FullName> <FullName>Docker</FullName>
<Organization>Windows for Docker</Organization> <Organization>Windows for Docker</Organization>
<ProductKey>
<Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
</ProductKey>
</UserData> </UserData>
<EnableFirewall>false</EnableFirewall> <EnableFirewall>false</EnableFirewall>
<Diagnostics> <Diagnostics>
<OptIn>false</OptIn> <OptIn>false</OptIn>
</Diagnostics> </Diagnostics>
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>5</Order>
<Path>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\msiserver" /v Start /t REG_DWORD /d 2 /f</Path>
</SynchronousCommand>
</RunSynchronous>
</component> </component>
</settings> </settings>
<settings pass="offlineServicing"> <settings pass="offlineServicing">
@ -166,113 +149,29 @@
<InputLocale>0409:00000409</InputLocale> <InputLocale>0409:00000409</InputLocale>
<SystemLocale>en-US</SystemLocale> <SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage> <UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>en-US</UserLocale> <UserLocale>en-US</UserLocale>
</component> </component>
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<RunSynchronous> <RunSynchronous>
<RunSynchronousCommand wcm:action="add"> <RunSynchronousCommand wcm:action="add">
<Order>1</Order> <Order>1</Order>
<Path>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v BypassNRO /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Path>reg.exe load "HKU\mount" "C:\Users\Default\NTUSER.DAT"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "ContentDeliveryAllowed" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "FeatureManagementEnabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>5</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "OEMPreInstalledAppsEnabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>6</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "PreInstalledAppsEnabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>7</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "PreInstalledAppsEverEnabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>8</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>9</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SoftLandingEnabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>10</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContentEnabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>11</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-310093Enabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>12</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338387Enabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>13</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338388Enabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>14</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>15</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338393Enabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>16</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-353698Enabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>17</Order>
<Path>reg.exe add "HKU\mount\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>18</Order>
<Path>reg.exe add "HKU\mount\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableCloudOptimizedContent" /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>19</Order>
<Path>reg.exe add "HKU\mount\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>20</Order>
<Path>reg.exe add "HKU\mount\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableConsumerAccountStateContent" /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>21</Order>
<Path>reg.exe unload "HKU\mount"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>22</Order>
<Path>reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableCloudOptimizedContent" /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>23</Order>
<Path>reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>24</Order>
<Path>reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableConsumerAccountStateContent" /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>25</Order>
<Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path>
<Description>Set Network Location to Home</Description> <Description>Set Network Location to Home</Description>
</RunSynchronousCommand> </RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Path>dism.exe /online /Disable-Feature /FeatureName:Microsoft-Hyper-V /NoRestart</Path>
<Description>Disable Hyper-V role</Description>
</RunSynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
<component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
</component>
<component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
</component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<fDenyTSConnections>false</fDenyTSConnections> <fDenyTSConnections>false</fDenyTSConnections>
</component> </component>
@ -289,8 +188,6 @@
</FirewallGroups> </FirewallGroups>
</component> </component>
</settings> </settings>
<settings pass="auditSystem" />
<settings pass="auditUser" />
<settings pass="oobeSystem"> <settings pass="oobeSystem">
<component name="Microsoft-Windows-SecureStartup-FilterDriver" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-SecureStartup-FilterDriver" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<PreventDeviceEncryption>true</PreventDeviceEncryption> <PreventDeviceEncryption>true</PreventDeviceEncryption>
@ -350,64 +247,64 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>2</Order> <Order>2</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "RequireSecuritySignature" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable SMB signing requirement</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>3</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v LimitBlankPasswordUse /t REG_DWORD /d 0 /f</CommandLine> <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> <Description>Allow RDP login with blank password</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>4</Order> <Order>3</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v "DevicePasswordLessBuildVersion" /t REG_DWORD /d 0 /f</CommandLine> <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> <Description>Enable option for passwordless sign-in</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>5</Order> <Order>4</Order>
<CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine> <CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine>
<Description>Password Never Expires</Description> <Description>Password Never Expires</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>6</Order> <Order>5</Order>
<CommandLine>cmd /C POWERCFG -H OFF</CommandLine> <CommandLine>cmd /C POWERCFG -H OFF</CommandLine>
<Description>Disable Hibernation</Description> <Description>Disable Hibernation</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>7</Order> <Order>6</Order>
<CommandLine>cmd /C POWERCFG -X -monitor-timeout-ac 0</CommandLine> <CommandLine>cmd /C POWERCFG -X -monitor-timeout-ac 0</CommandLine>
<Description>Disable monitor blanking</Description> <Description>Disable monitor blanking</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>8</Order> <Order>7</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /v "HideFirstRunExperience" /t REG_DWORD /d 1 /f</CommandLine> <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> <Description>Disable first-run experience in Edge</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>9</Order> <Order>8</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f</CommandLine> <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> <Description>Show file extensions in Explorer</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>10</Order> <Order>9</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateFileSizePercent" /t REG_DWORD /d 0 /f</CommandLine> <CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateFileSizePercent" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Zero Hibernation File</Description> <Description>Zero Hibernation File</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>11</Order> <Order>10</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateEnabled" /t REG_DWORD /d 0 /f</CommandLine> <CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateEnabled" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable Hibernation</Description> <Description>Disable Hibernation</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>12</Order> <Order>11</Order>
<CommandLine>cmd /C POWERCFG -X -standby-timeout-ac 0</CommandLine> <CommandLine>cmd /C POWERCFG -X -standby-timeout-ac 0</CommandLine>
<Description>Disable Sleep</Description> <Description>Disable Sleep</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>13</Order> <Order>12</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "fAllowUnlistedRemotePrograms" /t REG_DWORD /d 1 /f</CommandLine> <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> <Description>Enable RemoteAPP to launch unlisted programs</Description>
</SynchronousCommand> </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"> <SynchronousCommand wcm:action="add">
<Order>14</Order> <Order>14</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowTaskViewButton" /t REG_DWORD /d 0 /f</CommandLine> <CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowTaskViewButton" /t REG_DWORD /d 0 /f</CommandLine>
@ -440,39 +337,14 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>reg.exe add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v SV1 /d 0 /t REG_DWORD /f</CommandLine> <CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Disable unsupported hardware notifications</Description> <Description>Add entry in hosts file</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>21</Order> <Order>21</Order>
<CommandLine>reg.exe add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v SV2 /d 0 /t REG_DWORD /f</CommandLine> <CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine>
<Description>Disable unsupported hardware notifications</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>22</Order>
<CommandLine>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</CommandLine>
<Description>Install VirtIO display driver</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>24</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" cmd /C C:\OEM\install.bat</CommandLine>
<Description>Execute custom script from the OEM folder if exists</Description> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>25</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "IPAutoconfigurationEnabled" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable ip autoconfiguration for network interfaces</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>26</Order>
<CommandLine>cmd /C "type nul > \\host.lan\Data\prepared"</CommandLine>
<Description>Let host known that all configuration is done</Description>
</SynchronousCommand>
</FirstLogonCommands> </FirstLogonCommands>
</component> </component>
</settings> </settings>

View file

@ -335,6 +335,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -332,6 +332,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -335,6 +335,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>20</Order> <Order>20</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -159,6 +159,11 @@
<Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path>
<Description>Set Network Location to Home</Description> <Description>Set Network Location to Home</Description>
</RunSynchronousCommand> </RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Path>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</Path>
<Description>Install VirtIO display driver</Description>
</RunSynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
<component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
@ -337,13 +342,13 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>21</Order> <Order>21</Order>
<CommandLine>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Install VirtIO display driver</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>cmd /C rd /q C:\Windows.old</CommandLine> <CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Add entry in hosts file</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>23</Order> <Order>23</Order>

View file

@ -162,6 +162,11 @@
<Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path> <Path>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 1 /f</Path>
<Description>Set Network Location to Home</Description> <Description>Set Network Location to Home</Description>
</RunSynchronousCommand> </RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Path>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</Path>
<Description>Install VirtIO display driver</Description>
</RunSynchronousCommand>
</RunSynchronous> </RunSynchronous>
</component> </component>
<component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
@ -340,13 +345,13 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>21</Order> <Order>21</Order>
<CommandLine>pnputil -i -a C:\Windows\Drivers\viogpudo\viogpudo.inf</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Install VirtIO display driver</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>cmd /C rd /q C:\Windows.old</CommandLine> <CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Add entry in hosts file</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>23</Order> <Order>23</Order>

View file

@ -0,0 +1,288 @@
<?xml version="1.0" encoding="UTF-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>0409:00000409</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">
<DiskConfiguration>
<WillShowUI>OnError</WillShowUI>
<Disk wcm:action="add">
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
<Size>100</Size>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>2</Order>
<Type>Primary</Type>
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Format>NTFS</Format>
<Label>System Reserved</Label>
<Order>1</Order>
<Active>true</Active>
<PartitionID>1</PartitionID>
<TypeID>0x27</TypeID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Format>NTFS</Format>
<Label>Windows</Label>
<Letter>C</Letter>
<Order>2</Order>
<PartitionID>2</PartitionID>
</ModifyPartition>
</ModifyPartitions>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Value>Windows 7 Enterprise</Value>
<Key>/IMAGE/NAME</Key>
</MetaData>
</InstallFrom>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>2</PartitionID>
</InstallTo>
<InstallToAvailablePartition>false</InstallToAvailablePartition>
</OSImage>
</ImageInstall>
<DynamicUpdate>
<Enable>true</Enable>
<WillShowUI>Never</WillShowUI>
</DynamicUpdate>
<UpgradeData>
<Upgrade>false</Upgrade>
<WillShowUI>Never</WillShowUI>
</UpgradeData>
<UserData>
<AcceptEula>true</AcceptEula>
<FullName>Docker</FullName>
<Organization>Windows for Docker</Organization>
</UserData>
<EnableFirewall>false</EnableFirewall>
<Diagnostics>
<OptIn>false</OptIn>
</Diagnostics>
</component>
</settings>
<settings pass="offlineServicing">
<component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<EnableLUA>false</EnableLUA>
</component>
</settings>
<settings pass="generalize">
<component name="Microsoft-Windows-PnPSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
</component>
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SkipRearm>1</SkipRearm>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<ComputerName>*</ComputerName>
<OEMInformation>
<Manufacturer>Dockur</Manufacturer>
<Model>Windows for Docker</Model>
</OEMInformation>
</component>
<component name="Microsoft-Windows-ErrorReportingCore" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<DisableWER>1</DisableWER>
</component>
<component name="Microsoft-Windows-IE-InternetExplorer" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<DisableAccelerators>true</DisableAccelerators>
<DisableFirstRunWizard>true</DisableFirstRunWizard>
<Home_Page>https://google.com</Home_Page>
<Help_Page>about:blank</Help_Page>
</component>
<component name="Microsoft-Windows-IE-InternetExplorer" processorArchitecture="wow64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<DisableAccelerators>true</DisableAccelerators>
<DisableFirstRunWizard>true</DisableFirstRunWizard>
<Home_Page>https://google.com</Home_Page>
<Help_Page>about:blank</Help_Page>
</component>
<component name="Microsoft-Windows-SQMApi" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<CEIPEnabled>0</CEIPEnabled>
</component>
<component name="Microsoft-Windows-SystemRestore-Main" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<DisableSR>1</DisableSR>
</component>
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<InputLocale>0409:00000409</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-US</UserLocale>
</component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<fDenyTSConnections>false</fDenyTSConnections>
</component>
<component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<UserAuthentication>0</UserAuthentication>
</component>
<component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<FirewallGroups>
<FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
<Active>true</Active>
<Profile>all</Profile>
<Group>@FirewallAPI.dll,-28752</Group>
</FirewallGroup>
</FirewallGroups>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Name>Docker</Name>
<Group>Administrators</Group>
<Password>
<Value />
<PlainText>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>
<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>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine>
<Description>Password Never Expires</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>4</Order>
<CommandLine>cmd /C POWERCFG -H OFF</CommandLine>
<Description>Disable Hibernation</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>5</Order>
<CommandLine>cmd /C POWERCFG -X -monitor-timeout-ac 0</CommandLine>
<Description>Disable monitor blanking</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>6</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff" /f</CommandLine>
<Description>Disable Network Discovery popup</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>7</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Network\NetworkLocationWizard" /v "HideWizard" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Disable Network Discovery popup</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>8</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\NewNetworks" /v NetworkList /t REG_MULTI_SZ /d "" /f</CommandLine>
<Description>Disable Network Discovery popup</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>9</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>10</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>11</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>12</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>13</Order>
<CommandLine>cmd /C POWERCFG -X -standby-timeout-ac 0</CommandLine>
<Description>Disable Sleep</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>14</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>15</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>16</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>17</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>18</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>

View file

@ -278,6 +278,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>17</Order> <Order>17</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>18</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -278,6 +278,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>17</Order> <Order>17</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>18</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -278,6 +278,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>17</Order> <Order>17</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>18</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -278,6 +278,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>17</Order> <Order>17</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>18</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -278,6 +278,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>17</Order> <Order>17</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>18</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -278,6 +278,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>17</Order> <Order>17</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>18</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -293,6 +293,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>16</Order> <Order>16</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>17</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -296,6 +296,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>16</Order> <Order>16</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>17</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -303,6 +303,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>16</Order> <Order>16</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>17</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -252,6 +252,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -252,6 +252,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -252,6 +252,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -252,6 +252,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -252,6 +252,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -252,6 +252,11 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>cmd /C echo 20.20.20.1 host.lan >> %WINDIR%\system32\drivers\etc\hosts</CommandLine>
<Description>Add entry in hosts file</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /C if exist "C:\OEM\install.bat" start "Install" "cmd /C C:\OEM\install.bat"</CommandLine> <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> <Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand> </SynchronousCommand>

View file

@ -16,23 +16,28 @@ services:
DISK_FMT: "qcow2" DISK_FMT: "qcow2"
NETWORK: "Y" NETWORK: "Y"
DEBUG: "Y" DEBUG: "Y"
COMMIT: "Y"
devices: devices:
- /dev/kvm - /dev/kvm
- /dev/net/tun - /dev/net/tun
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
ports:
- 8006:8006
- 3389:3389/tcp
- 3389:3389/udp
restart: always
stop_grace_period: 2m stop_grace_period: 2m
volumes: volumes:
- ./windows:/storage
- ./scripts:/oem - ./scripts:/oem
- ./custom.xml:/custom.xml
- ./custom.iso:/custom.iso
windows-installed: windows-installed:
image: $IMAGE_NAME:$IMAGE_VERSION image: $IMAGE_NAME:$IMAGE_VERSION
container_name: windows-installed container_name: windows-installed
privileged: true privileged: true
healthcheck: healthcheck:
test: "[ -f /storage/ready ] || exit 1" test: "[ -f /local/ready ] || exit 1"
interval: 30s interval: 30s
retries: 20 retries: 20
start_period: 60s start_period: 60s
@ -46,4 +51,9 @@ services:
- /dev/net/tun - /dev/net/tun
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
ports:
- 8006:8006
- 3389:3389/tcp
- 3389:3389/udp
restart: always
stop_grace_period: 2m stop_grace_period: 2m

View file

@ -10,68 +10,91 @@ spec:
requests: requests:
storage: 64Gi storage: 64Gi
--- ---
apiVersion: v1 apiVersion: apps/v1
kind: Pod kind: Deployment
metadata: metadata:
name: windows name: windows
labels: labels:
name: windows name: windows
spec: spec:
containers: replicas: 1
- name: windows selector:
image: dockurr/windows matchLabels:
env: app: windows
- name: VERSION template:
value: "11" metadata:
- name: RAM_SIZE labels:
value: "4G" app: windows
- name: CPU_CORES spec:
value: "2" containers:
- name: DISK_SIZE - name: windows
value: "64G" image: dockurr/windows
ports: env:
- containerPort: 8006 - name: VERSION
- containerPort: 3389 value: "11"
- containerPort: 3389 - name: DISK_SIZE
protocol: UDP value: "64G"
securityContext: ports:
capabilities: - containerPort: 8006
add: name: http
- NET_ADMIN protocol: TCP
privileged: true - containerPort: 3389
volumeMounts: name: rdp
- mountPath: /storage protocol: TCP
name: storage - containerPort: 3389
- mountPath: /dev/kvm name: udp
name: dev-kvm protocol: UDP
- mountPath: /dev/net/tun - containerPort: 5900
name: dev-tun name: vnc
terminationGracePeriodSeconds: 120 protocol: TCP
volumes: securityContext:
- name: storage capabilities:
persistentVolumeClaim: add:
claimName: windows-pvc - NET_ADMIN
- hostPath: privileged: true
path: /dev/kvm volumeMounts:
name: dev-kvm - mountPath: /storage
- hostPath: name: storage
path: /dev/net/tun - mountPath: /dev/kvm
type: CharDevice name: dev-kvm
name: dev-tun - mountPath: /dev/net/tun
name: dev-tun
terminationGracePeriodSeconds: 120
volumes:
- name: storage
persistentVolumeClaim:
claimName: windows-pvc
- hostPath:
path: /dev/kvm
name: dev-kvm
- hostPath:
path: /dev/net/tun
type: CharDevice
name: dev-tun
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: windows name: windows
spec: spec:
internalTrafficPolicy: Cluster
ports: ports:
- name: tcp-8006 - name: http
port: 8006 port: 8006
- name: tcp-3389 protocol: TCP
port: 3389 targetPort: 8006
- name: udp-3389 - name: rdp
port: 3389 port: 3389
protocol: UDP protocol: TCP
targetPort: 3389
- name: udp
port: 3389
protocol: UDP
targetPort: 3389
- name: vnc
port: 5900
protocol: TCP
targetPort: 5900
selector: selector:
name: windows app: windows
type: NodePort type: ClusterIP

View file

@ -4,7 +4,7 @@ set -Eeuo pipefail
source env.sh source env.sh
echo "start to build and install windows" echo "start to build and install windows"
docker compose up windows-build -d --build docker compose up windows-build -d --build --force-recreate
echo "streaming logs..." echo "streaming logs..."
docker logs -f windows-build | tee windows-build.log & docker logs -f windows-build | tee windows-build.log &

220
readme.md
View file

@ -26,7 +26,7 @@ Windows inside a Docker container.
## Usage 🐳 ## Usage 🐳
Via Docker Compose: ##### Via Docker Compose:
```yaml ```yaml
services: services:
@ -44,30 +44,27 @@ services:
- 8006:8006 - 8006:8006
- 3389:3389/tcp - 3389:3389/tcp
- 3389:3389/udp - 3389:3389/udp
volumes:
- ./windows:/storage
restart: always
stop_grace_period: 2m stop_grace_period: 2m
``` ```
Via Docker CLI: ##### Via Docker CLI:
```bash ```bash
docker run -it --rm -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN --stop-timeout 120 dockurr/windows docker run -it --rm --name windows -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v ${PWD:-.}/windows:/storage --stop-timeout 120 dockurr/windows
``` ```
Via Kubernetes: ##### Via Kubernetes:
```shell ```shell
kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/master/kubernetes.yml kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/master/kubernetes.yml
``` ```
## Compatibility ⚙️ ##### Via Github Codespaces:
| **Product** | **Platform** | | [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/dockur/windows)
|---|---|---|
| Docker Engine | Linux| ✅ |
| Docker Desktop | Linux | ❌ |
| Docker Desktop | macOS | ❌ |
| Docker Desktop | Windows 11 | ✅ |
| Docker Desktop | Windows 10 | ❌ |
## FAQ 💬 ## FAQ 💬
@ -75,7 +72,7 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
Very simple! These are the steps: Very simple! These are the steps:
- Start the container and connect to [port 8006](http://localhost:8006) using your web browser. - Start the container and connect to [port 8006](http://127.0.0.1:8006/) using your web browser.
- Sit back and relax while the magic happens, the whole installation will be performed fully automatic. - Sit back and relax while the magic happens, the whole installation will be performed fully automatic.
@ -94,28 +91,29 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
Select from the values below: Select from the values below:
| **Value** | **Version** | **Size** | | **Value** | **Version** | **Size** |
|---|---|---| |---|---|---|
| `11` | Windows 11 Pro | 5.4 GB | | `11` | Windows 11 Pro | 5.4 GB |
| `11l` | Windows 11 LTSC | 4.2 GB | | `11l` | Windows 11 LTSC | 4.7 GB |
| `11e` | Windows 11 Enterprise | 5.8 GB | | `11e` | Windows 11 Enterprise | 4.0 GB |
|||| ||||
| `10` | Windows 10 Pro | 5.7 GB | | `10` | Windows 10 Pro | 5.7 GB |
| `10l` | Windows 10 LTSC | 4.6 GB | | `10l` | Windows 10 LTSC | 4.6 GB |
| `10e` | Windows 10 Enterprise | 5.2 GB | | `10e` | Windows 10 Enterprise | 5.2 GB |
|||| ||||
| `8e` | Windows 8.1 Enterprise | 3.7 GB | | `8e` | Windows 8.1 Enterprise | 3.7 GB |
| `7e` | Windows 7 Enterprise | 3.0 GB | | `7e` | Windows 7 Enterprise | 3.0 GB |
| `ve` | Windows Vista Enterprise | 3.0 GB | | `ve` | Windows Vista Enterprise | 3.0 GB |
| `xp` | Windows XP Professional | 0.6 GB | | `xp` | Windows XP Professional | 0.6 GB |
|||| | `2k` | Windows 2000 Professional | 0.4 GB |
| `2025` | Windows Server 2025 | 5.0 GB | ||||
| `2022` | Windows Server 2022 | 4.7 GB | | `2025` | Windows Server 2025 | 5.6 GB |
| `2019` | Windows Server 2019 | 5.3 GB | | `2022` | Windows Server 2022 | 4.7 GB |
| `2016` | Windows Server 2016 | 6.5 GB | | `2019` | Windows Server 2019 | 5.3 GB |
| `2012` | Windows Server 2012 | 4.3 GB | | `2016` | Windows Server 2016 | 6.5 GB |
| `2008` | Windows Server 2008 | 3.0 GB | | `2012` | Windows Server 2012 | 4.3 GB |
| `2003` | Windows Server 2003 | 0.6 GB | | `2008` | Windows Server 2008 | 3.0 GB |
| `2003` | Windows Server 2003 | 0.6 GB |
> [!TIP] > [!TIP]
> To install ARM64 versions of Windows use [dockur/windows-arm](https://github.com/dockur/windows-arm/). > To install ARM64 versions of Windows use [dockur/windows-arm](https://github.com/dockur/windows-arm/).
@ -126,10 +124,10 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
```yaml ```yaml
volumes: volumes:
- /var/win:/storage - ./windows:/storage
``` ```
Replace the example path `/var/win` with the desired storage folder. Replace the example path `./windows` with the desired storage folder or named volume.
### How do I change the size of the disk? ### How do I change the size of the disk?
@ -145,60 +143,20 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
### How do I share files with the host? ### How do I share files with the host?
Open 'File Explorer' and click on the 'Network' section, you will see a computer called `host.lan`. Double-click it and it will show a folder called `Data`, which can be bound to any folder on your host via the compose file: Open 'File Explorer' and click on the 'Network' section, you will see a computer called `host.lan`.
Double-click it and it will show a folder called `Data`, which can be bound to any folder on your host via the compose file:
```yaml ```yaml
volumes: volumes:
- /home/user/example:/data - ./example:/data
``` ```
The example folder `/home/user/example` will be available as ` \\host.lan\Data`. The example folder `./example` will be available as ` \\host.lan\Data`.
> [!TIP] > [!TIP]
> You can map this path to a drive letter in Windows, for easier access. > You can map this path to a drive letter in Windows, for easier access.
### How do I install a custom image?
In order to download an unsupported ISO image that is not selectable from the list above, specify the URL of that ISO in the `VERSION` environment variable, for example:
```yaml
environment:
VERSION: "https://example.com/win.iso"
```
Alternatively, you can also skip the download and use a local file instead, by binding it in your compose file in this way:
```yaml
volumes:
- /home/user/example.iso:/custom.iso
```
Replace the example path `/home/user/example.iso` with the filename of your desired ISO file, the value of `VERSION` will be ignored in this case.
### How do I run a script after installation?
To run your own script after installation, you can create a file called `install.bat` and place it in a folder together with any additional files it needs (software to be installed for example).
Then bind that folder in your compose file like this:
```yaml
volumes:
- /home/user/example:/oem
```
The example folder `/home/user/example` will be copied to `C:\OEM` during installation and the containing `install.bat` will be executed during the last step.
### How do I perform a manual installation?
It's best to stick to the automatic installation, as it adjusts various settings to prevent common issues when running Windows inside a virtual environment.
However, if you insist on performing the installation manually, add the following environment variable to your compose file:
```yaml
environment:
MANUAL: "Y"
```
### How do I change the amount of CPU or RAM? ### How do I change the amount of CPU or RAM?
By default, the container will be allowed to use a maximum of 2 CPU cores and 4 GB of RAM. By default, the container will be allowed to use a maximum of 2 CPU cores and 4 GB of RAM.
@ -213,9 +171,9 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
### How do I configure the username and password? ### How do I configure the username and password?
By default, a user called `Docker` is created during the installation, with an empty password. By default, a user called `Docker` is created during installation and its password is `admin`.
If you want to use different credentials, you can change them in your compose file: If you want to use different credentials, you can configure them in your compose file (only before installation):
```yaml ```yaml
environment: environment:
@ -225,7 +183,9 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
### How do I select the Windows language? ### How do I select the Windows language?
By default, the English version of Windows will be downloaded. But you can add the `LANGUAGE` environment variable to your compose file, in order to specify an alternative language: By default, the English version of Windows will be downloaded.
But before installation you can add the `LANGUAGE` environment variable to your compose file, in order to specify an alternative language:
```yaml ```yaml
environment: environment:
@ -236,7 +196,7 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
### How do I select the keyboard layout? ### How do I select the keyboard layout?
If you want to use a keyboard layout or locale that is not the default for your selected language, you can add the `KEYBOARD` and `REGION` variables with a culture code, like this: If you want to use a keyboard layout or locale that is not the default for your selected language, you can add `KEYBOARD` and `REGION` variables like this (before installation):
```yaml ```yaml
environment: environment:
@ -244,15 +204,62 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
KEYBOARD: "en-US" KEYBOARD: "en-US"
``` ```
> [!NOTE] ### How do I select the edition?
> Changing these values will have no effect after the installation has been performed already. Use the control panel inside Windows in that case.
> 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?
In order to download an unsupported ISO image, specify its URL in the `VERSION` environment variable:
```yaml
environment:
VERSION: "https://example.com/win.iso"
```
Alternatively, you can also skip the download and use a local file instead, by binding it in your compose file in this way:
```yaml
volumes:
- ./example.iso:/custom.iso
```
Replace the example path `./example.iso` with the filename of your desired ISO file. The value of `VERSION` will be ignored in this case.
### How do I run a script after installation?
To run your own script after installation, you can create a file called `install.bat` and place it in a folder together with any additional files it needs (software to be installed for example).
Then bind that folder in your compose file like this:
```yaml
volumes:
- ./example:/oem
```
The example folder `./example` will be copied to `C:\OEM` and the containing `install.bat` will be executed during the last step of the automatic installation.
### How do I perform a manual installation?
It's recommended to stick to the automatic installation, as it adjusts various settings to prevent common issues when running Windows inside a virtual environment.
However, if you insist on performing the installation manually at your own risk, add the following environment variable to your compose file:
```yaml
environment:
MANUAL: "Y"
```
### How do I connect using RDP? ### How do I connect using RDP?
The web-viewer is mainly meant to be used during installation, as its picture quality is low, and it has no audio or clipboard for example. The web-viewer is mainly meant to be used during installation, as its picture quality is low, and it has no audio or clipboard for example.
So for a better experience you can connect using any Microsoft Remote Desktop client to the IP of the container, using the username `Docker` and by leaving the password empty. So for a better experience you can connect using any Microsoft Remote Desktop client to the IP of the container, using the username `Docker` and password `admin`.
There is a RDP client for [Android](https://play.google.com/store/apps/details?id=com.microsoft.rdc.androidx) available from the Play Store and one for [iOS](https://apps.apple.com/nl/app/microsoft-remote-desktop/id714464092?l=en-GB) in the Apple Store. For Linux you can use [FreeRDP](https://www.freerdp.com/) and on Windows just type `mstsc` in the search box. There is a RDP client for [Android](https://play.google.com/store/apps/details?id=com.microsoft.rdc.androidx) available from the Play Store and one for [iOS](https://apps.apple.com/nl/app/microsoft-remote-desktop/id714464092?l=en-GB) in the Apple Store. For Linux you can use [FreeRDP](https://www.freerdp.com/) and on Windows just type `mstsc` in the search box.
@ -297,7 +304,7 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
After configuring the container for [macvlan](#how-do-i-assign-an-individual-ip-address-to-the-container), it is possible for Windows to become part of your home network by requesting an IP from your router, just like a real PC. After configuring the container for [macvlan](#how-do-i-assign-an-individual-ip-address-to-the-container), it is possible for Windows to become part of your home network by requesting an IP from your router, just like a real PC.
To enable this mode, add the following lines to your compose file: To enable this mode, in which the container and Windows will have separate IP addresses, add the following lines to your compose file:
```yaml ```yaml
environment: environment:
@ -308,9 +315,6 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
- 'c *:* rwm' - 'c *:* rwm'
``` ```
> [!NOTE]
> In this mode, the container and Windows will each have their own separate IPs.
### How do I add multiple disks? ### How do I add multiple disks?
To create additional disks, modify your compose file like this: To create additional disks, modify your compose file like this:
@ -320,18 +324,18 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
DISK2_SIZE: "32G" DISK2_SIZE: "32G"
DISK3_SIZE: "64G" DISK3_SIZE: "64G"
volumes: volumes:
- /home/example:/storage2 - ./example2:/storage2
- /mnt/data/example:/storage3 - ./example3:/storage3
``` ```
### How do I pass-through a disk? ### How do I pass-through a disk?
It is possible to pass-through disk devices directly by adding them to your compose file in this way: It is possible to pass-through disk devices or partitions directly by adding them to your compose file in this way:
```yaml ```yaml
devices: devices:
- /dev/sdb:/disk1 - /dev/sdb:/disk1
- /dev/sdc:/disk2 - /dev/sdc1:/disk2
``` ```
Use `/disk1` if you want it to become your main drive (which will be formatted during installation), and use `/disk2` and higher to add them as secondary drives (which will stay untouched). Use `/disk1` if you want it to become your main drive (which will be formatted during installation), and use `/disk2` and higher to add them as secondary drives (which will stay untouched).
@ -347,14 +351,20 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
- /dev/bus/usb - /dev/bus/usb
``` ```
> [!IMPORTANT] If the device is a USB disk drive, please wait until after the installation is fully completed before connecting it. Otherwise the installation may fail, as the order of the disks can get rearranged.
> If the device is a USB disk drive, please wait until after the installation is completed before connecting it. Otherwise the installation may fail, as the order of the disks can get rearranged.
### How do I verify if my system supports KVM? ### How do I verify if my system supports KVM?
Only Linux and Windows 11 support KVM virtualization, macOS and Windows 10 do not unfortunately. First check if your software is compatible using this chart:
You can run the following commands in Linux to check your system: | **Product** | **Linux** | **Win11** | **Win10** | **macOS** |
|---|---|---|---|---|
| Docker CLI | ✅ | ✅ | ❌ | ❌ |
| Docker Desktop | ❌ | ✅ | ❌ | ❌ |
| Podman CLI | ✅ | ✅ | ❌ | ❌ |
| Podman Desktop | ✅ | ✅ | ❌ | ❌ |
After that you can run the following commands in Linux to check your system:
```bash ```bash
sudo apt install cpu-checker sudo apt install cpu-checker
@ -369,16 +379,16 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
- you are not using a cloud provider, as most of them do not allow nested virtualization for their VPS's. - you are not using a cloud provider, as most of them do not allow nested virtualization for their VPS's.
If you do not receive any error from `kvm-ok` but the container still complains about KVM, please check whether: If you did not receive any error from `kvm-ok` but the container still complains about a missing KVM device, it could help to add `privileged: true` to your compose file (or `sudo` to your `docker` command) to rule out any permission issue.
- you are not using "Docker Desktop for Linux" as it does not support KVM, instead make use of Docker Engine directly.
- it could help to add `privileged: true` to your compose file (or `sudo` to your `docker run` command), to rule out any permission issue.
### How do I run macOS in a container? ### How do I run macOS in a container?
You can use [dockur/macos](https://github.com/dockur/macos) for that. It shares many of the same features, except for the automatic installation. You can use [dockur/macos](https://github.com/dockur/macos) for that. It shares many of the same features, except for the automatic installation.
### How do I run a Linux desktop in a container?
You can use [qemus/qemu](https://github.com/qemus/qemu) in that case.
### Is this project legal? ### Is this project legal?
Yes, this project contains only open-source code and does not distribute any copyrighted material. Any product keys found in the code are just generic placeholders provided by Microsoft for trial purposes. So under all applicable laws, this project will be considered legal. Yes, this project contains only open-source code and does not distribute any copyrighted material. Any product keys found in the code are just generic placeholders provided by Microsoft for trial purposes. So under all applicable laws, this project will be considered legal.

View file

@ -1,10 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -Eeuox pipefail set -Eeuox pipefail
: "${KEY:=""}"
: "${WIDTH:=""}" : "${WIDTH:=""}"
: "${HEIGHT:=""}" : "${HEIGHT:=""}"
: "${VERIFY:=""}" : "${VERIFY:=""}"
: "${REGION:=""}" : "${REGION:=""}"
: "${EDITION:=""}"
: "${MANUAL:=""}" : "${MANUAL:=""}"
: "${REMOVE:=""}" : "${REMOVE:=""}"
: "${VERSION:=""}" : "${VERSION:=""}"
@ -15,7 +17,6 @@ set -Eeuox pipefail
: "${PASSWORD:=""}" : "${PASSWORD:=""}"
MIRRORS=3 MIRRORS=3
PLATFORM="x64"
parseVersion() { parseVersion() {
@ -62,7 +63,7 @@ parseVersion() {
;; ;;
"7" | "7e" | "win7" | "win7e" | "windows7" | "windows 7" ) "7" | "7e" | "win7" | "win7e" | "windows7" | "windows 7" )
VERSION="win7x64" VERSION="win7x64"
[ -z "$DETECTED" ] && DETECTED="win7x64-enterprise" [ -z "$DETECTED" ] && DETECTED="win7x64-enterprise-eval"
;; ;;
"7u" | "win7u" | "windows7u" | "windows 7u" ) "7u" | "win7u" | "windows7u" | "windows 7u" )
VERSION="win7x64-ultimate" VERSION="win7x64-ultimate"
@ -88,6 +89,9 @@ parseVersion() {
"xp64" | "xpx64" | "5x64" | "winxp64" | "winxpx64" | "windowsxp64" | "windowsxpx64" ) "xp64" | "xpx64" | "5x64" | "winxp64" | "winxpx64" | "windowsxp64" | "windowsxpx64" )
VERSION="winxpx64" VERSION="winxpx64"
;; ;;
"2k" | "2000" | "win2k" | "win2000" | "windows2k" | "windows2000" )
VERSION="win2kx86"
;;
"25" | "2025" | "win25" | "win2025" | "windows2025" | "windows 2025" ) "25" | "2025" | "win25" | "win2025" | "windows2025" | "windows 2025" )
VERSION="win2025-eval" VERSION="win2025-eval"
;; ;;
@ -100,6 +104,9 @@ parseVersion() {
"16" | "2016" | "win16" | "win2016" | "windows2016" | "windows 2016" ) "16" | "2016" | "win16" | "win2016" | "windows2016" | "windows 2016" )
VERSION="win2016-eval" VERSION="win2016-eval"
;; ;;
"hv" | "hyperv" | "hyper v" | "hyper-v" | "19hv" | "2019hv" | "win2019hv" )
VERSION="win2019-hv"
;;
"2012" | "2012r2" | "win2012" | "win2012r2" | "windows2012" | "windows 2012" ) "2012" | "2012r2" | "win2012" | "win2012r2" | "windows2012" | "windows 2012" )
VERSION="win2012r2-eval" VERSION="win2012r2-eval"
;; ;;
@ -416,6 +423,7 @@ printVersion() {
"win95"* ) desc="Windows 95" ;; "win95"* ) desc="Windows 95" ;;
"win2k"* ) desc="Windows 2000" ;; "win2k"* ) desc="Windows 2000" ;;
"winvista"* ) desc="Windows Vista" ;; "winvista"* ) desc="Windows Vista" ;;
"win2019-hv"* ) desc="Hyper-V Server" ;;
"win2003"* ) desc="Windows Server 2003" ;; "win2003"* ) desc="Windows Server 2003" ;;
"win2008"* ) desc="Windows Server 2008" ;; "win2008"* ) desc="Windows Server 2008" ;;
"win2012"* ) desc="Windows Server 2012" ;; "win2012"* ) desc="Windows Server 2012" ;;
@ -460,6 +468,9 @@ printEdition() {
*"-education" ) *"-education" )
edition="Education" edition="Education"
;; ;;
*"-hv" )
edition="2019"
;;
*"-iot" | *"-iot-eval" ) *"-iot" | *"-iot-eval" )
edition="LTSC" edition="LTSC"
;; ;;
@ -481,11 +492,12 @@ printEdition() {
"winvista"* ) "winvista"* )
edition="Business" edition="Business"
;; ;;
"win2025"* | "win2022"* | "win2019"* | "win2016"* ) "win2025"* | "win2022"* | "win2019"* | "win2016"* | "win2012"* | "win2008"* | "win2003"* )
edition="Standard" case "${EDITION^^}" in
;; *"DATACENTER"* ) edition="Datacenter" ;;
"win2012"* | "win2008"* | "win2003"* ) "CORE" | "STANDARDCORE" ) edition="Core" ;;
edition="Standard" * ) edition="Standard" ;;
esac
;; ;;
esac esac
@ -548,6 +560,9 @@ fromFile() {
"tiny10"* | "tiny_10"* ) "tiny10"* | "tiny_10"* )
id="tiny10" id="tiny10"
;; ;;
*"_serverhypercore_"* )
id="win2019${add}-hv"
;;
*"server2025"* | *"server_2025"* ) *"server2025"* | *"server_2025"* )
id="win2025${add}" id="win2025${add}"
;; ;;
@ -592,7 +607,9 @@ fromName() {
*"windows 7"* ) id="win7${arch}" ;; *"windows 7"* ) id="win7${arch}" ;;
*"windows 8"* ) id="win81${arch}" ;; *"windows 8"* ) id="win81${arch}" ;;
*"windows 10"* ) id="win10${arch}" ;; *"windows 10"* ) id="win10${arch}" ;;
*"optimum 10"* ) id="win10${arch}" ;;
*"windows 11"* ) id="win11${arch}" ;; *"windows 11"* ) id="win11${arch}" ;;
*"optimum 11"* ) id="win11${arch}" ;;
*"windows vista"* ) id="winvista${arch}" ;; *"windows vista"* ) id="winvista${arch}" ;;
*"server 2025"* ) id="win2025${add}" ;; *"server 2025"* ) id="win2025${add}" ;;
*"server 2022"* ) id="win2022${add}" ;; *"server 2022"* ) id="win2022${add}" ;;
@ -601,6 +618,7 @@ fromName() {
*"server 2012"* ) id="win2012r2${add}" ;; *"server 2012"* ) id="win2012r2${add}" ;;
*"server 2008"* ) id="win2008r2${add}" ;; *"server 2008"* ) id="win2008r2${add}" ;;
*"server 2003"* ) id="win2003r2${add}" ;; *"server 2003"* ) id="win2003r2${add}" ;;
*"hyper-v server"* ) id="win2019${add}" ;;
esac esac
echo "$id" echo "$id"
@ -621,6 +639,7 @@ getVersion() {
*" home"* ) id="$id-home" ;; *" home"* ) id="$id-home" ;;
*" starter"* ) id="$id-starter" ;; *" starter"* ) id="$id-starter" ;;
*" ultimate"* ) id="$id-ultimate" ;; *" ultimate"* ) id="$id-ultimate" ;;
*" enterprise evaluation"* ) id="$id-enterprise-eval" ;;
*" enterprise"* ) id="$id-enterprise" ;; *" enterprise"* ) id="$id-enterprise" ;;
esac esac
;; ;;
@ -643,6 +662,7 @@ getVersion() {
"win2025"* | "win2022"* | "win2019"* | "win2016"* | "win2012"* | "win2008"* | "win2003"* ) "win2025"* | "win2022"* | "win2019"* | "win2016"* | "win2012"* | "win2008"* | "win2003"* )
case "${name,,}" in case "${name,,}" in
*" evaluation"* ) id="$id-eval" ;; *" evaluation"* ) id="$id-eval" ;;
*"hyper-v server"* ) id="$id-hv" ;;
esac esac
;; ;;
esac esac
@ -665,6 +685,9 @@ switchEdition() {
"win81${PLATFORM,,}-enterprise-eval" ) "win81${PLATFORM,,}-enterprise-eval" )
DETECTED="win81${PLATFORM,,}-enterprise" DETECTED="win81${PLATFORM,,}-enterprise"
;; ;;
"win7${PLATFORM,,}" | "win7${PLATFORM,,}-enterprise-eval" )
DETECTED="win7${PLATFORM,,}-enterprise"
;;
"win2025-eval" ) DETECTED="win2025" ;; "win2025-eval" ) DETECTED="win2025" ;;
"win2022-eval" ) DETECTED="win2022" ;; "win2022-eval" ) DETECTED="win2022" ;;
"win2019-eval" ) DETECTED="win2019" ;; "win2019-eval" ) DETECTED="win2019" ;;
@ -681,6 +704,7 @@ getMido() {
local id="$1" local id="$1"
local lang="$2" local lang="$2"
local ret="$3" local ret="$3"
local url=""
local sum="" local sum=""
local size="" local size=""
@ -692,16 +716,14 @@ getMido() {
sum="b56b911bf18a2ceaeb3904d87e7c770bdf92d3099599d61ac2497b91bf190b11" sum="b56b911bf18a2ceaeb3904d87e7c770bdf92d3099599d61ac2497b91bf190b11"
;; ;;
"win11x64-enterprise-eval" ) "win11x64-enterprise-eval" )
size=6209064960 size=4295096320
sum="c8dbc96b61d04c8b01faf6ce0794fdf33965c7b350eaa3eb1e6697019902945c" sum="dad633276073f14f3e0373ef7e787569e216d54942ce522b39451c8f2d38ad43"
url="https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1.240331-1435.ge_release_CLIENTENTERPRISEEVAL_OEMRET_A64FRE_en-us.iso"
;; ;;
"win11x64-enterprise-ltsc-eval" ) "win11x64-enterprise-iot-eval" | "win11x64-enterprise-ltsc-eval" )
size=4428627968 size=5060020224
sum="8abf91c9cd408368dc73aab3425d5e3c02dae74900742072eb5c750fc637c195" sum="2cee70bd183df42b92a2e0da08cc2bb7a2a9ce3a3841955a012c0f77aeb3cb29"
;; url="https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1.240331-1435.ge_release_CLIENT_IOT_LTSC_EVAL_x64FRE_en-us.iso"
"win11x64-enterprise-iot-eval" )
size=4428627968
sum="8abf91c9cd408368dc73aab3425d5e3c02dae74900742072eb5c750fc637c195"
;; ;;
"win10x64" ) "win10x64" )
size=6140975104 size=6140975104
@ -710,45 +732,59 @@ getMido() {
"win10x64-enterprise-eval" ) "win10x64-enterprise-eval" )
size=5550497792 size=5550497792
sum="ef7312733a9f5d7d51cfa04ac497671995674ca5e1058d5164d6028f0938d668" sum="ef7312733a9f5d7d51cfa04ac497671995674ca5e1058d5164d6028f0938d668"
url="https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66750/19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso"
;; ;;
"win10x64-enterprise-ltsc-eval" ) "win10x64-enterprise-ltsc-eval" )
size=4898582528 size=4898582528
sum="e4ab2e3535be5748252a8d5d57539a6e59be8d6726345ee10e7afd2cb89fefb5" sum="e4ab2e3535be5748252a8d5d57539a6e59be8d6726345ee10e7afd2cb89fefb5"
url="https://software-download.microsoft.com/download/pr/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso"
;; ;;
"win81x64-enterprise-eval" ) "win81x64-enterprise-eval" )
size=3961473024 size=3961473024
sum="2dedd44c45646c74efc5a028f65336027e14a56f76686a4631cf94ffe37c72f2" sum="2dedd44c45646c74efc5a028f65336027e14a56f76686a4631cf94ffe37c72f2"
url="https://download.microsoft.com/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X64FREE_EN-US_DV9.ISO"
;; ;;
"win2025-eval" ) "win2025-eval" )
size=5307996160 size=6014152704
sum="16442d1c0509bcbb25b715b1b322a15fb3ab724a42da0f384b9406ca1c124ed4" sum="d0ef4502e350e3c6c53c15b1b3020d38a5ded011bf04998e950720ac8579b23d"
url="https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1742.240906-0331.ge_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso"
;; ;;
"win2022-eval" ) "win2022-eval" )
size=5044094976 size=5044094976
sum="3e4fa6d8507b554856fc9ca6079cc402df11a8b79344871669f0251535255325" sum="3e4fa6d8507b554856fc9ca6079cc402df11a8b79344871669f0251535255325"
url="https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/SERVER_EVAL_x64FRE_en-us.iso"
;; ;;
"win2019-eval" ) "win2019-eval" )
size=5652088832 size=5652088832
sum="6dae072e7f78f4ccab74a45341de0d6e2d45c39be25f1f5920a2ab4f51d7bcbb" 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" ) "win2016-eval" )
size=6972221440 size=6972221440
sum="1ce702a578a3cb1ac3d14873980838590f06d5b7101c5daaccbac9d73f1fb50f" sum="1ce702a578a3cb1ac3d14873980838590f06d5b7101c5daaccbac9d73f1fb50f"
url="https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO"
;; ;;
"win2012r2-eval" ) "win2012r2-eval" )
size=4542291968 size=4542291968
sum="6612b5b1f53e845aacdf96e974bb119a3d9b4dcb5b82e65804ab7e534dc7b4d5" sum="6612b5b1f53e845aacdf96e974bb119a3d9b4dcb5b82e65804ab7e534dc7b4d5"
url="https://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO"
;; ;;
"win2008r2" ) "win2008r2" )
size=3166840832 size=3166840832
sum="30832ad76ccfa4ce48ccb936edefe02079d42fb1da32201bf9e3a880c8ed6312" sum="30832ad76ccfa4ce48ccb936edefe02079d42fb1da32201bf9e3a880c8ed6312"
url="https://download.microsoft.com/download/4/1/D/41DEA7E0-B30D-4012-A1E3-F24DC03BA1BB/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso"
;; ;;
esac esac
case "${ret,,}" in case "${ret,,}" in
"sum" ) echo "$sum" ;; "sum" ) echo "$sum" ;;
"size" ) echo "$size" ;; "size" ) echo "$size" ;;
*) echo "";; *) echo "$url";;
esac esac
return 0 return 0
@ -770,25 +806,23 @@ getLink1() {
case "${id,,}" in case "${id,,}" in
"win11x64" | "win11x64-enterprise" | "win11x64-enterprise-eval" ) "win11x64" | "win11x64-enterprise" | "win11x64-enterprise-eval" )
size=5946128384 size=5332989952
sum="5bb1459034f50766ee480d895d751af73a4af30814240ae32ebc5633546a5af7" sum="aa1ad990f930d907b7a34ea897abbb0dfbe47552ca8acc146f92e40381839e05"
url="11/en-us_windows_11_23h2_x64.iso" url="11/en-us_windows_11_24h2_x64.iso"
;; ;;
"win11x64-iot" | "win11x64-enterprise-iot-eval" ) "win11x64-iot" | "win11x64-enterprise-iot-eval" )
[[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0
size=5144817664 size=5144817664
sum="4f59662a96fc1da48c1b415d6c369d08af55ddd64e8f1c84e0166d9e50405d7a" sum="4f59662a96fc1da48c1b415d6c369d08af55ddd64e8f1c84e0166d9e50405d7a"
url="11/X23-81951_26100.1742.240906-0331.ge_release_svc_refresh_CLIENT_ENTERPRISES_OEM_x64FRE_en-us.iso" url="11/X23-81951_26100.1742.240906-0331.ge_release_svc_refresh_CLIENT_ENTERPRISES_OEM_x64FRE_en-us.iso"
;; ;;
"win11x64-ltsc" | "win11x64-enterprise-ltsc-eval" ) "win11x64-ltsc" | "win11x64-enterprise-ltsc-eval" )
[[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0
size=5144817664 size=5144817664
sum="4f59662a96fc1da48c1b415d6c369d08af55ddd64e8f1c84e0166d9e50405d7a" sum="4f59662a96fc1da48c1b415d6c369d08af55ddd64e8f1c84e0166d9e50405d7a"
url="11/X23-81951_26100.1742.240906-0331.ge_release_svc_refresh_CLIENT_ENTERPRISES_OEM_x64FRE_en-us.iso" url="11/X23-81951_26100.1742.240906-0331.ge_release_svc_refresh_CLIENT_ENTERPRISES_OEM_x64FRE_en-us.iso"
;; ;;
"win10x64" | "win10x64-enterprise" | "win10x64-enterprise-eval" ) "win10x64" | "win10x64-enterprise" | "win10x64-enterprise-eval" )
size=5623582720 size=5535252480
sum="57371545d752a79a8a8b163b209c7028915da661de83516e06ddae913290a855" sum="557871965263d0fd0a1ea50b5d0d0d7cb04a279148ca905c1c675c9bc0d5486c"
url="10/en-us_windows_10_22h2_x64.iso" url="10/en-us_windows_10_22h2_x64.iso"
;; ;;
"win10x64-iot" | "win10x64-enterprise-iot-eval" ) "win10x64-iot" | "win10x64-enterprise-iot-eval" )
@ -841,7 +875,7 @@ getLink1() {
sum="dfd9890881b7e832a927c38310fb415b7ea62ac5a896671f2ce2a111998f0df8" sum="dfd9890881b7e832a927c38310fb415b7ea62ac5a896671f2ce2a111998f0df8"
url="server/2008r2/en_windows_server_2008_r2_with_sp1_x64_dvd_617601-018.iso" url="server/2008r2/en_windows_server_2008_r2_with_sp1_x64_dvd_617601-018.iso"
;; ;;
"win7x64" | "win7x64-enterprise" ) "win7x64" | "win7x64-enterprise" | "win7x64-enterprise-eval" )
size=3182604288 size=3182604288
sum="ee69f3e9b86ff973f632db8e01700c5724ef78420b175d25bae6ead90f6805a7" sum="ee69f3e9b86ff973f632db8e01700c5724ef78420b175d25bae6ead90f6805a7"
url="7/en_windows_7_enterprise_with_sp1_x64_dvd_u_677651.iso" url="7/en_windows_7_enterprise_with_sp1_x64_dvd_u_677651.iso"
@ -851,7 +885,7 @@ getLink1() {
sum="0b738b55a5ea388ad016535a5c8234daf2e5715a0638488ddd8a228a836055a1" sum="0b738b55a5ea388ad016535a5c8234daf2e5715a0638488ddd8a228a836055a1"
url="7/en_windows_7_with_sp1_x64.iso" url="7/en_windows_7_with_sp1_x64.iso"
;; ;;
"win7x86" | "win7x86-enterprise" ) "win7x86" | "win7x86-enterprise" | "win7x86-enterprise-eval" )
size=2434502656 size=2434502656
sum="8bdd46ff8cb8b8de9c4aba02706629c8983c45e87da110e64e13be17c8434dad" sum="8bdd46ff8cb8b8de9c4aba02706629c8983c45e87da110e64e13be17c8434dad"
url="7/en_windows_7_enterprise_with_sp1_x86_dvd_u_677710.iso" url="7/en_windows_7_enterprise_with_sp1_x86_dvd_u_677710.iso"
@ -881,6 +915,11 @@ getLink1() {
sum="8fac68e1e56c64ad9a2aa0ad464560282e67fa4f4dd51d09a66f4e548eb0f2d6" sum="8fac68e1e56c64ad9a2aa0ad464560282e67fa4f4dd51d09a66f4e548eb0f2d6"
url="xp/professional/en_win_xp_pro_x64_vl.iso" url="xp/professional/en_win_xp_pro_x64_vl.iso"
;; ;;
"win2kx86" )
size=331701982
sum="a93251b31f92316411bb48458a695d9051b13cdeba714c46f105012fdda45bf3"
url="2000/5.00.2195.6717_x86fre_client-professional_retail_en-us.7z"
;;
esac esac
case "${ret,,}" in case "${ret,,}" in
@ -925,7 +964,7 @@ getLink2() {
sum="dfd9890881b7e832a927c38310fb415b7ea62ac5a896671f2ce2a111998f0df8" sum="dfd9890881b7e832a927c38310fb415b7ea62ac5a896671f2ce2a111998f0df8"
url="Windows%20Server%202008%20R2/en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso" url="Windows%20Server%202008%20R2/en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso"
;; ;;
"win7x64" | "win7x64-enterprise" ) "win7x64" | "win7x64-enterprise" | "win7x64-enterprise-eval" )
size=3182604288 size=3182604288
sum="ee69f3e9b86ff973f632db8e01700c5724ef78420b175d25bae6ead90f6805a7" sum="ee69f3e9b86ff973f632db8e01700c5724ef78420b175d25bae6ead90f6805a7"
url="Windows%207/en_windows_7_enterprise_with_sp1_x64_dvd_u_677651.iso" url="Windows%207/en_windows_7_enterprise_with_sp1_x64_dvd_u_677651.iso"
@ -935,7 +974,7 @@ getLink2() {
sum="36f4fa2416d0982697ab106e3a72d2e120dbcdb6cc54fd3906d06120d0653808" sum="36f4fa2416d0982697ab106e3a72d2e120dbcdb6cc54fd3906d06120d0653808"
url="Windows%207/en_windows_7_ultimate_with_sp1_x64_dvd_u_677332.iso" url="Windows%207/en_windows_7_ultimate_with_sp1_x64_dvd_u_677332.iso"
;; ;;
"win7x86" | "win7x86-enterprise" ) "win7x86" | "win7x86-enterprise" | "win7x86-enterprise-eval" )
size=2434502656 size=2434502656
sum="8bdd46ff8cb8b8de9c4aba02706629c8983c45e87da110e64e13be17c8434dad" sum="8bdd46ff8cb8b8de9c4aba02706629c8983c45e87da110e64e13be17c8434dad"
url="Windows%207/en_windows_7_enterprise_with_sp1_x86_dvd_u_677710.iso" url="Windows%207/en_windows_7_enterprise_with_sp1_x86_dvd_u_677710.iso"
@ -1019,11 +1058,40 @@ getLink3() {
sum="a11116c0645d892d6a5a7c585ecc1fa13aa66f8c7cc6b03bf1f27bd16860cc35" sum="a11116c0645d892d6a5a7c585ecc1fa13aa66f8c7cc6b03bf1f27bd16860cc35"
url="tiny-10-23-h2/tiny10%20x64%2023h2.iso" url="tiny-10-23-h2/tiny10%20x64%2023h2.iso"
;; ;;
"win7x64" | "win7x64-enterprise" | "win7x64-enterprise-eval" )
size=3182604288
sum="ee69f3e9b86ff973f632db8e01700c5724ef78420b175d25bae6ead90f6805a7"
url="en_windows_7_enterprise_with_sp1_x64_dvd_u_677651_202006/en_windows_7_enterprise_with_sp1_x64_dvd_u_677651.iso"
;;
"win7x64-ultimate" )
size=3320903680
sum="36f4fa2416d0982697ab106e3a72d2e120dbcdb6cc54fd3906d06120d0653808"
url="win7-ult-sp1-english/Win7_Ult_SP1_English_x64.iso"
;;
"win7x86" | "win7x86-enterprise" | "win7x86-enterprise-eval" )
size=2434502656
sum="8bdd46ff8cb8b8de9c4aba02706629c8983c45e87da110e64e13be17c8434dad"
url="en_windows_7_enterprise_with_sp1_x86_dvd_u_677710_202006/en_windows_7_enterprise_with_sp1_x86_dvd_u_677710.iso"
;;
"win7x86-ultimate" )
size=2564476928
sum="e2c009a66d63a742941f5087acae1aa438dcbe87010bddd53884b1af6b22c940"
url="win7-ult-sp1-english/Win7_Ult_SP1_English_x32.iso"
;;
"winxpx86" ) "winxpx86" )
size=617756672 size=617756672
sum="62b6c91563bad6cd12a352aa018627c314cfc5162d8e9f8af0756a642e602a46" sum="62b6c91563bad6cd12a352aa018627c314cfc5162d8e9f8af0756a642e602a46"
url="XPPRO_SP3_ENU/en_windows_xp_professional_with_service_pack_3_x86_cd_x14-80428.iso" url="XPPRO_SP3_ENU/en_windows_xp_professional_with_service_pack_3_x86_cd_x14-80428.iso"
;; ;;
"winxpx64" )
size=614166528
sum="8fac68e1e56c64ad9a2aa0ad464560282e67fa4f4dd51d09a66f4e548eb0f2d6"
url="windows-xp-all-sp-msdn-iso-files-en-de-ru-tr-x86-x64/en_win_xp_sp1_pro_x64_vl.iso"
;;
"win2kx86" )
size=386859008
sum="e3816f6e80b66ff686ead03eeafffe9daf020a5e4717b8bd4736b7c51733ba22"
url="MicrosoftWindows2000BuildCollection/5.00.2195.6717_x86fre_client-professional_retail_en-us-ZRMPFPP_EN.iso"
esac esac
case "${ret,,}" in case "${ret,,}" in
@ -1110,66 +1178,12 @@ isESD() {
return 1 return 1
} }
isMG() {
local id="$1"
local lang="$2"
case "${id,,}" in
"win11${PLATFORM,,}" )
return 0
;;
"win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval" )
return 0
;;
"win11${PLATFORM,,}-ltsc" | "win11${PLATFORM,,}-enterprise-ltsc-eval" )
return 0
;;
"win11${PLATFORM,,}-iot" | "win11${PLATFORM,,}-enterprise-iot-eval" )
return 0
;;
"win10${PLATFORM,,}" )
return 0
;;
"win10${PLATFORM,,}-enterprise" | "win10${PLATFORM,,}-enterprise-eval" )
return 0
;;
"win10${PLATFORM,,}-ltsc" | "win10${PLATFORM,,}-enterprise-ltsc-eval" )
return 0
;;
"win10${PLATFORM,,}-iot" | "win10${PLATFORM,,}-enterprise-iot-eval" )
return 0
;;
"win81${PLATFORM,,}-enterprise" | "win81${PLATFORM,,}-enterprise-eval" )
return 0
;;
"win2025" | "win2025-eval" | "win2022" | "win2022-eval" | "win2019" | "win2019-eval" )
return 0
;;
"win2016" | "win2016-eval" | "win2012r2" | "win2012r2-eval" | "win2008r2" | "win2008r2-eval" )
return 0
;;
"win7x64" | "win7x64-enterprise" | "win7x64-ultimate" | "win7x86" | "win7x86-enterprise" | "win7x86-ultimate" )
return 0
;;
"winvistax64" | "winvistax64-enterprise" | "winvistax64-ultimate" | "winvistax86" | "winvistax86-enterprise" | "winvistax86-ultimate" )
return 0
;;
"winxpx86" | "winxpx64" )
return 0
;;
esac
return 1
}
validVersion() { validVersion() {
local id="$1" local id="$1"
local lang="$2" local lang="$2"
local url local url
isMG "$id" "$lang" && return 0
isESD "$id" "$lang" && return 0 isESD "$id" "$lang" && return 0
isMido "$id" "$lang" && return 0 isMido "$id" "$lang" && return 0
@ -1207,118 +1221,111 @@ addFolder() {
return 0 return 0
} }
migrateFiles() {
local base="$1"
local version="$2"
local file=""
[ -f "$base" ] && return 0
[[ "${version,,}" == "tiny10" ]] && file="tiny10_x64_23h2.iso"
[[ "${version,,}" == "tiny11" ]] && file="tiny11_2311_x64.iso"
[[ "${version,,}" == "core11" ]] && file="tiny11_core_x64_beta_1.iso"
[[ "${version,,}" == "winxpx86" ]] && file="en_windows_xp_professional_with_service_pack_3_x86_cd_x14-80428.iso"
[[ "${version,,}" == "winvistax64" ]] && file="en_windows_vista_sp2_x64_dvd_342267.iso"
[[ "${version,,}" == "win7x64" ]] && file="en_windows_7_enterprise_with_sp1_x64_dvd_u_677651.iso"
[ ! -f "$STORAGE/$file" ] && return 0
mv -f "$STORAGE/$file" "$base" || return 1
return 0
}
prepareInstall() { prepareInstall() {
local dir="$2" local dir="$2"
local desc="$3" local desc="$3"
local arch="$4" local driver="$4"
local key="$5"
local driver="$6"
local drivers="/tmp/drivers" local drivers="/tmp/drivers"
rm -rf "$drivers"
mkdir -p "$drivers"
ETFS="[BOOT]/Boot-NoEmul.img" ETFS="[BOOT]/Boot-NoEmul.img"
if [ ! -f "$dir/$ETFS" ] || [ ! -s "$dir/$ETFS" ]; then if [ ! -f "$dir/$ETFS" ] || [ ! -s "$dir/$ETFS" ]; then
error "Failed to locate file \"$ETFS\" in $desc ISO image!" && return 1 error "Failed to locate file \"$ETFS\" in $desc ISO image!" && return 1
fi fi
local msg="Adding drivers to image..." local arch target
info "$msg" && html "$msg" [ -d "$dir/AMD64" ] && arch="amd64" || arch="x86"
if ! bsdtar -xf /drivers.txz -C "$drivers"; then
error "Failed to extract drivers!" && return 1
fi
local target
[[ "${arch,,}" == "x86" ]] && target="$dir/I386" || target="$dir/AMD64" [[ "${arch,,}" == "x86" ]] && target="$dir/I386" || target="$dir/AMD64"
if [ ! -f "$drivers/viostor/$driver/$arch/viostor.sys" ]; then if [ ! -d "$target" ]; then
error "Failed to locate required storage drivers!" && return 1 error "Failed to locate directory \"$target\" in $desc ISO image!" && return 1
fi fi
cp -L "$drivers/viostor/$driver/$arch/viostor.sys" "$target" || return 1 if [[ "${driver,,}" == "xp" ]] || [[ "${driver,,}" == "2k3" ]]; then
mkdir -p "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1 local msg="Adding drivers to image..."
cp -L "$drivers/viostor/$driver/$arch/viostor.cat" "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1 info "$msg" && html "$msg"
cp -L "$drivers/viostor/$driver/$arch/viostor.inf" "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1
cp -L "$drivers/viostor/$driver/$arch/viostor.sys" "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1 rm -rf "$drivers"
mkdir -p "$drivers"
if ! bsdtar -xf /drivers.txz -C "$drivers"; then
error "Failed to extract drivers!" && return 1
fi
if [ ! -f "$drivers/viostor/$driver/$arch/viostor.sys" ]; then
error "Failed to locate required storage drivers!" && return 1
fi
cp -L "$drivers/viostor/$driver/$arch/viostor.sys" "$target" || return 1
mkdir -p "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1
cp -L "$drivers/viostor/$driver/$arch/viostor.cat" "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1
cp -L "$drivers/viostor/$driver/$arch/viostor.inf" "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1
cp -L "$drivers/viostor/$driver/$arch/viostor.sys" "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1
if [ ! -f "$drivers/NetKVM/$driver/$arch/netkvm.sys" ]; then
error "Failed to locate required network drivers!" && return 1
fi
mkdir -p "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
cp -L "$drivers/NetKVM/$driver/$arch/netkvm.cat" "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
cp -L "$drivers/NetKVM/$driver/$arch/netkvm.inf" "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
cp -L "$drivers/NetKVM/$driver/$arch/netkvm.sys" "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
if [ ! -f "$target/TXTSETUP.SIF" ]; then
error "The file TXTSETUP.SIF could not be found!" && return 1
fi
sed -i '/^\[SCSI.Load\]/s/$/\nviostor=viostor.sys,4/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\nviostor.sys=1,,,,,,4_,4,1,,,1,4/' "$target/TXTSETUP.SIF"
sed -i '/^\[SCSI\]/s/$/\nviostor=\"Red Hat VirtIO SCSI Disk Device\"/' "$target/TXTSETUP.SIF"
sed -i '/^\[HardwareIdsDatabase\]/s/$/\nPCI\\VEN_1AF4\&DEV_1001\&SUBSYS_00000000=\"viostor\"/' "$target/TXTSETUP.SIF"
sed -i '/^\[HardwareIdsDatabase\]/s/$/\nPCI\\VEN_1AF4\&DEV_1001\&SUBSYS_00020000=\"viostor\"/' "$target/TXTSETUP.SIF"
sed -i '/^\[HardwareIdsDatabase\]/s/$/\nPCI\\VEN_1AF4\&DEV_1001\&SUBSYS_00021AF4=\"viostor\"/' "$target/TXTSETUP.SIF"
sed -i '/^\[HardwareIdsDatabase\]/s/$/\nPCI\\VEN_1AF4\&DEV_1001\&SUBSYS_00000000=\"viostor\"/' "$target/TXTSETUP.SIF"
if [ ! -d "$drivers/sata/xp/$arch" ]; then
error "Failed to locate required SATA drivers!" && return 1
fi
mkdir -p "$dir/\$OEM\$/\$1/Drivers/sata" || return 1
cp -Lr "$drivers/sata/xp/$arch/." "$dir/\$OEM\$/\$1/Drivers/sata" || return 1
cp -Lr "$drivers/sata/xp/$arch/." "$target" || return 1
sed -i '/^\[SCSI.Load\]/s/$/\niaStor=iaStor.sys,4/' "$target/TXTSETUP.SIF"
sed -i '/^\[FileFlags\]/s/$/\niaStor.sys = 16/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaStor.cat = 1,,,,,,,1,0,0/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaStor.inf = 1,,,,,,,1,0,0/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaStor.sys = 1,,,,,,4_,4,1,,,1,4/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaStor.sys = 1,,,,,,,1,0,0/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaahci.cat = 1,,,,,,,1,0,0/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaAHCI.inf = 1,,,,,,,1,0,0/' "$target/TXTSETUP.SIF"
sed -i '/^\[SCSI\]/s/$/\niaStor=\"Intel\(R\) SATA RAID\/AHCI Controller\"/' "$target/TXTSETUP.SIF"
sed -i '/^\[HardwareIdsDatabase\]/s/$/\nPCI\\VEN_8086\&DEV_2922\&CC_0106=\"iaStor\"/' "$target/TXTSETUP.SIF"
rm -rf "$drivers"
if [ ! -f "$drivers/NetKVM/$driver/$arch/netkvm.sys" ]; then
error "Failed to locate required network drivers!" && return 1
fi fi
mkdir -p "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
cp -L "$drivers/NetKVM/$driver/$arch/netkvm.cat" "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
cp -L "$drivers/NetKVM/$driver/$arch/netkvm.inf" "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
cp -L "$drivers/NetKVM/$driver/$arch/netkvm.sys" "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
if [ ! -f "$target/TXTSETUP.SIF" ]; then
error "The file TXTSETUP.SIF could not be found!" && return 1
fi
sed -i '/^\[SCSI.Load\]/s/$/\nviostor=viostor.sys,4/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\nviostor.sys=1,,,,,,4_,4,1,,,1,4/' "$target/TXTSETUP.SIF"
sed -i '/^\[SCSI\]/s/$/\nviostor=\"Red Hat VirtIO SCSI Disk Device\"/' "$target/TXTSETUP.SIF"
sed -i '/^\[HardwareIdsDatabase\]/s/$/\nPCI\\VEN_1AF4\&DEV_1001\&SUBSYS_00000000=\"viostor\"/' "$target/TXTSETUP.SIF"
sed -i '/^\[HardwareIdsDatabase\]/s/$/\nPCI\\VEN_1AF4\&DEV_1001\&SUBSYS_00020000=\"viostor\"/' "$target/TXTSETUP.SIF"
sed -i '/^\[HardwareIdsDatabase\]/s/$/\nPCI\\VEN_1AF4\&DEV_1001\&SUBSYS_00021AF4=\"viostor\"/' "$target/TXTSETUP.SIF"
sed -i '/^\[HardwareIdsDatabase\]/s/$/\nPCI\\VEN_1AF4\&DEV_1001\&SUBSYS_00000000=\"viostor\"/' "$target/TXTSETUP.SIF"
if [ ! -d "$drivers/sata/xp/$arch" ]; then
error "Failed to locate required SATA drivers!" && return 1
fi
mkdir -p "$dir/\$OEM\$/\$1/Drivers/sata" || return 1
cp -Lr "$drivers/sata/xp/$arch/." "$dir/\$OEM\$/\$1/Drivers/sata" || return 1
cp -Lr "$drivers/sata/xp/$arch/." "$target" || return 1
sed -i '/^\[SCSI.Load\]/s/$/\niaStor=iaStor.sys,4/' "$target/TXTSETUP.SIF"
sed -i '/^\[FileFlags\]/s/$/\niaStor.sys = 16/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaStor.cat = 1,,,,,,,1,0,0/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaStor.inf = 1,,,,,,,1,0,0/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaStor.sys = 1,,,,,,4_,4,1,,,1,4/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaStor.sys = 1,,,,,,,1,0,0/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaahci.cat = 1,,,,,,,1,0,0/' "$target/TXTSETUP.SIF"
sed -i '/^\[SourceDisksFiles.'"$arch"'\]/s/$/\niaAHCI.inf = 1,,,,,,,1,0,0/' "$target/TXTSETUP.SIF"
sed -i '/^\[SCSI\]/s/$/\niaStor=\"Intel\(R\) SATA RAID\/AHCI Controller\"/' "$target/TXTSETUP.SIF"
sed -i '/^\[HardwareIdsDatabase\]/s/$/\nPCI\\VEN_8086\&DEV_2922\&CC_0106=\"iaStor\"/' "$target/TXTSETUP.SIF"
rm -rf "$drivers"
local pid file setup local pid file setup
setup=$(find "$target" -maxdepth 1 -type f -iname setupp.ini | head -n 1) setup=$(find "$target" -maxdepth 1 -type f -iname setupp.ini | head -n 1)
pid=$(<"$setup")
pid="${pid:(-4)}"
pid="${pid:0:3}"
if [[ "$pid" == "270" ]]; then if [ -n "$setup" ]; then
warn "this version of $desc requires a volume license key (VLK), it will ask for one during installation."
pid=$(<"$setup")
pid="${pid:(-4)}"
pid="${pid:0:3}"
if [[ "$pid" == "270" ]]; then
warn "this version of $desc requires a volume license key (VLK), it will ask for one during installation."
fi
fi fi
mkdir -p "$dir/\$OEM\$"
if ! addFolder "$dir"; then if ! addFolder "$dir"; then
error "Failed to add OEM folder to image!" && return 1 error "Failed to add OEM folder to image!" && return 1
fi fi
@ -1333,11 +1340,48 @@ prepareInstall() {
XHEX=$(printf '%x\n' "$WIDTH") XHEX=$(printf '%x\n' "$WIDTH")
YHEX=$(printf '%x\n' "$HEIGHT") YHEX=$(printf '%x\n' "$HEIGHT")
local username="Docker" local username=""
local password="*" local password=""
[ -n "$PASSWORD" ] && password="$PASSWORD"
[ -n "$USERNAME" ] && username=$(echo "$USERNAME" | sed 's/[^[:alnum:]@!._-]//g') [ -n "$USERNAME" ] && username=$(echo "$USERNAME" | sed 's/[^[:alnum:]@!._-]//g')
[ -z "$username" ] && username="Docker"
[ -n "$PASSWORD" ] && password=$(echo "$PASSWORD" | sed 's/"//g')
[ -z "$password" ] && password="admin"
local ip="20.20.20.1"
[ -n "${VM_NET_IP:-}" ] && ip="${VM_NET_IP%.*}.1"
# These are not pirated keys, they come from the official MS documentation.
case "${driver,,}" in
"xp" )
if [[ "${arch,,}" == "x86" ]]; then
# Windows XP Professional x86 generic key (no activation, trial-only)
[ -z "$KEY" ] && KEY="DR8GV-C8V6J-BYXHG-7PYJR-DB66Y"
else
# Windows XP Professional x64 generic key (no activation, trial-only)
[ -z "$KEY" ] && KEY="B2RBK-7KPT9-4JP6X-QQFWM-PJD6G"
fi ;;
"2k3" )
if [[ "${arch,,}" == "x86" ]]; then
# Windows Server 2003 Standard x86 generic key (no activation, trial-only)
[ -z "$KEY" ] && KEY="QKDCQ-TP2JM-G4MDG-VR6F2-P9C48"
else
# Windows Server 2003 Standard x64 generic key (no activation, trial-only)
[ -z "$KEY" ] && KEY="P4WJG-WK3W7-3HM8W-RWHCK-8JTRY"
fi ;;
"2k" )
# Windows 2000 Professional x86 generic key
KEY="G74HG-XXQTJ-RTX64-QKP3F-HKHXP" ;;
* ) error "Unknown version: \"$driver\"" && return 1 ;;
esac
find "$target" -maxdepth 1 -type f -iname winnt.sif -exec rm {} \; find "$target" -maxdepth 1 -type f -iname winnt.sif -exec rm {} \;
@ -1376,7 +1420,7 @@ prepareInstall() {
echo " FullName=\"$username\"" echo " FullName=\"$username\""
echo " ComputerName=\"*\"" echo " ComputerName=\"*\""
echo " OrgName=\"Windows for Docker\"" echo " OrgName=\"Windows for Docker\""
echo " ProductKey=$key" echo " ProductID=$KEY"
echo "" echo ""
echo "[Identification]" echo "[Identification]"
echo " JoinWorkgroup = WORKGROUP" echo " JoinWorkgroup = WORKGROUP"
@ -1435,12 +1479,14 @@ prepareInstall() {
echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]" echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]"
echo "\"HideFileExt\"=dword:00000000" echo "\"HideFileExt\"=dword:00000000"
echo "" echo ""
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]"
echo "\"NoWelcomeScreen\"=\"1\""
echo ""
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]" echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]"
echo "\"DefaultUserName\"=\"$username\""
echo "\"DefaultDomainName\"=\"Dockur\""
echo "\"AltDefaultUserName\"=\"$username\""
echo "\"AltDefaultDomainName\"=\"Dockur\""
echo "\"AutoAdminLogon\"=\"1\"" echo "\"AutoAdminLogon\"=\"1\""
echo "\"DefaultUserName\"=\"$username\""
echo "\"DefaultPassword\"=\"$password\""
echo "\"DefaultDomainName\"=\"Dockur\""
echo "" echo ""
echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{23A77BF7-ED96-40EC-AF06-9B1F4867732A}\0000]" echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{23A77BF7-ED96-40EC-AF06-9B1F4867732A}\0000]"
echo "\"DefaultSettings.BitsPerPel\"=dword:00000020" echo "\"DefaultSettings.BitsPerPel\"=dword:00000020"
@ -1511,6 +1557,14 @@ prepareInstall() {
echo "" echo ""
echo "Call Domain.MoveHere(LocalAdminADsPath, \"$username\")" echo "Call Domain.MoveHere(LocalAdminADsPath, \"$username\")"
echo "" echo ""
echo "With (CreateObject(\"Scripting.FileSystemObject\"))"
echo " SysRoot = WshShell.ExpandEnvironmentStrings(\"%SystemRoot%\")"
echo " Set oFile = .OpenTextFile(SysRoot & \"\system32\drivers\etc\hosts\", 8, true)"
echo " oFile.Write(\"$ip host.lan\")"
echo " oFile.Close()"
echo " Set oFile = Nothing"
echo "End With"
echo ""
} | unix2dos > "$dir/\$OEM\$/admin.vbs" } | unix2dos > "$dir/\$OEM\$/admin.vbs"
{ echo "[COMMANDS]" { echo "[COMMANDS]"
@ -1522,56 +1576,6 @@ prepareInstall() {
return 0 return 0
} }
prepare2k3() {
local iso="$1"
local dir="$2"
local desc="$3"
local driver="2k3"
local arch key
[ -d "$dir/AMD64" ] && arch="amd64" || arch="x86"
if [[ "${arch,,}" == "x86" ]]; then
# Windows Server 2003 Standard x86 generic key (no activation, trial-only)
# This is not a pirated key, it comes from the official MS documentation.
key="QKDCQ-TP2JM-G4MDG-VR6F2-P9C48"
else
# Windows Server 2003 Standard x64 generic key (no activation, trial-only)
# This is not a pirated key, it comes from the official MS documentation.
key="P4WJG-WK3W7-3HM8W-RWHCK-8JTRY"
fi
prepareInstall "$iso" "$dir" "$desc" "$arch" "$key" "$driver" || return 1
return 0
}
prepareXP() {
local iso="$1"
local dir="$2"
local desc="$3"
local driver="xp"
local arch key
[ -d "$dir/AMD64" ] && arch="amd64" || arch="x86"
if [[ "${arch,,}" == "x86" ]]; then
# Windows XP Professional x86 generic key (no activation, trial-only)
# This is not a pirated key, it comes from the official MS documentation.
key="DR8GV-C8V6J-BYXHG-7PYJR-DB66Y"
else
# Windows XP Professional x64 generic key (no activation, trial-only)
# This is not a pirated key, it comes from the official MS documentation.
key="B2RBK-7KPT9-4JP6X-QQFWM-PJD6G"
fi
prepareInstall "$iso" "$dir" "$desc" "$arch" "$key" "$driver" || return 1
return 0
}
prepareLegacy() { prepareLegacy() {
local iso="$1" local iso="$1"
@ -1656,22 +1660,34 @@ setMachine() {
"win9"* ) "win9"* )
ETFS="[BOOT]/Boot-1.44M.img" ;; ETFS="[BOOT]/Boot-1.44M.img" ;;
"win2k"* ) "win2k"* )
ETFS="[BOOT]/Boot-NoEmul.img" ;; if ! prepareInstall "$iso" "$dir" "$desc" "2k"; then
error "Failed to prepare $desc ISO!" && return 1
fi ;;
"winxp"* ) "winxp"* )
if ! prepareXP "$iso" "$dir" "$desc"; then if ! prepareInstall "$iso" "$dir" "$desc" "xp"; then
error "Failed to prepare $desc ISO!" && return 1 error "Failed to prepare $desc ISO!" && return 1
fi ;; fi ;;
"win2003"* ) "win2003"* )
if ! prepare2k3 "$iso" "$dir" "$desc"; then if ! prepareInstall "$iso" "$dir" "$desc" "2k3"; then
error "Failed to prepare $desc ISO!" && return 1 error "Failed to prepare $desc ISO!" && return 1
fi ;; fi ;;
esac esac
case "${id,,}" in case "${id,,}" in
"win9"* | "win2k"* ) "win9"* )
USB="no"
VGA="cirrus"
DISK_TYPE="auto" DISK_TYPE="auto"
ADAPTER="rtl8139"
MACHINE="pc-i440fx-2.4" MACHINE="pc-i440fx-2.4"
BOOT_MODE="windows_legacy" ;; BOOT_MODE="windows_legacy" ;;
"win2k"* )
VGA="cirrus"
MACHINE="pc"
USB="pci-ohci"
DISK_TYPE="auto"
ADAPTER="rtl8139"
BOOT_MODE="windows_legacy" ;;
"winxp"* | "win2003"* ) "winxp"* | "win2003"* )
DISK_TYPE="blk" DISK_TYPE="blk"
BOOT_MODE="windows_legacy" ;; BOOT_MODE="windows_legacy" ;;

View file

@ -1,16 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -Eeuox pipefail set -Eeuox pipefail
: "${APP:="Windows"}"
: "${PLATFORM:="x64"}"
: "${BOOT_MODE:="windows"}" : "${BOOT_MODE:="windows"}"
: "${SUPPORT:="https://github.com/dockur/windows"}"
APP="Windows"
SUPPORT="https://github.com/dockur/windows"
cd /run cd /run
. utils.sh # Load functions
. reset.sh # Initialize system . reset.sh # Initialize system
. define.sh # Define versions . define.sh # Define versions
. mido.sh # Download code . mido.sh # Download Windows
. install.sh # Run installation . install.sh # Run installation
. disk.sh # Initialize disks . disk.sh # Initialize disks
. display.sh # Initialize graphics . display.sh # Initialize graphics
@ -56,7 +57,10 @@ terminal
bg_pid=$! bg_pid=$!
tail -fn +0 "$QEMU_LOG" 2>/dev/null & tail -fn +0 "$QEMU_LOG" 2>/dev/null &
cat "$QEMU_TERM" 2>/dev/null | tee "$QEMU_PTY" & cat "$QEMU_TERM" 2>/dev/null | tee "$QEMU_PTY" |
sed -u -e 's/\x1B\[[=0-9;]*[a-z]//gi' \
-e 's/failed to load Boot/skipped Boot/g' \
-e 's/0): Not Found/0)/g' &
term_pd=$! term_pd=$!
wait $bg_pid wait $bg_pid

View file

@ -10,21 +10,31 @@ EFISYS="efi/microsoft/boot/efisys_noprompt.bin"
skipInstall() { skipInstall() {
local iso="$1" local iso="$1"
local method=""
local magic byte local magic byte
local boot="$STORAGE/windows.boot" local boot="$STORAGE/windows.boot"
local previous="$STORAGE/windows.base" local previous="$STORAGE/windows.base"
if [ -f "$previous" ]; then if [ -f "$previous" ]; then
previous=$(<"$previous") previous=$(<"$previous")
previous="${previous//[![:print:]]/}"
if [ -n "$previous" ]; then if [ -n "$previous" ]; then
previous="$STORAGE/$previous" if [[ "${STORAGE,,}/${previous,,}" != "${iso,,}" ]]; then
if [[ "${previous,,}" != "${iso,,}" ]]; then
if [ -f "$boot" ] && hasDisk; then if [ -f "$boot" ] && hasDisk; then
info "Detected that the version was changed, but ignoring this because Windows is already installed." if [[ "${iso,,}" == "${STORAGE,,}/windows."* ]]; then
info "Please start with an empty /storage folder, if you want to install a different version of Windows." method="your custom .iso file"
else
if [[ "${previous,,}" != "windows."* ]]; then
method="the VERSION variable"
fi
fi
if [ -n "$method" ]; then
info "Detected that $method was changed, but ignoring this because Windows is already installed."
info "Please start with an empty /storage folder, if you want to install a different version of Windows."
fi
return 0 return 0
fi fi
[ -f "$previous" ] && rm -f "$previous" rm -f "$STORAGE/$previous"
return 1 return 1
fi fi
fi fi
@ -76,8 +86,6 @@ startInstall() {
BOOT="$STORAGE/$file" BOOT="$STORAGE/$file"
! migrateFiles "$BOOT" "$VERSION" && error "Migration failed!" && exit 57
fi fi
skipInstall "$BOOT" && return 1 skipInstall "$BOOT" && return 1
@ -120,6 +128,8 @@ finishInstall() {
rm -f "$STORAGE/windows.old" rm -f "$STORAGE/windows.old"
rm -f "$STORAGE/windows.vga" rm -f "$STORAGE/windows.vga"
rm -f "$STORAGE/windows.net"
rm -f "$STORAGE/windows.usb"
rm -f "$STORAGE/windows.args" rm -f "$STORAGE/windows.args"
rm -f "$STORAGE/windows.base" rm -f "$STORAGE/windows.base"
rm -f "$STORAGE/windows.boot" rm -f "$STORAGE/windows.boot"
@ -162,10 +172,22 @@ finishInstall() {
echo "$ARGS" > "$STORAGE/windows.args" echo "$ARGS" > "$STORAGE/windows.args"
fi fi
if [ -n "${VGA:-}" ] && [[ "${VGA:-}" != "virtio"* ]]; then
echo "$VGA" > "$STORAGE/windows.vga"
fi
if [ -n "${USB:-}" ] && [[ "${USB:-}" != "qemu-xhci"* ]]; then
echo "$USB" > "$STORAGE/windows.usb"
fi
if [ -n "${DISK_TYPE:-}" ] && [[ "${DISK_TYPE:-}" != "scsi" ]]; then if [ -n "${DISK_TYPE:-}" ] && [[ "${DISK_TYPE:-}" != "scsi" ]]; then
echo "$DISK_TYPE" > "$STORAGE/windows.type" echo "$DISK_TYPE" > "$STORAGE/windows.type"
fi fi
if [ -n "${ADAPTER:-}" ] && [[ "${ADAPTER:-}" != "virtio-net-pci" ]]; then
echo "$ADAPTER" > "$STORAGE/windows.net"
fi
rm -rf "$TMP" rm -rf "$TMP"
return 0 return 0
} }
@ -177,6 +199,7 @@ abortInstall() {
local efi local efi
[[ "${iso,,}" == *".esd" ]] && exit 60 [[ "${iso,,}" == *".esd" ]] && exit 60
[[ "${UNPACK:-}" == [Yy1]* ]] && exit 60
efi=$(find "$dir" -maxdepth 1 -type d -iname efi | head -n 1) efi=$(find "$dir" -maxdepth 1 -type d -iname efi | head -n 1)
@ -201,11 +224,23 @@ abortInstall() {
detectCustom() { detectCustom() {
local file base local dir file base
local fname="custom.iso"
local boot="$STORAGE/windows.boot"
CUSTOM="" CUSTOM=""
file=$(find / -maxdepth 1 -type f -iname custom.iso | head -n 1) dir=$(find / -maxdepth 1 -type d -iname "$fname" | head -n 1)
[ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.iso | head -n 1) [ ! -d "$dir" ] && dir=$(find "$STORAGE" -maxdepth 1 -type d -iname "$fname" | head -n 1)
if [ -d "$dir" ]; then
if ! hasDisk || [ ! -f "$boot" ]; then
error "The bind $dir maps to a file that does not exist!" && return 1
fi
fi
file=$(find / -maxdepth 1 -type f -iname "$fname" | head -n 1)
[ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "$fname" | head -n 1)
if [ ! -s "$file" ] && [[ "${VERSION,,}" != "http"* ]]; then if [ ! -s "$file" ] && [[ "${VERSION,,}" != "http"* ]]; then
base=$(basename "$VERSION") base=$(basename "$VERSION")
@ -246,12 +281,12 @@ extractESD() {
mkdir -p "$dir" mkdir -p "$dir"
size=16106127360 size=16106127360
size_gb=$(( (size + 1073741823)/1073741824 )) size_gb=$(formatBytes "$size")
space=$(df --output=avail -B 1 "$dir" | tail -n 1) space=$(df --output=avail -B 1 "$dir" | tail -n 1)
space_gb=$(( (space + 1073741823)/1073741824 )) space_gb=$(formatBytes "$space")
if (( size > space )); then if (( size > space )); then
error "Not enough free space in $STORAGE, have $space_gb GB available but need at least $size_gb GB." && return 1 error "Not enough free space in $STORAGE, have $space_gb available but need at least $size_gb." && return 1
fi fi
local esdImageCount local esdImageCount
@ -316,7 +351,7 @@ extractImage() {
local dir="$2" local dir="$2"
local version="$3" local version="$3"
local desc="local ISO" local desc="local ISO"
local size size_gb space space_gb local file size size_gb space space_gb
if [ -z "$CUSTOM" ]; then if [ -z "$CUSTOM" ]; then
desc="downloaded ISO" desc="downloaded ISO"
@ -337,16 +372,16 @@ extractImage() {
mkdir -p "$dir" mkdir -p "$dir"
size=$(stat -c%s "$iso") size=$(stat -c%s "$iso")
size_gb=$(( (size + 1073741823)/1073741824 )) size_gb=$(formatBytes "$size")
space=$(df --output=avail -B 1 "$dir" | tail -n 1) space=$(df --output=avail -B 1 "$dir" | tail -n 1)
space_gb=$(( (space + 1073741823)/1073741824 )) space_gb=$(formatBytes "$space")
if ((size<100000000)); then if ((size<100000000)); then
error "Invalid ISO file: Size is smaller than 100 MB" && return 1 error "Invalid ISO file: Size is smaller than 100 MB" && return 1
fi fi
if (( size > space )); then if (( size > space )); then
error "Not enough free space in $STORAGE, have $space_gb GB available but need at least $size_gb GB." && return 1 error "Not enough free space in $STORAGE, have $space_gb available but need at least $size_gb." && return 1
fi fi
rm -rf "$dir" rm -rf "$dir"
@ -355,7 +390,26 @@ extractImage() {
error "Failed to extract ISO file: $iso" && return 1 error "Failed to extract ISO file: $iso" && return 1
fi fi
LABEL=$(isoinfo -d -i "$iso" | sed -n 's/Volume id: //p') if [[ "${UNPACK:-}" != [Yy1]* ]]; then
LABEL=$(isoinfo -d -i "$iso" | sed -n 's/Volume id: //p')
else
file=$(find "$dir" -maxdepth 1 -type f -iname "*.iso" | head -n 1)
if [ -z "$file" ]; then
error "Failed to find any .iso file in archive!" && return 1
fi
if ! 7z x "$file" -o"$dir" > /dev/null; then
error "Failed to extract archive!" && return 1
fi
LABEL=$(isoinfo -d -i "$file" | sed -n 's/Volume id: //p')
rm -f "$file"
fi
return 0 return 0
} }
@ -489,6 +543,10 @@ setXML() {
local file="/custom.xml" local file="/custom.xml"
if [ -d "$file" ]; then
error "The bind $file maps to a file that does not exist!" && exit 67
fi
[ ! -f "$file" ] || [ ! -s "$file" ] && file="$STORAGE/custom.xml" [ ! -f "$file" ] || [ ! -s "$file" ] && file="$STORAGE/custom.xml"
[ ! -f "$file" ] || [ ! -s "$file" ] && file="/run/assets/custom.xml" [ ! -f "$file" ] || [ ! -s "$file" ] && file="/run/assets/custom.xml"
[ ! -f "$file" ] || [ ! -s "$file" ] && file="$1" [ ! -f "$file" ] || [ ! -s "$file" ] && file="$1"
@ -573,6 +631,10 @@ detectImage() {
info "Detected: $desc" info "Detected: $desc"
setXML "" && return 0 setXML "" && return 0
if [[ "$DETECTED" == "win81x86"* ]] || [[ "$DETECTED" == "win10x86"* ]]; then
error "The 32-bit version of $desc is not supported!" && return 1
fi
msg="the answer file for $desc was not found ($DETECTED.xml)" msg="the answer file for $desc was not found ($DETECTED.xml)"
local fallback="/run/assets/${DETECTED%%-*}.xml" local fallback="/run/assets/${DETECTED%%-*}.xml"
@ -620,6 +682,10 @@ updateXML() {
local language="$2" local language="$2"
local culture region user admin pass keyboard local culture region user admin pass keyboard
if [ -n "${VM_NET_IP:-}" ]; then
sed -i "s/ 20.20.20.1 / ${VM_NET_IP%.*}.1 /g" "$asset"
fi
[ -z "$HEIGHT" ] && HEIGHT="720" [ -z "$HEIGHT" ] && HEIGHT="720"
[ -z "$WIDTH" ] && WIDTH="1280" [ -z "$WIDTH" ] && WIDTH="1280"
@ -657,15 +723,26 @@ updateXML() {
sed -i "s/<Username>Docker<\/Username>/<Username>$user<\/Username>/g" "$asset" sed -i "s/<Username>Docker<\/Username>/<Username>$user<\/Username>/g" "$asset"
fi fi
if [ -n "$PASSWORD" ]; then [ -n "$PASSWORD" ] && pass="$PASSWORD" || pass="admin"
pass=$(printf '%s' "${PASSWORD}Password" | iconv -f utf-8 -t utf-16le | base64 -w 0)
admin=$(printf '%s' "${PASSWORD}AdministratorPassword" | iconv -f utf-8 -t utf-16le | base64 -w 0) pw=$(printf '%s' "${pass}Password" | iconv -f utf-8 -t utf-16le | base64 -w 0)
sed -i "s/<Value>password<\/Value>/<Value>$admin<\/Value>/g" "$asset" admin=$(printf '%s' "${pass}AdministratorPassword" | iconv -f utf-8 -t utf-16le | base64 -w 0)
sed -i "s/<PlainText>true<\/PlainText>/<PlainText>false<\/PlainText>/g" "$asset"
sed -z "s/<Password>...........<Value \/>/<Password>\n <Value>$pass<\/Value>/g" -i "$asset" sed -i "s/<Value>password<\/Value>/<Value>$admin<\/Value>/g" "$asset"
sed -z "s/<Password>...............<Value \/>/<Password>\n <Value>$pass<\/Value>/g" -i "$asset" sed -i "s/<PlainText>true<\/PlainText>/<PlainText>false<\/PlainText>/g" "$asset"
sed -z "s/<AdministratorPassword>...........<Value \/>/<AdministratorPassword>\n <Value>$admin<\/Value>/g" -i "$asset" sed -z "s/<Password>...........<Value \/>/<Password>\n <Value>$pw<\/Value>/g" -i "$asset"
sed -z "s/<AdministratorPassword>...............<Value \/>/<AdministratorPassword>\n <Value>$admin<\/Value>/g" -i "$asset" sed -z "s/<Password>...............<Value \/>/<Password>\n <Value>$pw<\/Value>/g" -i "$asset"
sed -z "s/<AdministratorPassword>...........<Value \/>/<AdministratorPassword>\n <Value>$admin<\/Value>/g" -i "$asset"
sed -z "s/<AdministratorPassword>...............<Value \/>/<AdministratorPassword>\n <Value>$admin<\/Value>/g" -i "$asset"
if [ -n "$EDITION" ]; then
[[ "${EDITION^^}" == "CORE" ]] && EDITION="STANDARDCORE"
sed -i "s/SERVERSTANDARD<\/Value>/SERVER${EDITION^^}<\/Value>/g" "$asset"
fi
if [ -n "$KEY" ]; then
sed -i '/<ProductKey>/,/<\/ProductKey>/d' "$asset"
sed -i "s/<\/UserData>/ <ProductKey>\n <Key>${KEY}<\/Key>\n <WillShowUI>OnError<\/WillShowUI>\n <\/ProductKey>\n <\/UserData>/g" "$asset"
fi fi
return 0 return 0
@ -677,8 +754,13 @@ addDriver() {
local path="$2" local path="$2"
local target="$3" local target="$3"
local driver="$4" local driver="$4"
local desc=""
local folder="" local folder=""
if [ -z "$id" ]; then
warn "no Windows version specified for \"$driver\" driver!" && return 0
fi
case "${id,,}" in case "${id,,}" in
"win7x86"* ) folder="w7/x86" ;; "win7x86"* ) folder="w7/x86" ;;
"win7x64"* ) folder="w7/amd64" ;; "win7x64"* ) folder="w7/amd64" ;;
@ -698,7 +780,12 @@ addDriver() {
esac esac
if [ -z "$folder" ]; then if [ -z "$folder" ]; then
warn "no \"$driver\" driver found for \"$DETECTED\" !" && return 0 desc=$(printVersion "$id" "$id")
if [[ "${id,,}" != *"x86"* ]]; then
warn "no \"$driver\" driver available for \"$desc\" !" && return 0
else
warn "no \"$driver\" driver available for the 32-bit version of \"$desc\" !" && return 0
fi
fi fi
[ ! -d "$path/$driver/$folder" ] && return 0 [ ! -d "$path/$driver/$folder" ] && return 0
@ -731,6 +818,11 @@ addDrivers() {
local msg="Adding drivers to image..." local msg="Adding drivers to image..."
info "$msg" && html "$msg" info "$msg" && html "$msg"
if [ -z "$version" ]; then
version="win11x64"
warn "Windows version unknown, falling back to Windows 11 drivers..."
fi
if ! bsdtar -xf /drivers.txz -C "$drivers"; then if ! bsdtar -xf /drivers.txz -C "$drivers"; then
error "Failed to extract drivers from archive!" && return 1 error "Failed to extract drivers from archive!" && return 1
fi fi
@ -924,12 +1016,12 @@ buildImage() {
fi fi
size=$(du -h -b --max-depth=0 "$dir" | cut -f1) size=$(du -h -b --max-depth=0 "$dir" | cut -f1)
size_gb=$(( (size + 1073741823)/1073741824 )) size_gb=$(formatBytes "$size")
space=$(df --output=avail -B 1 "$TMP" | tail -n 1) space=$(df --output=avail -B 1 "$TMP" | tail -n 1)
space_gb=$(( (space + 1073741823)/1073741824 )) space_gb=$(formatBytes "$space")
if (( size > space )); then if (( size > space )); then
error "Not enough free space in $STORAGE, have $space_gb GB available but need at least $size_gb GB." && return 1 error "Not enough free space in $STORAGE, have $space_gb available but need at least $size_gb." && return 1
fi fi
if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then
@ -973,52 +1065,47 @@ bootWindows() {
if [ -f "$STORAGE/windows.args" ]; then if [ -f "$STORAGE/windows.args" ]; then
ARGS=$(<"$STORAGE/windows.args") ARGS=$(<"$STORAGE/windows.args")
ARGS="${ARGS//[![:print:]]/}"
ARGUMENTS="$ARGS ${ARGUMENTS:-}" ARGUMENTS="$ARGS ${ARGUMENTS:-}"
fi fi
if [ -s "$STORAGE/windows.vga" ] && [ -f "$STORAGE/windows.vga" ]; then
if [ -z "${VGA:-}" ]; then
VGA=$(<"$STORAGE/windows.vga")
VGA="${VGA//[![:print:]]/}"
fi
fi
if [ -s "$STORAGE/windows.usb" ] && [ -f "$STORAGE/windows.usb" ]; then
if [ -z "${USB:-}" ]; then
USB=$(<"$STORAGE/windows.usb")
USB="${USB//[![:print:]]/}"
fi
fi
if [ -s "$STORAGE/windows.net" ] && [ -f "$STORAGE/windows.net" ]; then
if [ -z "${ADAPTER:-}" ]; then
ADAPTER=$(<"$STORAGE/windows.net")
ADAPTER="${ADAPTER//[![:print:]]/}"
fi
fi
if [ -s "$STORAGE/windows.type" ] && [ -f "$STORAGE/windows.type" ]; then if [ -s "$STORAGE/windows.type" ] && [ -f "$STORAGE/windows.type" ]; then
[ -z "${DISK_TYPE:-}" ] && DISK_TYPE=$(<"$STORAGE/windows.type") if [ -z "${DISK_TYPE:-}" ]; then
DISK_TYPE=$(<"$STORAGE/windows.type")
DISK_TYPE="${DISK_TYPE//[![:print:]]/}"
fi
fi fi
if [ -s "$STORAGE/windows.mode" ] && [ -f "$STORAGE/windows.mode" ]; then if [ -s "$STORAGE/windows.mode" ] && [ -f "$STORAGE/windows.mode" ]; then
BOOT_MODE=$(<"$STORAGE/windows.mode") BOOT_MODE=$(<"$STORAGE/windows.mode")
if [ -s "$STORAGE/windows.old" ] && [ -f "$STORAGE/windows.old" ]; then BOOT_MODE="${BOOT_MODE//[![:print:]]/}"
[[ "${PLATFORM,,}" == "x64" ]] && MACHINE=$(<"$STORAGE/windows.old")
fi
return 0
fi fi
# Migrations if [ -s "$STORAGE/windows.old" ] && [ -f "$STORAGE/windows.old" ]; then
if [[ "${PLATFORM,,}" == "x64" ]]; then
[[ "${PLATFORM,,}" != "x64" ]] && return 0 MACHINE=$(<"$STORAGE/windows.old")
MACHINE="${MACHINE//[![:print:]]/}"
if [ -f "$STORAGE/windows.old" ]; then
MACHINE=$(<"$STORAGE/windows.old")
[ -z "$MACHINE" ] && MACHINE="q35"
BOOT_MODE="windows_legacy"
echo "$BOOT_MODE" > "$STORAGE/windows.mode"
return 0
fi
local creation="1.10"
local minimal="2.14"
if [ -f "$STORAGE/windows.ver" ]; then
creation=$(<"$STORAGE/windows.ver")
[[ "${creation}" != *"."* ]] && creation="$minimal"
fi
# Force secure boot on installs created prior to v2.14
if (( $(echo "$creation < $minimal" | bc -l) )); then
if [[ "${BOOT_MODE,,}" == "windows" ]]; then
BOOT_MODE="windows_secure"
echo "$BOOT_MODE" > "$STORAGE/windows.mode"
if [ -f "$STORAGE/windows.rom" ] && [ ! -f "$STORAGE/$BOOT_MODE.rom" ]; then
mv -f "$STORAGE/windows.rom" "$STORAGE/$BOOT_MODE.rom"
fi
if [ -f "$STORAGE/windows.vars" ] && [ ! -f "$STORAGE/$BOOT_MODE.vars" ]; then
mv -f "$STORAGE/windows.vars" "$STORAGE/$BOOT_MODE.vars"
fi
fi fi
fi fi

View file

@ -93,6 +93,7 @@ download_windows() {
# uuidgen: For MacOS (installed by default) and other systems (e.g. with no /proc) that don't have a kernel interface for generating random UUIDs # uuidgen: For MacOS (installed by default) and other systems (e.g. with no /proc) that don't have a kernel interface for generating random UUIDs
session_id=$(cat /proc/sys/kernel/random/uuid 2> /dev/null || uuidgen --random) session_id=$(cat /proc/sys/kernel/random/uuid 2> /dev/null || uuidgen --random)
session_id="${session_id//[![:print:]]/}"
# Get product edition ID for latest release of given Windows version # Get product edition ID for latest release of given Windows version
# Product edition ID: This specifies both the Windows release (e.g. 22H2) and edition ("multi-edition" is default, either Home/Pro/Edu/etc., we select "Pro" in the answer files) in one number # Product edition ID: This specifies both the Windows release (e.g. 22H2) and edition ("multi-edition" is default, either Home/Pro/Edu/etc., we select "Pro" in the answer files) in one number
@ -208,6 +209,9 @@ download_windows_eval() {
"win2022-eval" ) "win2022-eval" )
enterprise_type="server" enterprise_type="server"
windows_version="windows-server-2022" ;; windows_version="windows-server-2022" ;;
"win2019-hv" )
enterprise_type="server"
windows_version="hyper-v-server-2019" ;;
"win2019-eval" ) "win2019-eval" )
enterprise_type="server" enterprise_type="server"
windows_version="windows-server-2019" ;; windows_version="windows-server-2019" ;;
@ -242,10 +246,10 @@ download_windows_eval() {
[[ "$DEBUG" == [Yy1]* ]] && echo "Getting download link.." [[ "$DEBUG" == [Yy1]* ]] && echo "Getting download link.."
if [[ "$enterprise_type" == "iot" ]]; then filter="https://go.microsoft.com/fwlink/?linkid=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${culture,,}&country=${country,,}"
filter="https://go.microsoft.com/fwlink/?linkid=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${culture,,}&country=${country^^}"
else if ! echo "$iso_download_page_html" | grep -io "$filter" > /dev/null; then
filter="https://go.microsoft.com/fwlink/p/?LinkID=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${culture,,}&country=${country^^}" filter="https://go.microsoft.com/fwlink/p/?linkid=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${culture,,}&country=${country,,}"
fi fi
iso_download_links=$(echo "$iso_download_page_html" | grep -io "$filter") || { iso_download_links=$(echo "$iso_download_page_html" | grep -io "$filter") || {
@ -310,7 +314,7 @@ getWindows() {
info "$msg" && html "$msg" info "$msg" && html "$msg"
case "${version,,}" in case "${version,,}" in
"win2008r2" | "win81${PLATFORM,,}-enterprise"* | "win11${PLATFORM,,}-enterprise-iot"* | "win11${PLATFORM,,}-enterprise-ltsc"* ) "win2008r2" | "win81${PLATFORM,,}"* | "win11${PLATFORM,,}-enterprise-iot"* | "win11${PLATFORM,,}-enterprise-ltsc"* )
if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then
error "No download in the $language language available for $edition!" error "No download in the $language language available for $edition!"
MIDO_URL="" && return 1 MIDO_URL="" && return 1
@ -335,7 +339,7 @@ getWindows() {
"win11${PLATFORM,,}-enterprise"* | "win10${PLATFORM,,}-enterprise"* ) "win11${PLATFORM,,}-enterprise"* | "win10${PLATFORM,,}-enterprise"* )
download_windows_eval "$version" "$lang" "$edition" && return 0 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 download_windows_eval "$version" "$lang" "$edition" && return 0
;; ;;
"win81${PLATFORM,,}-enterprise"* | "win2008r2" ) "win81${PLATFORM,,}-enterprise"* | "win2008r2" )
@ -343,53 +347,10 @@ getWindows() {
* ) error "Invalid VERSION specified, value \"$version\" is not recognized!" ;; * ) error "Invalid VERSION specified, value \"$version\" is not recognized!" ;;
esac esac
if [[ "${PLATFORM,,}" != "x64" ]]; then MIDO_URL=$(getMido "$version" "$lang" "")
MIDO_URL="" [ -z "$MIDO_URL" ] && return 1
return 1
fi
if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then return 0
MIDO_URL=""
return 1
fi
case "${version,,}" in
"win81${PLATFORM,,}-enterprise"* )
MIDO_URL="https://download.microsoft.com/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X64FREE_EN-US_DV9.ISO"
return 0
;;
"win11${PLATFORM,,}-enterprise-iot"* | "win11${PLATFORM,,}-enterprise-ltsc"* )
MIDO_URL="https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1.240331-1435.ge_release_CLIENT_IOT_LTSC_EVAL_x64FRE_en-us.iso"
return 0
;;
"win2025-eval" )
MIDO_URL="https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1.240331-1435.ge_release_SERVER_EVAL_x64FRE_en-us.iso"
return 0
;;
"win2022-eval" )
MIDO_URL="https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/SERVER_EVAL_x64FRE_en-us.iso"
return 0
;;
"win2019-eval" )
MIDO_URL="https://software-download.microsoft.com/download/pr/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso"
return 0
;;
"win2016-eval" )
MIDO_URL="https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO"
return 0
;;
"win2012r2-eval" )
MIDO_URL="https://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO"
return 0
;;
"win2008r2" )
MIDO_URL="https://download.microsoft.com/download/4/1/D/41DEA7E0-B30D-4012-A1E3-F24DC03BA1BB/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso"
return 0
;;
esac
MIDO_URL=""
return 1
} }
getCatalog() { getCatalog() {
@ -429,243 +390,6 @@ getCatalog() {
return 0 return 0
} }
getMG() {
local version="$1"
local lang="$2"
local desc="$3"
local locale=""
local culture=""
local language=""
local user_agent=""
user_agent=$(get_agent)
language=$(getLanguage "$lang" "desc")
culture=$(getLanguage "$lang" "culture")
local msg="Requesting download link from massgrave.dev..."
info "$msg" && html "$msg"
local pattern=""
local locale="${culture,,}"
local platform="${PLATFORM,,}"
local url="https://massgrave.dev/"
if [[ "${PLATFORM,,}" != "arm64" ]]; then
case "${version,,}" in
"win11${PLATFORM,,}" )
url+="windows_11_links"
pattern="consumer"
;;
"win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval" )
url+="windows_11_links"
pattern="business"
;;
"win11${PLATFORM,,}-ltsc" | "win11${PLATFORM,,}-enterprise-ltsc-eval" )
url+="windows_ltsc_links"
pattern="11_enterprise_ltsc"
;;
"win11${PLATFORM,,}-iot" | "win11${PLATFORM,,}-enterprise-iot-eval" )
url+="windows_ltsc_links"
pattern="11_iot"
;;
"win10${PLATFORM,,}" )
url+="windows_10_links"
pattern="consumer"
;;
"win10${PLATFORM,,}-enterprise" | "win10${PLATFORM,,}-enterprise-eval" )
url+="windows_10_links"
pattern="business"
;;
"win10${PLATFORM,,}-ltsc" | "win10${PLATFORM,,}-enterprise-ltsc-eval" )
url+="windows_ltsc_links"
pattern="10_enterprise_ltsc"
;;
"win10${PLATFORM,,}-iot" | "win10${PLATFORM,,}-enterprise-iot-eval" )
url+="windows_ltsc_links"
pattern="10_iot"
;;
"win81${PLATFORM,,}-enterprise" | "win81${PLATFORM,,}-enterprise-eval" )
url+="windows_8.1_links"
pattern="8.1_enterprise"
locale=$(getLanguage "$lang" "code")
[[ "$locale" == "sr" ]] && locale="sr-latn"
;;
"win2025" | "win2025-eval" )
url+="windows_server_links"
pattern="server_2025"
;;
"win2022" | "win2022-eval" )
url+="windows_server_links"
pattern="server_2022"
;;
"win2019" | "win2019-eval" )
url+="windows_server_links"
pattern="server_2019"
;;
"win2016" | "win2016-eval" )
url+="windows_server_links"
pattern="server_2016"
locale=$(getLanguage "$lang" "code")
[[ "$locale" == "hk" ]] && locale="ct"
[[ "$locale" == "tw" ]] && locale="ct"
;;
"win2012r2" | "win2012r2-eval" )
url+="windows_server_links"
pattern="server_2012_r2"
locale=$(getLanguage "$lang" "code")
;;
"win2008r2" | "win2008r2-eval" )
url+="windows_server_links"
pattern="server_2008_r2"
locale=$(getLanguage "$lang" "code")
;;
"win7x64" | "win7x64-enterprise" )
url+="windows_7_links"
pattern="enterprise"
locale=$(getLanguage "$lang" "code")
;;
"win7x64-ultimate" )
url+="windows_7_links"
pattern="ultimate"
locale=$(getLanguage "$lang" "code")
;;
"win7x86" | "win7x86-enterprise" )
platform="x86"
url+="windows_7_links"
pattern="enterprise"
locale=$(getLanguage "$lang" "code")
;;
"win7x86-ultimate" )
platform="x86"
url+="windows_7_links"
pattern="ultimate"
locale=$(getLanguage "$lang" "code")
;;
"winvistax64" | "winvistax64-enterprise" )
url+="windows_vista_links"
pattern="enterprise"
locale=$(getLanguage "$lang" "code")
;;
"winvistax64-ultimate" )
url+="windows_vista_links"
pattern="sp2"
locale=$(getLanguage "$lang" "code")
;;
"winvistax86" | "winvistax86-enterprise" )
platform="x86"
url+="windows_vista_links"
pattern="enterprise"
locale=$(getLanguage "$lang" "code")
;;
"winvistax86-ultimate" )
platform="x86"
url+="windows_vista_links"
pattern="sp2"
locale=$(getLanguage "$lang" "code")
;;
"winxpx86" )
platform="x86"
url+="windows_xp_links"
pattern="xp"
locale=$(getLanguage "$lang" "code")
[[ "$locale" == "pt" ]] && locale="pt-br"
[[ "$locale" == "pp" ]] && locale="pt-pt"
[[ "$locale" == "cn" ]] && locale="zh-hans"
[[ "$locale" == "hk" ]] && locale="zh-hk"
[[ "$locale" == "tw" ]] && locale="zh-tw"
;;
"winxpx64" )
url+="windows_xp_links"
pattern="xp"
locale=$(getLanguage "$lang" "code")
;;
esac
else
case "${version,,}" in
"win11${PLATFORM,,}" | "win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval" )
url+="windows_arm_links"
pattern="11_business"
;;
"win11${PLATFORM,,}-ltsc" | "win11${PLATFORM,,}-enterprise-ltsc-eval" )
url+="windows_arm_links"
pattern="11_iot_enterprise_ltsc"
;;
"win10${PLATFORM,,}" | "win10${PLATFORM,,}-enterprise" | "win10${PLATFORM,,}-enterprise-eval" )
url+="windows_arm_links"
pattern="Pro_10"
locale="$language"
[[ "$locale" == "Chinese" ]] && locale="ChnSimp"
[[ "$locale" == "Chinese HK" ]] && locale="ChnTrad"
[[ "$locale" == "Chinese TW" ]] && locale="ChnTrad"
;;
"win10${PLATFORM,,}-ltsc" | "win10${PLATFORM,,}-enterprise-ltsc-eval" )
url+="windows_arm_links"
pattern="10_iot_enterprise_ltsc"
;;
esac
fi
local body=""
[[ "$DEBUG" == [Yy1]* ]] && echo "Parsing product page: ${url}"
body=$(curl --silent --max-time 30 --user-agent "$user_agent" --location --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url") || {
handle_curl_error "$?" "Massgrave"
return $?
}
local list=""
list=$(echo "$body" | xmllint --html --nonet --xpath "//a[contains(text(), '.iso')]" - 2>/dev/null)
local result=""
result=$(echo "$list" | grep -i "${platform}" | grep "${pattern}" | grep -i -m 1 "${locale,,}_")
result=$(echo "$result" | sed -r 's/.*href="([^"]+).*/\1/g')
local page="$result"
if [ -z "$page" ]; then
if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then
error "No download in the $language language available for $desc!"
else
error "Failed to parse download link for $desc! Please report this at $SUPPORT/issues."
fi
return 1
fi
[[ "$DEBUG" == [Yy1]* ]] && echo "Parsing download page: ${page}"
result=$(curl --silent --max-time 30 --request GET --user-agent "$user_agent" --referer "$url" --head --proto =https --tlsv1.2 --http1.1 -- "$page") || {
handle_curl_error "$?" "Massgrave"
return $?
}
if [[ "${result,,}" == *"content-type: text"* ]]; then
body=$(curl --silent --max-time 30 --user-agent "$user_agent" --referer "$url" --location --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$page") || {
handle_curl_error "$?" "Massgrave"
return $?
}
list=$(echo "$body" | xmllint --html --nonet --xpath "//a[contains(@href, '.iso')]" - 2>/dev/null)
list=$(echo "$list" | sed -r 's/.*href="([^"]+).*/\1/g')
page=$(echo "$list" | sed 's/&amp;/\&/g;')
if [ -z "$page" ]; then
if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then
error "No download in the $language language available for $desc!"
else
error "Failed to parse download link for $desc! Please report this at $SUPPORT/issues."
fi
return 1
fi
fi
MG_URL="$page"
return 0
}
getESD() { getESD() {
local dir="$1" local dir="$1"
@ -748,6 +472,18 @@ getESD() {
return 0 return 0
} }
isCompressed() {
local file="$1"
case "${file,,}" in
*".7z" | *".zip" | *".rar" | *".lzma" | *".bz" | *".bz2" )
return 0 ;;
esac
return 1
}
verifyFile() { verifyFile() {
local iso="$1" local iso="$1"
@ -756,7 +492,9 @@ verifyFile() {
local check="$4" local check="$4"
if [ -n "$size" ] && [[ "$total" != "$size" ]] && [[ "$size" != "0" ]]; then if [ -n "$size" ] && [[ "$total" != "$size" ]] && [[ "$size" != "0" ]]; then
warn "The downloaded file has an unexpected size: $total bytes, while expected value was: $size bytes. Please report this at $SUPPORT/issues" if [[ "$VERIFY" == [Yy1]* ]] || [[ "$DEBUG" == [Yy1]* ]]; then
warn "The downloaded file has a different size ( $total bytes) than expected ( $size bytes). Please report this at $SUPPORT/issues"
fi
fi fi
local hash="" local hash=""
@ -779,7 +517,7 @@ verifyFile() {
info "Succesfully verified ISO!" && return 0 info "Succesfully verified ISO!" && return 0
fi fi
error "The downloaded file has an invalid $algo checksum: $hash , while expected value was: $check. Please report this at $SUPPORT/issues" error "The downloaded file has an unknown $algo checksum: $hash , as the expected value was: $check. Please report this at $SUPPORT/issues"
return 1 return 1
} }
@ -791,14 +529,16 @@ downloadFile() {
local size="$4" local size="$4"
local lang="$5" local lang="$5"
local desc="$6" local desc="$6"
local rc total progress domain dots space folder local msg="Downloading $desc"
local rc total total_gb progress domain dots space folder
rm -f "$iso" rm -f "$iso"
if [ -n "$size" ] && [[ "$size" != "0" ]]; then if [ -n "$size" ] && [[ "$size" != "0" ]]; then
folder=$(dirname -- "$iso") folder=$(dirname -- "$iso")
space=$(df --output=avail -B 1 "$folder" | tail -n 1) space=$(df --output=avail -B 1 "$folder" | tail -n 1)
(( size > space )) && error "Not enough free space left to download file!" && return 1 total_gb=$(formatBytes "$space")
(( size > space )) && error "Not enough free space to download file, only $total_gb left!" && return 1
fi fi
# Check if running with interactive TTY or redirected to docker log # Check if running with interactive TTY or redirected to docker log
@ -808,8 +548,8 @@ downloadFile() {
progress="--progress=dot:giga" progress="--progress=dot:giga"
fi fi
local msg="Downloading $desc"
html "$msg..." html "$msg..."
/run/progress.sh "$iso" "$size" "$msg ([P])..." &
domain=$(echo "$url" | awk -F/ '{print $3}') domain=$(echo "$url" | awk -F/ '{print $3}')
dots=$(echo "$domain" | tr -cd '.' | wc -c) dots=$(echo "$domain" | tr -cd '.' | wc -c)
@ -820,7 +560,6 @@ downloadFile() {
fi fi
info "$msg..." info "$msg..."
/run/progress.sh "$iso" "$size" "$msg ([P])..." &
{ wget "$url" -O "$iso" -q --timeout=30 --no-http-keep-alive --show-progress "$progress"; rc=$?; } || : { wget "$url" -O "$iso" -q --timeout=30 --no-http-keep-alive --show-progress "$progress"; rc=$?; } || :
@ -828,17 +567,19 @@ downloadFile() {
if (( rc == 0 )) && [ -f "$iso" ]; then if (( rc == 0 )) && [ -f "$iso" ]; then
total=$(stat -c%s "$iso") total=$(stat -c%s "$iso")
total_gb=$(formatBytes "$total")
if [ "$total" -lt 100000000 ]; then if [ "$total" -lt 100000000 ]; then
error "Invalid download link: $url (is only $total bytes?). Please report this at $SUPPORT/issues." && return 1 error "Invalid download link: $url (is only $total_gb ?). Please report this at $SUPPORT/issues." && return 1
fi fi
verifyFile "$iso" "$size" "$total" "$sum" || return 1 verifyFile "$iso" "$size" "$total" "$sum" || return 1
isCompressed "$url" && UNPACK="Y"
html "Download finished successfully..." && return 0 html "Download finished successfully..." && return 0
fi fi
msg="Failed to download $url" msg="Failed to download $url"
(( rc == 3 )) && error "$msg , cannot write file (disk full?)" && return 1 (( rc == 3 )) && error "$msg , cannot write file (disk full?)" && return 1
(( rc == 4 )) && error "$msg , network failure!" && return 1 (( rc == 4 )) && error "$msg , network failure!" && return 1
(( rc == 8 )) && error "$msg , server issued an error response!" && return 1 (( rc == 8 )) && error "$msg , server issued an error response! Please report this at $SUPPORT/issues." && return 1
error "$msg , reason: $rc" error "$msg , reason: $rc"
return 1 return 1
@ -856,12 +597,14 @@ downloadImage() {
local msg="Will retry after $delay seconds..." local msg="Will retry after $delay seconds..."
if [[ "${version,,}" == "http"* ]]; then if [[ "${version,,}" == "http"* ]]; then
base=$(basename "$iso") base=$(basename "$iso")
desc=$(fromFile "$base") desc=$(fromFile "$base")
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0 downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
info "$msg" && html "$msg" && sleep "$delay" info "$msg" && html "$msg" && sleep "$delay"
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0 downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
rm -f "$iso" rm -f "$iso"
return 1 return 1
fi fi
@ -950,31 +693,6 @@ downloadImage() {
done done
if isMG "$version" "$lang"; then
if [[ "$tried" != "n" ]]; then
info "Failed to download $desc, will try a diferent method now..."
fi
tried="y"
success="n"
if getMG "$version" "$lang" "$desc"; then
success="y"
else
info "$msg" && html "$msg" && sleep "$delay"
getMG "$version" "$lang" "$desc" && success="y"
fi
if [[ "$success" == "y" ]]; then
downloadFile "$iso" "$MG_URL" "" "" "$lang" "$desc" && return 0
info "$msg" && html "$msg" && sleep "$delay"
downloadFile "$iso" "$MG_URL" "" "" "$lang" "$desc" && return 0
rm -f "$iso"
fi
fi
return 1 return 1
} }

View file

@ -85,7 +85,7 @@ configure_guest_network_interface() {
fi fi
RETRIES=10 RETRIES=10
for i in $(seq 1 $RETRIES); do for j in $(seq 1 $RETRIES); do
OUTPUT=$(python3 /run/qga.py powershell -Command "(\$(Get-NetAdapter -Name '$INTERFACE_NAME').Status)") OUTPUT=$(python3 /run/qga.py powershell -Command "(\$(Get-NetAdapter -Name '$INTERFACE_NAME').Status)")
STATUS=$(echo "$OUTPUT" | grep -A1 'STDOUT:' | tail -n1 | tr -d '\r' | xargs) STATUS=$(echo "$OUTPUT" | grep -A1 'STDOUT:' | tail -n1 | tr -d '\r' | xargs)
@ -94,8 +94,8 @@ configure_guest_network_interface() {
echo "Interface '$INTERFACE_NAME' is up!" echo "Interface '$INTERFACE_NAME' is up!"
break break
else else
echo "Waiting for interface '$INTERFACE_NAME' to be up... ($i/$RETRIES)" echo "Waiting for interface '$INTERFACE_NAME' to be up... ($j/$RETRIES)"
sleep $SLEEP sleep 1
fi fi
done done

View file

@ -14,6 +14,10 @@ if [[ "$DHCP" == [Yy1]* ]]; then
interface="$VM_NET_DEV" interface="$VM_NET_DEV"
fi fi
if [[ "${NETWORK,,}" == "user"* ]]; then
interface="127.0.0.1"
fi
addShare() { addShare() {
local dir="$1" local dir="$1"
local name="$2" local name="$2"
@ -99,6 +103,11 @@ for dir in "${dirs[@]}"; do
addShare "$dir" "$dir_name" "Shared $dir_name" || error "Failed to create shared folder for $dir!" addShare "$dir" "$dir_name" "Shared $dir_name" || error "Failed to create shared folder for $dir!"
done done
# Fix Samba permissions
[ -d /run/samba/msg.lock ] && chmod -R 0755 /run/samba/msg.lock
[ -d /var/log/samba/cores ] && chmod -R 0700 /var/log/samba/cores
[ -d /var/cache/samba/msg.lock ] && chmod -R 0755 /var/cache/samba/msg.lock
if ! smbd; then if ! smbd; then
error "Samba daemon failed to start!" error "Samba daemon failed to start!"
smbd -i --debug-stdout || true smbd -i --debug-stdout || true