Compare commits

..

129 commits

Author SHA1 Message Date
renovate[bot]
2822cfdc4b
chore(deps): update qemux/qemu-arm docker tag to v7.12 (#328) 2025-05-06 06:41:29 +02:00
Kroese
810a69f5b7
docs: Add input types (#326) 2025-04-23 13:00:14 +02:00
Kroese
0ea09e57fc
feat: Additional download mirrors (#325) 2025-04-21 01:16:42 +02:00
Kroese
03cdae6bd3
feat: Additional download mirrors (#324) 2025-04-20 21:58:31 +02:00
Kroese
f96e342cc5
fix: Drivers location (#323) 2025-04-20 19:27:09 +02:00
Kroese
94cd48815b
feat: Sync definitions (#322) 2025-04-20 12:32:03 +02:00
Kroese
0b7a9d45c5
feat: Set user agent for downloads (#321) 2025-04-20 11:32:29 +02:00
Kroese
5816d03252
build: Add x64 image to manifest (#320) 2025-04-16 17:49:58 +02:00
Kroese
bd0cec587c
docs: Add quotes around $PWD (#318) 2025-04-16 12:10:19 +02:00
Kroese
8e51697a64
build: Update qemu-arm to v7.11 (#317) 2025-04-14 20:55:07 +02:00
Kroese
7d900d3e97
feat: Support boot.iso files (#316) 2025-04-14 20:16:22 +02:00
Kroese
a4e4d84ca3
fix: Disallow RDP login with blank password (#315) 2025-04-14 11:06:46 +02:00
Kroese
f87bd50d70
feat: Check shared folder permissions (#314) 2025-04-09 09:37:27 +02:00
Kroese
5b1108d6f5
fix: Avoid pipe to head on find (#313) 2025-04-09 08:06:19 +02:00
Kroese
a74690db69
build: Update VirtIO drivers to v0.1.271 (#312) 2025-04-08 08:06:56 +02:00
Kroese
de0479d7af
feat: Don't display domain (#311) 2025-04-06 08:31:33 +02:00
Kroese
10197dfebb
build: Add netcat-openbsd (#310) 2025-04-06 00:33:55 +02:00
Kroese
38d03f4bfa
feat: Set a password per default (#309) 2025-04-06 00:30:51 +02:00
Kroese
7797df5d35
build: Update qemu-arm to v7.08 (#307) 2025-04-04 01:24:01 +02:00
Kroese
0c50a08808
docs: Disk pass-through (#306) 2025-04-03 10:29:42 +02:00
Kroese
d5c9b7a2aa
docs: Manual installation (#305) 2025-04-03 02:05:33 +02:00
Kroese
cb7c215745
fix: Ignore missing custom .iso after install (#304) 2025-04-03 01:39:40 +02:00
Kroese
e8b3b8dbbc
build: Update to qemu-arm v7.07 (#303) 2025-03-28 20:28:04 +01:00
Kroese
9f361e61ae
docs: Github Codespaces (#302) 2025-03-27 01:47:53 +01:00
Kroese
6b829625f6
build: Update to qemu-arm v7.06 (#301) 2025-03-26 19:39:35 +01:00
Kroese
455935e2b3
docs: Github Codespaces (#300) 2025-03-25 14:50:56 +01:00
Kroese
ba37a4c352
fix: Remove non-printable characters (#299) 2025-03-24 14:04:37 +01:00
renovate[bot]
e19f278c38
build: Update qemu-arm to v7.04 (#297) 2025-03-21 22:07:08 +01:00
Kroese
db81ac3ebf
docs: KVM information (#296) 2025-03-20 23:21:34 +01:00
Kroese
6318dbc9be
docs: Compatibility chart (#295) 2025-03-20 23:07:21 +01:00
Kroese
81b80c662a
docs: Add Podman (#294) 2025-03-20 20:05:01 +01:00
Kroese
a120d7c8c4
feat: Platform variable (#293) 2025-03-20 11:00:28 +01:00
Kroese
60b48bc6f3
fix: Remove control characters (#292) 2025-03-20 01:18:02 +01:00
Kroese
d435ff52f8
fix: File sharing in user-mode (#291) 2025-03-19 13:49:49 +01:00
Kroese
c791f2a2fe
fix: Check if IP is specified (#290) 2025-03-19 09:37:33 +01:00
Kroese
6c800a97bf
feat: Add devcontainer (#289) 2025-03-19 09:17:10 +01:00
Kroese
afba96b912
fix: Samba for user-mode networking (#288) 2025-03-18 19:35:09 +01:00
Kroese
76bc9799ea
feat: Add entry to hosts file (#287) 2025-03-18 17:34:46 +01:00
Kroese
9d840bc012
docs: Formatting (#286) 2025-03-18 14:25:18 +01:00
Kroese
0751b7cb16
docs: Github Codespaces (#285) 2025-03-18 14:05:53 +01:00
Kroese
0b0c2dc1d8
feat: Add devcontainer (#284) 2025-03-18 11:18:52 +01:00
Kroese
70cb1ae98c
fix: Remove port 80 (#283) 2025-03-18 05:17:16 +01:00
Kroese
517ad6418d
build: Update qemu-arm to v3.07 (#282) 2025-03-18 04:03:33 +01:00
Kroese
2037a1783a
feat: Switch to port 80 (#281) 2025-03-17 16:45:04 +01:00
Kroese
68b2536858
fix: Format filesizes (#280) 2025-03-15 14:16:16 +01:00
Kroese
157ca3e80c
docs: Product key (#279) 2025-03-14 13:58:51 +01:00
Kroese
b37137ab29
feat: Add Hyper-V Server 2019 (#278) 2025-03-14 13:31:33 +01:00
Kroese
d77408340f
feat: Add Hyper-V Server 2019 (#277) 2025-03-14 13:27:07 +01:00
renovate[bot]
ec346984fd
build: Update qemu-docker to v3.05 (#276)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-14 12:58:07 +01:00
Kroese
2dbed4ead7
feat: Allow product key configuration (#275) 2025-03-13 12:45:24 +01:00
Kroese
66d5c41083
docs: Readme (#274) 2025-03-13 02:07:03 +01:00
renovate[bot]
e1a59dfe48
build: Update qemu-arm to v3.04 (#273) 2025-03-12 21:52:26 +01:00
Kroese
837f007c6c
docs: Use relative paths (#272) 2025-03-12 12:10:09 +01:00
Kroese
5606964164
Merge pull request #271 from dockur/dev
feat: Install driver during specialization phase
2025-03-11 06:10:14 +01:00
Kroese
0e639c5f30
Update win11arm64-enterprise.xml 2025-03-11 06:03:16 +01:00
Kroese
8a0245156d
Update win11arm64-ltsc.xml 2025-03-11 06:01:49 +01:00
Kroese
0b8185477e
Update win11arm64.xml 2025-03-11 06:00:36 +01:00
Kroese
de644aeb69
Update define.sh 2025-03-07 02:23:26 +01:00
Kroese
c0f15f6dc2
docs: Kubernetes deployment (#270) 2025-03-07 00:45:52 +01:00
Kroese
23696ef3d3
fix: Samba permissions (#269) 2025-03-06 10:27:30 +01:00
Kroese
3d48fafab1
feat: Hide unknown size message by default (#268) 2025-03-05 10:57:48 +01:00
Kroese
47329a3791
feat: Refactor download code (#267) 2025-03-05 09:15:11 +01:00
Kroese
8fe463a7bc
fix: Update download links (#266) 2025-03-05 06:53:54 +01:00
Kroese
908024ade5
fix: Remove broken links (#265) 2025-03-05 06:23:21 +01:00
Kroese
59a73ab9da
feat: Remove migrations (#264) 2025-03-05 05:41:10 +01:00
Kroese
04f7822b6b
fix: Samba permissions (#263) 2025-03-04 15:45:49 +01:00
Kroese
4f5a54d9e2
build: Update qemu-arm to v3.02 (#262) 2025-03-03 12:27:45 +01:00
Kroese
d978d437c9
docs: Clarify environment variables (#261) 2025-03-01 14:06:37 +01:00
Kroese
fc6ada2f26
feat: Check path to custom .iso (#260) 2025-02-28 04:01:06 +01:00
Kroese
24c6643d00
feat: Update download links (#259) 2025-02-26 23:51:53 +01:00
Kroese
0a6af455d4
feat: Update download links (#258) 2025-02-26 23:10:22 +01:00
Kroese
f0437fe9d1
build: Update qemu-arm to v3.01 (#257) 2025-02-26 22:48:43 +01:00
Kroese
aacfb171d0
feat: Make app name configurable (#256) 2025-02-25 15:14:39 +01:00
Kroese
9384681417
build: Update qemu-arm to v3.00 (#255) 2025-02-25 05:58:26 +01:00
Kroese
fa993d7363
build: Update qemu-arm to v2.28 (#254) 2025-02-24 04:08:37 +01:00
Kroese
f208547bb7
docs: Readme (#253) 2025-02-22 10:04:27 +01:00
Kroese
7d56eb173a
fix: Update download links (#252) 2025-02-22 09:47:49 +01:00
Kroese
8f60cbe897
feat: Fallback to Windows 11 if version unknown (#250) 2025-02-17 18:59:15 +01:00
Kroese
355444950a
feat: Add restart policy (#249) 2025-02-17 09:28:01 +01:00
Kroese
507707c910
fix: Download links (#248) 2025-02-15 04:43:51 +01:00
Kroese
f0a7761e76
docs: Add restart policy (#247) 2025-02-10 00:26:09 +01:00
renovate[bot]
d5533d16bd
chore(deps): update qemux/qemu-arm docker tag to v2.26 (#245) 2025-02-06 02:06:19 +01:00
Kroese
9ea278e3f1
build: Update qemu-arm to v2.25 (#244) 2025-01-15 23:28:48 +01:00
Kroese
4769201d0f
feat: Alllow symlinks in shared folder (#243) 2025-01-08 15:58:19 +01:00
Kroese
4c6113e882
feat: Update download links (#242) 2025-01-06 19:18:03 +01:00
Kroese
2ad2289756
fix: Follow download redirects (#241) 2024-12-20 18:24:44 +01:00
Kroese
7914ef8132
feat: Add Tiny11 (#240) 2024-12-20 15:25:44 +01:00
Kroese
fd3460265e
docs: Readme (#237) 2024-12-06 11:20:26 +01:00
Kroese
3f4aec0fe3
build: Use default wsdd package (#236) 2024-12-03 12:02:21 +01:00
Kroese
204e6fe42b
build: Update qemu-arm to v2.23 (#235) 2024-12-03 11:55:13 +01:00
Kroese
5f58b707c3
docs: Add TUN device (#234) 2024-12-01 17:13:50 +01:00
Kroese
f235538ca2
feat: Additional download mirrors (#232) 2024-11-24 21:46:38 +01:00
Kroese
6458627ee4
docs: Readme (#231) 2024-11-20 13:28:10 +01:00
Kroese
24a9b1b2ba
feat: Improved download method (#228) 2024-11-15 05:06:47 +01:00
Kroese
0435a59e07
docs: Use multi-platform image (#227) 2024-11-13 04:50:39 +01:00
Kroese
cdae8a8367
docs: Compatibility chart (#226) 2024-11-13 03:40:54 +01:00
Kroese
2ffe792d3e
docs: Add Kubernetes URL (#225) 2024-11-13 03:33:07 +01:00
Kroese
58f3fe9944
docs: Add compatibility chart (#224) 2024-11-13 03:29:20 +01:00
Kroese
45768173b9
fix: Disable HTTP keepalives (#223) 2024-11-13 02:51:04 +01:00
Kroese
67d5fb0703
build: Update qemu-arm to v2.20 (#222) 2024-11-13 00:51:41 +01:00
Kroese
b30479a266
feat: Retry failed downloads (#219) 2024-11-11 17:47:20 +01:00
Kroese
d093e4fff3
docs: KVM troubleshooting (#218) 2024-11-11 14:21:19 +01:00
Kroese
3a5d10dc51
feat: Warn for unsupported versions (#217) 2024-11-11 13:42:33 +01:00
Kroese
b712403c8a
docs: Display output information (#216) 2024-11-11 13:09:01 +01:00
Mohammad norouzi
69acf047d8
docs: Fix typo (#214) 2024-11-10 11:30:41 +01:00
Kroese
9d91e532a3
feat: Update download links (#213) 2024-11-09 23:47:38 +01:00
Kroese
938af07fea
docs: Version alias (#212) 2024-11-09 23:23:02 +01:00
Kroese
0b42428a75
feat: Additional aliasses (#210) 2024-10-24 12:17:29 +02:00
Kroese
85f7773e91
docs: Architecture (#208) 2024-10-15 00:53:51 +02:00
Kroese
4a12c6e38f
build: Remove index annotations (#207) 2024-10-15 00:35:19 +02:00
Kroese
b9454d9647
build: Remove AMD64 platform (#206) 2024-10-14 18:56:06 +02:00
Kroese
cb93f0e5be
feat: Support multiple shared folders (#205) 2024-10-14 16:42:14 +02:00
Kroese
43cb674038
fix: Continue without drivers (#204) 2024-10-14 15:25:14 +02:00
Kroese
7777c17c2a
feat: Use bsdtar to extract drivers archive (#203) 2024-10-13 21:17:40 +02:00
Kroese
7016a9cb70
fix: Shared folder mount (#202) 2024-10-13 12:03:54 +02:00
Kroese
2397a3ed0b
feat: Extract drivers to temporary folder (#201) 2024-10-13 11:42:39 +02:00
Kroese
9c804b8208
feat: Support Rockchip Orange Pi 5 Plus (#200) 2024-10-13 00:38:31 +02:00
Kroese
9b6dbb4899
feat: Additional download mirrors (#199) 2024-10-12 19:04:32 +02:00
Kroese
a53e894aec
feat: Additional download mirrors (#198) 2024-10-12 18:10:37 +02:00
Kroese
ef51c7d6c5
feat: Select LTSC edition based on key (#197) 2024-10-12 16:57:29 +02:00
Kroese
1ed74593d1
docs: Features (#196) 2024-10-12 15:53:38 +02:00
Kroese
d3a2b0bcae
feat: Extract temporary files to RAM (#195) 2024-10-12 14:29:32 +02:00
Kroese
8de285a22b
feat: Install VirtIO display driver (#194) 2024-10-11 11:40:53 +02:00
Kroese
f8469f519e
feat: Copy drivers to Windows folder (#193) 2024-10-11 11:37:45 +02:00
Kroese
44ec997322
feat: Remove empty Windows.old folder (#192) 2024-10-11 11:33:07 +02:00
Kroese
ab1023f2d8
feat: Remove empty Windows.old folder (#191) 2024-10-11 00:05:21 +02:00
Kroese
9ee88b732c
feat: Disable SMB signing requirement (#190) 2024-10-10 21:19:01 +02:00
Kroese
1c901d6083
docs: Frequently asked questions (#189) 2024-10-10 10:55:50 +02:00
Kroese
0ec0665117
fix: Disable unsigned drivers (#188) 2024-10-08 14:49:12 +02:00
20 changed files with 1037 additions and 663 deletions

6
.devcontainer.json Normal file
View file

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

View file

@ -21,6 +21,7 @@ body:
attributes:
label: Docker compose
description: The compose file (or otherwise the `docker run` command used).
render: yaml
validations:
required: true
- type: textarea
@ -28,6 +29,7 @@ body:
attributes:
label: Docker log
description: The logfile of the container (as shown by `docker logs windows`).
render: shell
validations:
required: true
- type: textarea

View file

@ -23,6 +23,7 @@ body:
attributes:
label: Docker compose
description: The compose file (or otherwise the `docker run` command used).
render: yaml
validations:
required: true
- type: textarea
@ -30,6 +31,7 @@ body:
attributes:
label: Docker log
description: The logfile of the container (as shown by `docker logs windows`).
render: shell
validations:
required: true
- type: textarea

View file

@ -1,7 +1,7 @@
FROM scratch
COPY --from=qemux/qemu-arm:2.17 / /
COPY --from=qemux/qemu-arm:7.12 / /
ARG VERSION_ARG="0.0"
ARG VERSION_ARG="0.00"
ARG DEBCONF_NOWARNINGS="yes"
ARG DEBIAN_FRONTEND="noninteractive"
ARG DEBCONF_NONINTERACTIVE_SEEN="true"
@ -9,17 +9,14 @@ ARG DEBCONF_NONINTERACTIVE_SEEN="true"
RUN set -eu && \
apt-get update && \
apt-get --no-install-recommends -y install \
bc \
curl \
7zip \
wsdd \
samba \
xz-utils \
wimtools \
dos2unix \
cabextract \
genisoimage \
libxml2-utils && \
libxml2-utils \
libarchive-tools \
netcat-openbsd && \
apt-get clean && \
echo "$VERSION_ARG" > /run/version && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@ -27,15 +24,14 @@ RUN set -eu && \
COPY --chmod=755 ./src /run/
COPY --chmod=755 ./assets /run/assets
ADD --chmod=755 https://raw.githubusercontent.com/christgau/wsdd/v0.8/src/wsdd.py /usr/sbin/wsdd
ADD --chmod=664 https://github.com/qemus/virtiso-arm/releases/download/v0.1.262-2/virtio-win-0.1.262.tar.xz /drivers.txz
ADD --chmod=664 https://github.com/qemus/virtiso-arm/releases/download/v0.1.271-1/virtio-win-0.1.271.tar.xz /var/drivers.txz
EXPOSE 8006 3389
VOLUME /storage
EXPOSE 3389 8006
ENV VERSION="11"
ENV RAM_SIZE="4G"
ENV CPU_CORES="2"
ENV DISK_SIZE="64G"
ENV VERSION="win11"
ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"]

View file

@ -326,11 +326,6 @@
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "AllowInsecureGuestAuth" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Allow guest access to network shares</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v LimitBlankPasswordUse /t REG_DWORD /d 0 /f</CommandLine>
<Description>Allow RDP login with blank password</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>3</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v "DevicePasswordLessBuildVersion" /t REG_DWORD /d 0 /f</CommandLine>
@ -418,6 +413,11 @@
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<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>
<Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand>

View file

@ -329,11 +329,6 @@
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "AllowInsecureGuestAuth" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Allow guest access to network shares</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v LimitBlankPasswordUse /t REG_DWORD /d 0 /f</CommandLine>
<Description>Allow RDP login with blank password</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>3</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v "DevicePasswordLessBuildVersion" /t REG_DWORD /d 0 /f</CommandLine>
@ -421,6 +416,11 @@
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<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>
<Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand>

View file

@ -326,11 +326,6 @@
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "AllowInsecureGuestAuth" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Allow guest access to network shares</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v LimitBlankPasswordUse /t REG_DWORD /d 0 /f</CommandLine>
<Description>Allow RDP login with blank password</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>3</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v "DevicePasswordLessBuildVersion" /t REG_DWORD /d 0 /f</CommandLine>
@ -418,6 +413,11 @@
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<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>
<Description>Execute custom script from the OEM folder if exists</Description>
</SynchronousCommand>

View file

@ -268,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>
<Description>Set Network Location to Home</Description>
</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>
</component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
@ -347,101 +352,111 @@
</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>
<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>
<Order>4</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v "DevicePasswordLessBuildVersion" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Enable option for passwordless sign-in</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>4</Order>
<Order>5</Order>
<CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine>
<Description>Password Never Expires</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>5</Order>
<Order>6</Order>
<CommandLine>cmd /C POWERCFG -H OFF</CommandLine>
<Description>Disable Hibernation</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>6</Order>
<Order>7</Order>
<CommandLine>cmd /C POWERCFG -X -monitor-timeout-ac 0</CommandLine>
<Description>Disable monitor blanking</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>7</Order>
<Order>8</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /v "HideFirstRunExperience" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Disable first-run experience in Edge</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>8</Order>
<Order>9</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Show file extensions in Explorer</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>9</Order>
<Order>10</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateFileSizePercent" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Zero Hibernation File</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>10</Order>
<Order>11</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateEnabled" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable Hibernation</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>11</Order>
<Order>12</Order>
<CommandLine>cmd /C POWERCFG -X -standby-timeout-ac 0</CommandLine>
<Description>Disable Sleep</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>12</Order>
<Order>13</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "fAllowUnlistedRemotePrograms" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Enable RemoteAPP to launch unlisted programs</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>13</Order>
<Order>14</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowTaskViewButton" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Remove Task View from the Taskbar</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>14</Order>
<Order>15</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarDa" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Remove Widgets from the Taskbar</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>15</Order>
<Order>16</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Remove Chat from the Taskbar</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>16</Order>
<Order>17</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Turn off Windows Update auto download</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>17</Order>
<Order>18</Order>
<CommandLine>netsh advfirewall firewall set rule group="@FirewallAPI.dll,-32752" new enable=Yes</CommandLine>
<Description>Enable Network Discovery</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>18</Order>
<Order>19</Order>
<CommandLine>netsh advfirewall firewall set rule group="@FirewallAPI.dll,-28502" new enable=Yes</CommandLine>
<Description>Enable File Sharing</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>19</Order>
<Order>20</Order>
<CommandLine>reg.exe add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v SV1 /d 0 /t REG_DWORD /f</CommandLine>
<Description>Disable unsupported hardware notifications</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>20</Order>
<Order>21</Order>
<CommandLine>reg.exe add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v SV2 /d 0 /t REG_DWORD /f</CommandLine>
<Description>Disable unsupported hardware notifications</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<Order>22</Order>
<CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description>
</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">
<Order>24</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>

View file

@ -61,12 +61,6 @@
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/image/index</Key>
<Value>1</Value>
</MetaData>
</InstallFrom>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>3</PartitionID>
@ -87,7 +81,7 @@
<FullName>Docker</FullName>
<Organization>Windows for Docker</Organization>
<ProductKey>
<Key />
<Key>M7XTQ-FN8P6-TTKYV-9D4CC-J462D</Key>
</ProductKey>
</UserData>
<EnableFirewall>false</EnableFirewall>
@ -273,6 +267,11 @@
<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>
</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>
</component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
@ -352,101 +351,111 @@
</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>
<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>
<Order>4</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v "DevicePasswordLessBuildVersion" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Enable option for passwordless sign-in</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>4</Order>
<Order>5</Order>
<CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine>
<Description>Password Never Expires</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>5</Order>
<Order>6</Order>
<CommandLine>cmd /C POWERCFG -H OFF</CommandLine>
<Description>Disable Hibernation</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>6</Order>
<Order>7</Order>
<CommandLine>cmd /C POWERCFG -X -monitor-timeout-ac 0</CommandLine>
<Description>Disable monitor blanking</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>7</Order>
<Order>8</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /v "HideFirstRunExperience" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Disable first-run experience in Edge</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>8</Order>
<Order>9</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Show file extensions in Explorer</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>9</Order>
<Order>10</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateFileSizePercent" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Zero Hibernation File</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>10</Order>
<Order>11</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateEnabled" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable Hibernation</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>11</Order>
<Order>12</Order>
<CommandLine>cmd /C POWERCFG -X -standby-timeout-ac 0</CommandLine>
<Description>Disable Sleep</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>12</Order>
<Order>13</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "fAllowUnlistedRemotePrograms" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Enable RemoteAPP to launch unlisted programs</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>13</Order>
<Order>14</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowTaskViewButton" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Remove Task View from the Taskbar</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>14</Order>
<Order>15</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarDa" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Remove Widgets from the Taskbar</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>15</Order>
<Order>16</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Remove Chat from the Taskbar</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>16</Order>
<Order>17</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Turn off Windows Update auto download</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>17</Order>
<Order>18</Order>
<CommandLine>netsh advfirewall firewall set rule group="@FirewallAPI.dll,-32752" new enable=Yes</CommandLine>
<Description>Enable Network Discovery</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>18</Order>
<Order>19</Order>
<CommandLine>netsh advfirewall firewall set rule group="@FirewallAPI.dll,-28502" new enable=Yes</CommandLine>
<Description>Enable File Sharing</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>19</Order>
<Order>20</Order>
<CommandLine>reg.exe add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v SV1 /d 0 /t REG_DWORD /f</CommandLine>
<Description>Disable unsupported hardware notifications</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>20</Order>
<Order>21</Order>
<CommandLine>reg.exe add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v SV2 /d 0 /t REG_DWORD /f</CommandLine>
<Description>Disable unsupported hardware notifications</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<Order>22</Order>
<CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description>
</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">
<Order>24</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>

View file

@ -268,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>
<Description>Set Network Location to Home</Description>
</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>
</component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
@ -347,101 +352,111 @@
</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>
<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>
<Order>4</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v "DevicePasswordLessBuildVersion" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Enable option for passwordless sign-in</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>4</Order>
<Order>5</Order>
<CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine>
<Description>Password Never Expires</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>5</Order>
<Order>6</Order>
<CommandLine>cmd /C POWERCFG -H OFF</CommandLine>
<Description>Disable Hibernation</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>6</Order>
<Order>7</Order>
<CommandLine>cmd /C POWERCFG -X -monitor-timeout-ac 0</CommandLine>
<Description>Disable monitor blanking</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>7</Order>
<Order>8</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /v "HideFirstRunExperience" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Disable first-run experience in Edge</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>8</Order>
<Order>9</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Show file extensions in Explorer</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>9</Order>
<Order>10</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateFileSizePercent" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Zero Hibernation File</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>10</Order>
<Order>11</Order>
<CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "HibernateEnabled" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Disable Hibernation</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>11</Order>
<Order>12</Order>
<CommandLine>cmd /C POWERCFG -X -standby-timeout-ac 0</CommandLine>
<Description>Disable Sleep</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>12</Order>
<Order>13</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "fAllowUnlistedRemotePrograms" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Enable RemoteAPP to launch unlisted programs</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>13</Order>
<Order>14</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowTaskViewButton" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Remove Task View from the Taskbar</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>14</Order>
<Order>15</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarDa" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Remove Widgets from the Taskbar</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>15</Order>
<Order>16</Order>
<CommandLine>reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d 0 /f</CommandLine>
<Description>Remove Chat from the Taskbar</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>16</Order>
<Order>17</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /t REG_DWORD /d 1 /f</CommandLine>
<Description>Turn off Windows Update auto download</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>17</Order>
<Order>18</Order>
<CommandLine>netsh advfirewall firewall set rule group="@FirewallAPI.dll,-32752" new enable=Yes</CommandLine>
<Description>Enable Network Discovery</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>18</Order>
<Order>19</Order>
<CommandLine>netsh advfirewall firewall set rule group="@FirewallAPI.dll,-28502" new enable=Yes</CommandLine>
<Description>Enable File Sharing</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>19</Order>
<Order>20</Order>
<CommandLine>reg.exe add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v SV1 /d 0 /t REG_DWORD /f</CommandLine>
<Description>Disable unsupported hardware notifications</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>20</Order>
<Order>21</Order>
<CommandLine>reg.exe add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v SV2 /d 0 /t REG_DWORD /f</CommandLine>
<Description>Disable unsupported hardware notifications</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>21</Order>
<Order>22</Order>
<CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description>
</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">
<Order>24</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>

View file

@ -1,15 +1,19 @@
services:
windows:
image: dockurr/windows
container_name: windows
image: dockurr/windows-arm
environment:
VERSION: "win11"
VERSION: "11"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 3389:3389/tcp
- 3389:3389/udp
volumes:
- ./windows:/storage
restart: always
stop_grace_period: 2m

View file

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

256
readme.md
View file

@ -14,11 +14,8 @@
Windows for ARM in a Docker container, for devices like the Raspberry Pi 5 and many others.
*Note: for KVM acceleration you need a Linux-based operating system, as it's not available on MacOS unfortunately.*
## Features ✨
- Multi-language
- ISO downloader
- KVM acceleration
- Web-based viewer
@ -29,45 +26,53 @@ Windows for ARM in a Docker container, for devices like the Raspberry Pi 5 and m
## Usage 🐳
Via Docker Compose:
##### Via Docker Compose:
```yaml
services:
windows:
image: dockurr/windows
container_name: windows
image: dockurr/windows-arm
environment:
VERSION: "win11"
VERSION: "11"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 3389:3389/tcp
- 3389:3389/udp
volumes:
- ./windows:/storage
restart: always
stop_grace_period: 2m
```
Via Docker CLI:
##### Via Docker CLI:
```bash
docker run -it --rm -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 dockurr/windows-arm
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
kubectl apply -f kubernetes.yml
kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/master/kubernetes.yml
```
##### Via Github Codespaces:
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/dockur/windows-arm)
## FAQ 💬
### How do I use it?
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.
@ -77,62 +82,38 @@ kubectl apply -f kubernetes.yml
### How do I select the Windows version?
By default, Windows 11 will be installed. But you can add the `VERSION` environment variable to your compose file, in order to specify an alternative Windows version to be downloaded:
By default, Windows 11 Pro will be installed. But you can add the `VERSION` environment variable to your compose file, in order to specify an alternative Windows version to be downloaded:
```yaml
environment:
VERSION: "win11"
VERSION: "11"
```
Select from the values below:
| **Value** | **Version** | **Platform** | **Size** |
|---|---|---|---|
| `win11` | Windows 11 Pro | ARM64 | 4.9 GB |
| `ltsc11` | Windows 11 LTSC | ARM64 | 4.8 GB |
| `win11e` | Windows 11 Enterprise | ARM64 | 4.8 GB |
|||||
| `win10` | Windows 10 Pro | ARM64 | 3.5 GB |
| `ltsc10` | Windows 10 LTSC | ARM64 | 4.1 GB |
| `win10e` | Windows 10 Enterprise | ARM64 | 3.4 GB |
| **Value** | **Version** | **Size** |
|---|---|---|
| `11` | Windows 11 Pro | 4.8 GB |
| `11l` | Windows 11 LTSC | 4.7 GB |
| `11e` | Windows 11 Enterprise | 4.8 GB |
||||
| `10` | Windows 10 Pro | 3.5 GB |
| `10l` | Windows 10 LTSC | 4.1 GB |
| `10e` | Windows 10 Enterprise | 3.4 GB |
> [!TIP]
> To install x64 versions of Windows, use [dockur/windows](https://github.com/dockur/windows/).
### 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:
```yaml
environment:
LANGUAGE: "French"
```
You can choose between: 🇦🇪 Arabic, 🇧🇬 Bulgarian, 🇨🇳 Chinese, 🇭🇷 Croatian, 🇨🇿 Czech, 🇩🇰 Danish, 🇳🇱 Dutch, 🇬🇧 English, 🇪🇪 Estionian, 🇫🇮 Finnish, 🇫🇷 French, 🇩🇪 German, 🇬🇷 Greek, 🇮🇱 Hebrew, 🇭🇺 Hungarian, 🇮🇹 Italian, 🇯🇵 Japanese, 🇰🇷 Korean, 🇱🇻 Latvian, 🇱🇹 Lithuanian, 🇳🇴 Norwegian, 🇵🇱 Polish, 🇵🇹 Portuguese, 🇷🇴 Romanian, 🇷🇺 Russian, 🇷🇸 Serbian, 🇸🇰 Slovak, 🇸🇮 Slovenian, 🇪🇸 Spanish, 🇸🇪 Swedish, 🇹🇭 Thai, 🇹🇷 Turkish and 🇺🇦 Ukrainian.
### 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:
```yaml
environment:
REGION: "en-US"
KEYBOARD: "en-US"
```
> [!NOTE]
> Changing these values will have no effect after the installation has been performed already. Use the control panel inside Windows in that case.
### How do I change the storage location?
To change the storage location, include the following bind mount in your compose file:
```yaml
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?
@ -146,60 +127,33 @@ kubectl apply -f kubernetes.yml
> [!TIP]
> This can also be used to resize the existing disk to a larger capacity without any data loss.
### How do I increase the display resolution?
The display output is a simple framebuffer, just so that the screen can be visible during installation as it doesn't require any drivers.
To add a virtual graphics cards to your machine that allows for higher resolutions, you can add the following to your compose file after Windows is fully installed:
```yaml
environment:
VGA: "virtio-gpu"
```
### 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 binded 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
volumes:
- /home/user/example:/shared
- ./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]
> 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?
By default, the container will be allowed to use a maximum of 2 CPU cores and 4 GB of RAM.
@ -214,9 +168,9 @@ The example folder `/home/user/example` will be available as ` \\host.lan\Data`.
### 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
environment:
@ -224,11 +178,76 @@ The example folder `/home/user/example` will be available as ` \\host.lan\Data`.
PASSWORD: "gates"
```
### How do I select the Windows 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
environment:
LANGUAGE: "French"
```
You can choose between: 🇦🇪 Arabic, 🇧🇬 Bulgarian, 🇨🇳 Chinese, 🇭🇷 Croatian, 🇨🇿 Czech, 🇩🇰 Danish, 🇳🇱 Dutch, 🇬🇧 English, 🇪🇪 Estonian, 🇫🇮 Finnish, 🇫🇷 French, 🇩🇪 German, 🇬🇷 Greek, 🇮🇱 Hebrew, 🇭🇺 Hungarian, 🇮🇹 Italian, 🇯🇵 Japanese, 🇰🇷 Korean, 🇱🇻 Latvian, 🇱🇹 Lithuanian, 🇳🇴 Norwegian, 🇵🇱 Polish, 🇵🇹 Portuguese, 🇷🇴 Romanian, 🇷🇺 Russian, 🇷🇸 Serbian, 🇸🇰 Slovak, 🇸🇮 Slovenian, 🇪🇸 Spanish, 🇸🇪 Swedish, 🇹🇭 Thai, 🇹🇷 Turkish and 🇺🇦 Ukrainian.
### 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 `KEYBOARD` and `REGION` variables like this (before installation):
```yaml
environment:
REGION: "en-US"
KEYBOARD: "en-US"
```
### 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:/boot.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?
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.
@ -273,7 +292,7 @@ The example folder `/home/user/example` will be available as ` \\host.lan\Data`.
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
environment:
@ -284,9 +303,6 @@ The example folder `/home/user/example` will be available as ` \\host.lan\Data`.
- 'c *:* rwm'
```
> [!NOTE]
> In this mode, the container and Windows will each have their own separate IPs.
### How do I add multiple disks?
To create additional disks, modify your compose file like this:
@ -296,18 +312,18 @@ The example folder `/home/user/example` will be available as ` \\host.lan\Data`.
DISK2_SIZE: "32G"
DISK3_SIZE: "64G"
volumes:
- /home/example:/storage2
- /mnt/data/example:/storage3
- ./example2:/storage2
- ./example3:/storage3
```
### 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
devices:
- /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).
@ -323,29 +339,39 @@ The example folder `/home/user/example` will be available as ` \\host.lan\Data`.
- /dev/bus/usb
```
> [!IMPORTANT]
> 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.
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?
To verify that your system supports KVM, run the following commands:
First check if your software is compatible using this chart:
| **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
sudo apt install cpu-checker
sudo kvm-ok
```
If you receive an error from `kvm-ok` indicating that KVM acceleration can't be used, please check whether:
If you receive an error from `kvm-ok` indicating that KVM cannot be used, please check whether:
- the virtualization extensions (`Intel VT-x` or `AMD SVM`) are enabled in your BIOS.
- you are running an operating system that supports them, like Linux or Windows 11 (macOS and Windows 10 do not unfortunately).
- you enabled "nested virtualization" if you are running the container inside a virtual machine.
- you are not using a cloud provider, as most of them do not allow nested virtualization for their VPS's.
If you didn't receive any error from `kvm-ok` at all, but the container still complains that `/dev/kvm` is missing, it might help to add `privileged: true` to your compose file (or `--privileged` to your `run` command), to rule out any permission issue.
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.
### How do I run a Linux desktop in a container?
You can use [qemus/qemu-arm](https://github.com/qemus/qemu-arm) in that case.
### Is this project legal?
@ -359,12 +385,12 @@ The example folder `/home/user/example` will be available as ` \\host.lan\Data`.
*The product names, logos, brands, and other trademarks referred to within this project are the property of their respective trademark holders. This project is not affiliated, sponsored, or endorsed by Microsoft Corporation.*
[build_url]: https://github.com/dockur/windows-arm/
[hub_url]: https://hub.docker.com/r/dockurr/windows-arm/
[tag_url]: https://hub.docker.com/r/dockurr/windows-arm/tags
[pkg_url]: https://github.com/dockur/windows-arm/pkgs/container/windows-arm
[hub_url]: https://hub.docker.com/r/dockurr/windows/
[tag_url]: https://hub.docker.com/r/dockurr/windows/tags
[pkg_url]: https://github.com/dockur/windows/pkgs/container/windows
[Build]: https://github.com/dockur/windows-arm/actions/workflows/build.yml/badge.svg
[Size]: https://img.shields.io/docker/image-size/dockurr/windows-arm/latest?color=066da5&label=size
[Pulls]: https://img.shields.io/docker/pulls/dockurr/windows-arm.svg?style=flat&label=pulls&logo=docker
[Version]: https://img.shields.io/docker/v/dockurr/windows-arm/latest?arch=amd64&sort=semver&color=066da5
[Package]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fipitio.github.io%2Fbackage%2Fdockur%2Fwindows-arm%2Fwindows-arm.json&query=%24.downloads&logo=github&style=flat&color=066da5&label=pulls
[Pulls]: https://img.shields.io/docker/pulls/dockurr/windows.svg?style=flat&label=pulls&logo=docker
[Version]: https://img.shields.io/docker/v/dockurr/windows/latest?arch=arm64&sort=semver&color=066da5
[Package]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fipitio.github.io%2Fbackage%2Fdockur%2Fwindows%2Fwindows.json&query=%24.downloads&logo=github&style=flat&color=066da5&label=pulls

View file

@ -1,10 +1,12 @@
#!/usr/bin/env bash
set -Eeuo pipefail
: "${XRES:=""}"
: "${YRES:=""}"
: "${KEY:=""}"
: "${WIDTH:=""}"
: "${HEIGHT:=""}"
: "${VERIFY:=""}"
: "${REGION:=""}"
: "${EDITION:=""}"
: "${MANUAL:=""}"
: "${REMOVE:=""}"
: "${VERSION:=""}"
@ -15,7 +17,6 @@ set -Eeuo pipefail
: "${PASSWORD:=""}"
MIRRORS=2
PLATFORM="ARM64"
parseVersion() {
@ -25,27 +26,93 @@ parseVersion() {
[ -z "$VERSION" ] && VERSION="win11"
local msg="is not available for ARM64 CPU's."
case "${VERSION,,}" in
"11" | "11p" | "win11" | "win11p" | "windows11" | "windows 11" )
"11" | "11p" | "win11" | "pro11" | "win11p" | "windows11" | "windows 11" )
VERSION="win11arm64"
;;
"11e" | "win11e" | "windows11e" | "windows 11e" )
VERSION="win11arm64-enterprise-eval"
;;
"ltsc11" | "11ltsc" | "win11-ltsc" | "win11arm64-ltsc" | "win11arm64-enterprise-ltsc-eval" )
"11i" | "11iot" | "iot11" | "win11i" | "win11-iot" | "win11arm64-iot" | "win11arm64-enterprise-iot-eval" )
VERSION="win11arm64-enterprise-ltsc-eval"
[ -z "$DETECTED" ] && DETECTED="win11arm64-ltsc"
;;
"10" | "10p" | "win10" | "win10p" | "windows10" | "windows 10" )
"11l" | "11ltsc" | "ltsc11" | "win11l" | "win11-ltsc" | "win11arm64-ltsc" | "win11arm64-enterprise-ltsc-eval" )
VERSION="win11arm64-enterprise-ltsc-eval"
[ -z "$DETECTED" ] && DETECTED="win11arm64-ltsc"
;;
"10" | "10p" | "win10" | "pro10" | "win10p" | "windows10" | "windows 10" )
VERSION="win10arm64"
;;
"10e" | "win10e" | "windows10e" | "windows 10e" )
VERSION="win10arm64-enterprise-eval"
;;
"ltsc10" | "10ltsc" | "win10-ltsc" | "win10arm64-ltsc" | "win10arm64-enterprise-ltsc-eval" )
"10i" | "10iot" | "iot10" | "win10i" | "win10-iot" | "win10arm64-iot" | "win10arm64-enterprise-iot-eval" )
VERSION="win10arm64-enterprise-ltsc-eval"
[ -z "$DETECTED" ] && DETECTED="win10arm64-ltsc"
;;
"10l" | "10ltsc" | "ltsc10" | "win10l" | "win10-ltsc" | "win10arm64-ltsc" | "win10arm64-enterprise-ltsc-eval" )
VERSION="win10arm64-enterprise-ltsc-eval"
[ -z "$DETECTED" ] && DETECTED="win10arm64-ltsc"
;;
"8" | "8p" | "81" | "81p" | "pro8" | "8.1" | "win8" | "win8p" | "win81" | "win81p" | "windows 8" | \
"8e" | "81e" | "8.1e" | "win8e" | "win81e" | "windows 8e" )
error "Windows 8 $msg" && return 1
;;
"7" | "win7" | "windows7" | "windows 7" | "7u" | "win7u" | "windows7u" | "windows 7u" | "7e" | \
"win7e" | "windows7e" | "windows 7e" | "7x86" | "win7x86" | "win732" | "windows7x86" | "7ux86" | \
"7u32" | "win7x86-ultimate" | "7ex86" | "7e32" | "win7x86-enterprise" )
error "Windows 7 $msg" && return 1
;;
"vista" | "vs" | "6" | "winvista" | "windowsvista" | "windows vista" | "vistu" | "vu" | "6u" | "winvistu" | \
"viste" | "ve" | "6e" | "winviste" | "vistax86" | "vista32" | "6x86" | "winvistax86" | "windowsvistax86" | \
"vux86" | "vu32" | "winvistax86-ultimate" | "vex86" | "ve32" | "winvistax86-enterprise" )
error "Windows Vista $msg" && return 1
;;
"xp" | "xp32" | "xpx86" | "5" | "5x86" | "winxp" | "winxp86" | "windowsxp" | "windows xp" | \
"xp64" | "xpx64" | "5x64" | "winxp64" | "winxpx64" | "windowsxp64" | "windowsxpx64" )
error "Windows XP $msg" && return 1
;;
"2k" | "2000" | "win2k" | "win2000" | "windows2k" | "windows2000" )
error "Windows 2000 $msg" && return 1
;;
"25" | "2025" | "win25" | "win2025" | "windows2025" | "windows 2025" )
error "Windows Server 2025 $msg" && return 1
;;
"22" | "2022" | "win22" | "win2022" | "windows2022" | "windows 2022" )
error "Windows Server 2022 $msg" && return 1
;;
"19" | "2019" | "win19" | "win2019" | "windows2019" | "windows 2019" )
error "Windows Server 2019 $msg" && return 1
;;
"16" | "2016" | "win16" | "win2016" | "windows2016" | "windows 2016" )
error "Windows Server 2016 $msg" && return 1
;;
"hv" | "hyperv" | "hyper v" | "hyper-v" | "19hv" | "2019hv" | "win2019hv" )
error "Hyper-V Server 2019 $msg" && return 1
;;
"2012" | "2012r2" | "win2012" | "win2012r2" | "windows2012" | "windows 2012" )
error "Windows Server 2012 $msg" && return 1
;;
"2008" | "2008r2" | "win2008" | "win2008r2" | "windows2008" | "windows 2008" )
error "Windows Server 2008 $msg" && return 1
;;
"2003" | "2003r2" | "win2003" | "win2003r2" | "windows2003" | "windows 2003" )
error "Windows Server 2003 $msg" && return 1
;;
"tiny11" | "tiny 11" )
VERSION="tiny11"
[ -z "$DETECTED" ] && DETECTED="win11arm64"
;;
"core11" | "core 11" )
VERSION="core11"
[ -z "$DETECTED" ] && DETECTED="win11arm64"
;;
"tiny10" | "tiny 10" )
error "Tiny 10 $msg" && return 1
;;
esac
return 0
@ -57,163 +124,203 @@ getLanguage() {
local ret="$2"
local lang=""
local desc=""
local short=""
local culture=""
case "${id,,}" in
"ar" | "ar-"* )
short="ar"
lang="Arabic"
desc="$lang"
culture="ar-SA" ;;
"bg" | "bg-"* )
short="bg"
lang="Bulgarian"
desc="$lang"
culture="bg-BG" ;;
"cs" | "cs-"* | "cz" | "cz-"* )
short="cs"
lang="Czech"
desc="$lang"
culture="cs-CZ" ;;
"da" | "da-"* | "dk" | "dk-"* )
short="da"
lang="Danish"
desc="$lang"
culture="da-DK" ;;
"de" | "de-"* )
short="de"
lang="German"
desc="$lang"
culture="de-DE" ;;
"el" | "el-"* | "gr" | "gr-"* )
short="el"
lang="Greek"
desc="$lang"
culture="el-GR" ;;
"gb" | "en-gb" )
short="en-gb"
lang="English International"
desc="English"
culture="en-GB" ;;
"en" | "en-"* )
lang="English (United States)"
short="en"
lang="English"
desc="English"
culture="en-US" ;;
"mx" | "es-mx" )
short="mx"
lang="Spanish (Mexico)"
desc="Spanish"
culture="es-MX" ;;
"es" | "es-"* )
short="es"
lang="Spanish"
desc="$lang"
culture="es-ES" ;;
"et" | "et-"* )
short="et"
lang="Estonian"
desc="$lang"
culture="et-EE" ;;
"fi" | "fi-"* )
short="fi"
lang="Finnish"
desc="$lang"
culture="fi-FI" ;;
"ca" | "fr-ca" )
short="ca"
lang="French Canadian"
desc="French"
culture="fr-CA" ;;
"fr" | "fr-"* )
short="fr"
lang="French"
desc="$lang"
culture="fr-FR" ;;
"he" | "he-"* | "il" | "il-"* )
short="he"
lang="Hebrew"
desc="$lang"
culture="he-IL" ;;
"hr" | "hr-"* | "cr" | "cr-"* )
short="hr"
lang="Croatian"
desc="$lang"
culture="hr-HR" ;;
"hu" | "hu-"* )
short="hu"
lang="Hungarian"
desc="$lang"
culture="hu-HU" ;;
"it" | "it-"* )
short="it"
lang="Italian"
desc="$lang"
culture="it-IT" ;;
"ja" | "ja-"* | "jp" | "jp-"* )
short="ja"
lang="Japanese"
desc="$lang"
culture="ja-JP" ;;
"ko" | "ko-"* | "kr" | "kr-"* )
short="ko"
lang="Korean"
desc="$lang"
culture="ko-KR" ;;
"lt" | "lt-"* )
short="lt"
lang="Lithuanian"
desc="$lang"
culture="lv-LV" ;;
culture="lt-LT" ;;
"lv" | "lv-"* )
short="lv"
lang="Latvian"
desc="$lang"
culture="lt-LT" ;;
culture="lv-LV" ;;
"nb" | "nb-"* |"nn" | "nn-"* | "no" | "no-"* )
short="no"
lang="Norwegian"
desc="$lang"
culture="nb-NO" ;;
"nl" | "nl-"* )
short="nl"
lang="Dutch"
desc="$lang"
culture="nl-NL" ;;
"pl" | "pl-"* )
short="pl"
lang="Polish"
desc="$lang"
culture="pl-PL" ;;
"br" | "pt-br" )
short="pt"
lang="Brazilian Portuguese"
desc="Portuguese"
culture="pt-BR" ;;
"pt" | "pt-"* )
short="pp"
lang="Portuguese"
desc="$lang"
culture="pt-BR" ;;
"ro" | "ro-"* )
short="ro"
lang="Romanian"
desc="$lang"
culture="ro-RO" ;;
"ru" | "ru-"* )
short="ru"
lang="Russian"
desc="$lang"
culture="ru-RU" ;;
"sk" | "sk-"* )
short="sk"
lang="Slovak"
desc="$lang"
culture="sk-SK" ;;
"sl" | "sl-"* | "si" | "si-"* )
short="sl"
lang="Slovenian"
desc="$lang"
culture="sl-SI" ;;
"sr" | "sr-"* )
short="sr"
lang="Serbian Latin"
desc="Serbian"
culture="sr-Latn-RS" ;;
"sv" | "sv-"* | "se" | "se-"* )
short="sv"
lang="Swedish"
desc="$lang"
culture="sv-SE" ;;
"th" | "th-"* )
short="th"
lang="Thai"
desc="$lang"
culture="th-TH" ;;
"tr" | "tr-"* )
short="tr"
lang="Turkish"
desc="$lang"
culture="tr-TR" ;;
"ua" | "ua-"* | "uk" | "uk-"* )
short="uk"
lang="Ukrainian"
desc="$lang"
culture="uk-UA" ;;
"hk" | "zh-hk" | "cn-hk" )
lang="Chinese Traditional"
short="hk"
lang="Chinese (Traditional)"
desc="Chinese HK"
culture="zh-TW" ;;
"tw" | "zh-tw" | "cn-tw" )
lang="Chinese Traditional"
short="tw"
lang="Chinese (Traditional)"
desc="Chinese TW"
culture="zh-TW" ;;
"zh" | "zh-"* | "cn" | "cn-"* )
lang="Chinese Simplified"
short="cn"
lang="Chinese (Simplified)"
desc="Chinese"
culture="zh-CN" ;;
esac
@ -221,6 +328,7 @@ getLanguage() {
case "${ret,,}" in
"desc" ) echo "$desc" ;;
"name" ) echo "$lang" ;;
"code" ) echo "$short" ;;
"culture" ) echo "$culture" ;;
*) echo "$desc";;
esac
@ -287,6 +395,8 @@ printVersion() {
local desc="$2"
case "${id,,}" in
"tiny11"* ) desc="Tiny 11" ;;
"core11"* ) desc="Core 11" ;;
"win10"* ) desc="Windows 10" ;;
"win11"* ) desc="Windows 11" ;;
esac
@ -341,7 +451,10 @@ fromFile() {
local file="${1,,}"
local arch="${PLATFORM,,}"
case "${file// /_}" in
file="${file//-/_}"
file="${file// /_}"
case "$file" in
*"_x64_"* | *"_x64."*)
arch="x64"
;;
@ -353,7 +466,13 @@ fromFile() {
;;
esac
case "${file// /_}" in
case "$file" in
"tiny11core"* | "tiny11_core"* | "tiny_11_core"* )
id="core11"
;;
"tiny11"* | "tiny_11"* )
id="tiny11"
;;
"win10"*| "win_10"* | *"windows10"* | *"windows_10"* )
id="win10${arch}"
;;
@ -378,7 +497,9 @@ fromName() {
case "${name,,}" in
*"windows 10"* ) id="win10${arch}" ;;
*"optimum 10"* ) id="win10${arch}" ;;
*"windows 11"* ) id="win11${arch}" ;;
*"optimum 11"* ) id="win11${arch}" ;;
esac
echo "$id"
@ -429,22 +550,27 @@ getMido() {
local id="$1"
local lang="$2"
local ret="$3"
local url=""
local sum=""
local size=""
[[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0
case "${id,,}" in
"win11arm64" )
size=5460387840
sum="57d1dfb2c6690a99fe99226540333c6c97d3fd2b557a50dfe3d68c3f675ef2b0"
;;
"win11arm64-enterprise-ltsc-eval" )
size=4252764160
sum="ccec358a760c3c581249f091ed42d04f37b2b99c347b7a58257c3cc272d7982c"
size=5042194432
sum="3dcdba9c9c0aa0430d4332b60c9afcb3cd613d648a49cbba2d4ef7b5978f32e8"
;;
esac
case "${ret,,}" in
"sum" ) echo "$sum" ;;
"size" ) echo "$size" ;;
*) echo "";;
*) echo "$url";;
esac
return 0
@ -460,112 +586,30 @@ getLink1() {
local url=""
local sum=""
local size=""
local host="https://drive.massgrave.dev"
local host="https://dl.bobpony.com/windows"
culture=$(getLanguage "$lang" "culture")
[[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0
case "${id,,}" in
"win11arm64" | "win11arm64-enterprise" | "win11arm64-enterprise-eval" )
case "${culture,,}" in
"ar" | "ar-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Arabic_Pro_Ent_EDU_N_MLF_X23-68013.ISO" ;;
"bg" | "bg-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Bulgarian_Pro_Ent_EDU_N_MLF_X23-68015.ISO" ;;
"cs" | "cs-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Czech_Pro_Ent_EDU_N_MLF_X23-68019.ISO" ;;
"da" | "da-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Danish_Pro_Ent_EDU_N_MLF_X23-68020.ISO" ;;
"de" | "de-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_German_Pro_Ent_EDU_N_MLF_X23-68028.ISO" ;;
"el" | "el-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Greek_Pro_Ent_EDU_N_MLF_X23-68029.ISO" ;;
"gb" | "en-gb" ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Eng_Intl_Pro_Ent_EDU_N_MLF_X23-68022.ISO" ;;
"en" | "en-"* )
size=7010680832
sum="3da19e8c8c418091081186e362fb53a1aa68dad255d1d28ace81e2c88c3f99ba"
url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_English_Pro_Ent_EDU_N_MLF_X23-68023.ISO" ;;
"mx" | "es-mx" ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Spanish_Latam_Pro_Ent_EDU_N_MLF_X23-68045.ISO" ;;
"es" | "es-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Spanish_Pro_Ent_EDU_N_MLF_X23-68046.ISO" ;;
"et" | "et-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Estonian_Pro_Ent_EDU_N_MLF_X23-68024.ISO" ;;
"fi" | "fi-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Finnish_Pro_Ent_EDU_N_MLF_X23-68025.ISO" ;;
"ca" | "fr-ca" ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_FrenchCanadian_Pro_Ent_EDU_N_MLF_X23-68027.ISO" ;;
"fr" | "fr-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_French_Pro_Ent_EDU_N_MLF_X23-68026.ISO" ;;
"he" | "he-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Hebrew_Pro_Ent_EDU_N_MLF_X23-68030.ISO" ;;
"hr" | "hr-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Croatian_Pro_Ent_EDU_N_MLF_X23-68018.ISO" ;;
"hu" | "hu-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Hungarian_Pro_Ent_EDU_N_MLF_X23-68031.ISO" ;;
"it" | "it-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Italian_Pro_Ent_EDU_N_MLF_X23-68032.ISO" ;;
"ja" | "ja-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Japanese_Pro_Ent_EDU_N_MLF_X23-68033.ISO" ;;
"ko" | "ko-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Korean_Pro_Ent_EDU_N_MLF_X23-68034.ISO" ;;
"lt" | "lt-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Lithuanian_Pro_Ent_EDU_N_MLF_X23-68036.ISO" ;;
"lv" | "lv-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Latvian_Pro_Ent_EDU_N_MLF_X23-68035.ISO" ;;
"nb" | "nb-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Norwegian_Pro_Ent_EDU_N_MLF_X23-68037.ISO" ;;
"nl" | "nl-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Dutch_Pro_Ent_EDU_N_MLF_X23-68021.ISO" ;;
"pl" | "pl-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Polish_Pro_Ent_EDU_N_MLF_X23-68038.ISO" ;;
"br" | "pt-br" ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Brazilian_Pro_Ent_EDU_N_MLF_X23-68014.ISO" ;;
"pt" | "pt-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Portuguese_Pro_Ent_EDU_N_MLF_X23-68039.ISO" ;;
"ro" | "ro-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Romanian_Pro_Ent_EDU_N_MLF_X23-68040.ISO" ;;
"ru" | "ru-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Russian_Pro_Ent_EDU_N_MLF_X23-68041.ISO" ;;
"sk" | "sk-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Slovak_Pro_Ent_EDU_N_MLF_X23-68043.ISO" ;;
"sl" | "sl-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Slovenian_Pro_Ent_EDU_N_MLF_X23-68044.ISO" ;;
"sr" | "sr-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Serbian_Latin_Pro_Ent_EDU_N_MLF_X23-68042.ISO" ;;
"sv" | "sv-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Swedish_Pro_Ent_EDU_N_MLF_X23-68047.ISO" ;;
"th" | "th-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Thai_Pro_Ent_EDU_N_MLF_X23-68048.ISO" ;;
"tr" | "tr-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Turkish_Pro_Ent_EDU_N_MLF_X23-68049.ISO" ;;
"uk" | "uk-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_Ukrainian_Pro_Ent_EDU_N_MLF_X23-68050.ISO" ;;
"zh-hk" | "zh-tw" ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_ChnTrad_Pro_Ent_EDU_N_MLF_X23-68017.ISO" ;;
"zh" | "zh-"* ) url="SW_DVD9_Win_Pro_11_23H2.2_Arm64_ChnSimp_Pro_Ent_EDU_N_MLF_X23-68016.ISO" ;;
esac
size=5219411968
sum="dbd54452c3c20b4625f511dae3c3e057270448fb661232d4fa66279f59a63157"
url="11/en-us_windows_11_24h2_arm64.iso"
;;
"win11arm64-ltsc" | "win11arm64-enterprise-ltsc-eval" )
[[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0
size=5121449984
sum="f8f068cdc90c894a55d8c8530db7c193234ba57bb11d33b71383839ac41246b4"
url="X23-81950_26100.1742.240906-0331.ge_release_svc_refresh_CLIENT_ENTERPRISES_OEM_A64FRE_en-us.iso"
url="11/X23-81950_26100.1742.240906-0331.ge_release_svc_refresh_CLIENT_ENTERPRISES_OEM_A64FRE_en-us.iso"
;;
"win10arm64" | "win10arm64-enterprise" | "win10arm64-enterprise-eval" )
case "${culture,,}" in
"ar" | "ar-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Arabic_Pro_Ent_EDU_N_MLF_X23-67213.ISO" ;;
"bg" | "bg-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Bulgarian_Pro_Ent_EDU_N_MLF_X23-67215.ISO" ;;
"cs" | "cs-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Czech_Pro_Ent_EDU_N_MLF_X23-67219.ISO" ;;
"da" | "da-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Danish_Pro_Ent_EDU_N_MLF_X23-67220.ISO" ;;
"de" | "de-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_German_Pro_Ent_EDU_N_MLF_X23-67228.ISO" ;;
"el" | "el-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Greek_Pro_Ent_EDU_N_MLF_X23-67229.ISO" ;;
"gb" | "en-gb" ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Eng_Intl_Pro_Ent_EDU_N_MLF_X23-67222.ISO" ;;
"en" | "en-"* )
size=5190453248
sum="bd96b342193f81c0a2e6595d8d8b8dc01dbf789d19211699f6299fec7b712197"
url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_English_Pro_Ent_EDU_N_MLF_X23-67223.ISO" ;;
"mx" | "es-mx" ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Spanish_Latam_Pro_Ent_EDU_N_MLF_X23-67245.ISO" ;;
"es" | "es-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Spanish_Pro_Ent_EDU_N_MLF_X23-67246.ISO" ;;
"et" | "et-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Estonian_Pro_Ent_EDU_N_MLF_X23-67224.ISO" ;;
"fi" | "fi-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Finnish_Pro_Ent_EDU_N_MLF_X23-67225.ISO" ;;
"ca" | "fr-ca" ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_FrenchCanadian_Pro_Ent_EDU_N_MLF_X23-67227.ISO" ;;
"fr" | "fr-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_French_Pro_Ent_EDU_N_MLF_X23-67226.ISO" ;;
"he" | "he-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Hebrew_Pro_Ent_EDU_N_MLF_X23-67230.ISO" ;;
"hr" | "hr-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Croatian_Pro_Ent_EDU_N_MLF_X23-67218.ISO" ;;
"hu" | "hu-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Hungarian_Pro_Ent_EDU_N_MLF_X23-67231.ISO" ;;
"it" | "it-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Italian_Pro_Ent_EDU_N_MLF_X23-67232.ISO" ;;
"ja" | "ja-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Japanese_Pro_Ent_EDU_N_MLF_X23-67233.ISO" ;;
"ko" | "ko-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Korean_Pro_Ent_EDU_N_MLF_X23-67234.ISO" ;;
"lt" | "lt-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Lithuanian_Pro_Ent_EDU_N_MLF_X23-67236.ISO" ;;
"lv" | "lv-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Latvian_Pro_Ent_EDU_N_MLF_X23-67235.ISO" ;;
"nb" | "nb-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Norwegian_Pro_Ent_EDU_N_MLF_X23-67237.ISO" ;;
"nl" | "nl-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Dutch_Pro_Ent_EDU_N_MLF_X23-67221.ISO" ;;
"pl" | "pl-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Polish_Pro_Ent_EDU_N_MLF_X23-67238.ISO" ;;
"br" | "pt-br" ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Brazilian_Pro_Ent_EDU_N_MLF_X23-67214.ISO" ;;
"pt" | "pt-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Portuguese_Pro_Ent_EDU_N_MLF_X23-67239.ISO" ;;
"ro" | "ro-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Romanian_Pro_Ent_EDU_N_MLF_X23-67240.ISO" ;;
"ru" | "ru-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Russian_Pro_Ent_EDU_N_MLF_X23-67241.ISO" ;;
"sk" | "sk-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Slovak_Pro_Ent_EDU_N_MLF_X23-67243.ISO" ;;
"sl" | "sl-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Slovenian_Pro_Ent_EDU_N_MLF_X23-67244.ISO" ;;
"sr" | "sr-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Serbian_Latin_Pro_Ent_EDU_N_MLF_X23-67242.ISO" ;;
"sv" | "sv-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Swedish_Pro_Ent_EDU_N_MLF_X23-67247.ISO" ;;
"th" | "th-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Thai_Pro_Ent_EDU_N_MLF_X23-67248.ISO" ;;
"tr" | "tr-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Turkish_Pro_Ent_EDU_N_MLF_X23-67249.ISO" ;;
"uk" | "uk-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_Ukrainian_Pro_Ent_EDU_N_MLF_X23-67250.ISO" ;;
"zh-hk" | "zh-tw" ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_ChnTrad_Pro_Ent_EDU_N_MLF_X23-67217.ISO" ;;
"zh" | "zh-"* ) url="SW_DVD9_Win_Pro_10_22H2.15_Arm64_ChnSimp_Pro_Ent_EDU_N_MLF_X23-67216.ISO" ;;
esac
size=4689637376
sum="7b43e64f4e3b961a83f9b70efa4b9d863bc5c348fe86d75917ac974116d17227"
url="10/en-us_windows_10_22h2_arm64.iso"
;;
"win10arm64-ltsc" | "win10arm64-enterprise-ltsc-eval" )
[[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0
size=4430471168
sum="d265df49b30a1477d010c79185a7bc88591a1be4b3eb690c994bed828ea17c00"
url="en-us_windows_10_iot_enterprise_ltsc_2021_arm64_dvd_e8d4fc46.iso"
url="10/en-us_windows_10_iot_enterprise_ltsc_2021_arm64_dvd_e8d4fc46.iso"
;;
esac
@ -580,39 +624,51 @@ getLink1() {
getLink2() {
# Fallbacks for users who cannot connect to the Microsoft servers
local id="$1"
local lang="$2"
local ret="$3"
local url=""
local sum=""
local size=""
local host="https://dl.bobpony.com/windows"
local host="https://archive.org/download"
[[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0
case "${id,,}" in
"win11arm64" | "win11arm64-enterprise" | "win11arm64-enterprise-eval" )
size=6326812672
sum="464c75909b9c37864e144886445a2faa67ac86f0845a68cca3f017b97f810e8d"
url="11/en-us_windows_11_23h2_arm64.iso"
"tiny11" )
size=4480499712
sum="ec6056aa554c17290224af23e1b99961fe99606bb5ea9102d61838939c63325b"
url="tiny11a64/tiny11a64%20r1.iso"
;;
"core11" )
size=3300327424
sum="812dae6b5bf5215db63b61ae10d8f0ffd3aa8529a18d96e9ced53341e2c676ec"
url="tiny11-core-arm64/tiny11%20core%20arm64.iso"
;;
"win11arm64" )
size=5460387840
sum="57d1dfb2c6690a99fe99226540333c6c97d3fd2b557a50dfe3d68c3f675ef2b0"
url="windows-11-24h2-arm64-iso/Win11_24H2_English_Arm64.iso"
;;
"win11arm64-enterprise" | "win11arm64-enterprise-eval" )
size=6872444928
sum="2bf0fd1d5abd267cd0ae8066fea200b3538e60c3e572428c0ec86d4716b61cb7"
url="win11-23h2-en-fr/ARM64/SW_DVD9_Win_Pro_11_23H2_Arm64_English_Pro_Ent_EDU_N_MLF_X23-59519.ISO"
;;
"win11arm64-ltsc" | "win11arm64-enterprise-ltsc-eval" )
[[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0
size=5121449984
sum="f8f068cdc90c894a55d8c8530db7c193234ba57bb11d33b71383839ac41246b4"
url="11/X23-81950_26100.1742.240906-0331.ge_release_svc_refresh_CLIENT_ENTERPRISES_OEM_A64FRE_en-us.iso"
url="Windows11LTSC/X23-81950_26100.1742.240906-0331.ge_release_svc_refresh_CLIENT_ENTERPRISES_OEM_A64FRE_en-us.iso"
;;
"win10arm64" | "win10arm64-enterprise" | "win10arm64-enterprise-eval" )
size=4846794752
sum="6d2688f95fa1d359d68ed0c38c3f38de7b3713c893410e15be9d1e706a4a58c7"
url="10/en-us_windows_10_22h2_arm64.iso"
size=5192060928
sum="101079b911c8c3dd9c9a88499a16b930fbf00cbaf901761d8265bb3a8fcd9ea9"
url="win-pro-10-22-h-2.15-arm-64-eng-intl-pro-ent-edu-n-mlf-x-23-67222/Win_Pro_10_22H2.15_Arm64_Eng_Intl_Pro_Ent_EDU_N_MLF_X23-67222.ISO"
;;
"win10arm64-ltsc" | "win10arm64-enterprise-ltsc-eval" )
size=4430471168
sum="d265df49b30a1477d010c79185a7bc88591a1be4b3eb690c994bed828ea17c00"
url="10/en-us_windows_10_iot_enterprise_ltsc_2021_arm64_dvd_e8d4fc46.iso"
url="windows-10-enterprise-ltsc-full-collection/en-us_windows_10_iot_enterprise_ltsc_2021_arm64_dvd_e8d4fc46.iso"
;;
esac
@ -719,7 +775,27 @@ validVersion() {
return 1
}
migrateFiles() {
addFolder() {
local src="$1"
local folder="/oem"
[ ! -d "$folder" ] && folder="/OEM"
[ ! -d "$folder" ] && folder="$STORAGE/oem"
[ ! -d "$folder" ] && folder="$STORAGE/OEM"
[ ! -d "$folder" ] && return 0
local msg="Adding OEM folder to image..."
info "$msg" && html "$msg"
local dest="$src/\$OEM\$/\$1/OEM"
mkdir -p "$dest" || return 1
cp -Lr "$folder/." "$dest" || return 1
local file
file=$(find "$dest" -maxdepth 1 -type f -iname install.bat -print -quit)
[ -f "$file" ] && unix2dos -q "$file"
return 0
}

View file

@ -1,16 +1,18 @@
#!/usr/bin/env bash
set -Eeuo pipefail
: "${APP:="Windows"}"
: "${MACHINE:="virt"}"
: "${PLATFORM:="arm64"}"
: "${BOOT_MODE:="windows"}"
APP="Windows"
SUPPORT="https://github.com/dockur/windows-arm"
: "${SUPPORT:="https://github.com/dockur/windows-arm"}"
cd /run
. utils.sh # Load functions
. reset.sh # Initialize system
. define.sh # Define versions
. mido.sh # Download code
. mido.sh # Download Windows
. install.sh # Run installation
. disk.sh # Initialize disks
. display.sh # Initialize graphics
@ -37,8 +39,10 @@ fi
terminal
( sleep 30; boot ) &
tail -fn +0 "$QEMU_LOG" 2>/dev/null &
cat "$QEMU_TERM" 2> /dev/null | tee "$QEMU_PTY" &
wait $! || :
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' & wait $! || :
sleep 1 & wait $!
[ ! -f "$QEMU_END" ] && finish 0

View file

@ -10,21 +10,31 @@ EFISYS="efi/microsoft/boot/efisys_noprompt.bin"
skipInstall() {
local iso="$1"
local method=""
local magic byte
local boot="$STORAGE/windows.boot"
local previous="$STORAGE/windows.base"
if [ -f "$previous" ]; then
previous=$(<"$previous")
previous="${previous//[![:print:]]/}"
if [ -n "$previous" ]; then
previous="$STORAGE/$previous"
if [[ "${previous,,}" != "${iso,,}" ]]; then
if [[ "${STORAGE,,}/${previous,,}" != "${iso,,}" ]]; 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
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
fi
[ -f "$previous" ] && rm -f "$previous"
rm -f "$STORAGE/$previous"
return 1
fi
fi
@ -76,8 +86,6 @@ startInstall() {
BOOT="$STORAGE/$file"
! migrateFiles "$BOOT" "$VERSION" && error "Migration failed!" && exit 57
fi
skipInstall "$BOOT" && return 1
@ -120,6 +128,9 @@ finishInstall() {
rm -f "$STORAGE/windows.old"
rm -f "$STORAGE/windows.vga"
rm -f "$STORAGE/windows.net"
rm -f "$STORAGE/windows.usb"
rm -f "$STORAGE/windows.args"
rm -f "$STORAGE/windows.base"
rm -f "$STORAGE/windows.boot"
rm -f "$STORAGE/windows.mode"
@ -156,10 +167,27 @@ finishInstall() {
fi
fi
if [ -n "${ARGS:-}" ]; then
ARGUMENTS="$ARGS ${ARGUMENTS:-}"
echo "$ARGS" > "$STORAGE/windows.args"
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
echo "$DISK_TYPE" > "$STORAGE/windows.type"
fi
if [ -n "${ADAPTER:-}" ] && [[ "${ADAPTER:-}" != "virtio-net-pci" ]]; then
echo "$ADAPTER" > "$STORAGE/windows.net"
fi
rm -rf "$TMP"
return 0
}
@ -171,8 +199,9 @@ abortInstall() {
local efi
[[ "${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 -print -quit)
if [ -z "$efi" ]; then
[[ "${PLATFORM,,}" == "x64" ]] && BOOT_MODE="windows_legacy"
@ -193,13 +222,23 @@ abortInstall() {
return 1
}
detectCustom() {
findFile() {
local file base
CUSTOM=""
local dir file base
local fname="$1"
local boot="$STORAGE/windows.boot"
file=$(find / -maxdepth 1 -type f -iname custom.iso | head -n 1)
[ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.iso | head -n 1)
dir=$(find / -maxdepth 1 -type d -iname "$fname" -print -quit)
[ ! -d "$dir" ] && dir=$(find "$STORAGE" -maxdepth 1 -type d -iname "$fname" -print -quit)
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" -print -quit)
[ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "$fname" -print -quit)
if [ ! -s "$file" ] && [[ "${VERSION,,}" != "http"* ]]; then
base=$(basename "$VERSION")
@ -215,12 +254,25 @@ detectCustom() {
[ -z "$size" ] || [[ "$size" == "0" ]] && return 0
ISO="$file"
CUSTOM="$ISO"
CUSTOM="$file"
BOOT="$STORAGE/windows.$size.iso"
return 0
}
detectCustom() {
CUSTOM=""
! findFile "custom.iso" && return 1
[ -n "$CUSTOM" ] && return 0
! findFile "boot.iso" && return 1
[ -n "$CUSTOM" ] && return 0
return 0
}
extractESD() {
local iso="$1"
@ -240,12 +292,12 @@ extractESD() {
mkdir -p "$dir"
size=16106127360
size_gb=$(( (size + 1073741823)/1073741824 ))
size_gb=$(formatBytes "$size")
space=$(df --output=avail -B 1 "$dir" | tail -n 1)
space_gb=$(( (space + 1073741823)/1073741824 ))
space_gb=$(formatBytes "$space")
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
local esdImageCount
@ -310,7 +362,7 @@ extractImage() {
local dir="$2"
local version="$3"
local desc="local ISO"
local size size_gb space space_gb
local file size size_gb space space_gb
if [ -z "$CUSTOM" ]; then
desc="downloaded ISO"
@ -331,16 +383,16 @@ extractImage() {
mkdir -p "$dir"
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_gb=$(( (space + 1073741823)/1073741824 ))
space_gb=$(formatBytes "$space")
if ((size<100000000)); then
error "Invalid ISO file: Size is smaller than 100 MB" && return 1
fi
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
rm -rf "$dir"
@ -349,8 +401,27 @@ extractImage() {
error "Failed to extract ISO file: $iso" && return 1
fi
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" -print -quit)
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
}
@ -483,6 +554,10 @@ setXML() {
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="/run/assets/custom.xml"
[ ! -f "$file" ] || [ ! -s "$file" ] && file="$1"
@ -527,21 +602,21 @@ detectImage() {
fi
local src wim info
src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1)
src=$(find "$dir" -maxdepth 1 -type d -iname sources -print -quit)
if [ ! -d "$src" ]; then
warn "failed to locate 'sources' folder in ISO image, $FB" && return 1
fi
wim=$(find "$src" -maxdepth 1 -type f -iname install.wim | head -n 1)
[ ! -f "$wim" ] && wim=$(find "$src" -maxdepth 1 -type f -iname install.esd | head -n 1)
wim=$(find "$src" -maxdepth 1 -type f -iname install.wim -print -quit)
[ ! -f "$wim" ] && wim=$(find "$src" -maxdepth 1 -type f -iname install.esd -print -quit)
if [ ! -f "$wim" ]; then
warn "failed to locate 'install.wim' or 'install.esd' in ISO image, $FB" && return 1
fi
info=$(wimlib-imagex info -xml "$wim" | tr -d '\000')
! checkPlatform "$info" && exit 67
checkPlatform "$info" || exit 67
DETECTED=$(detectVersion "$info")
@ -561,12 +636,16 @@ detectImage() {
if [[ "${LANGUAGE,,}" != "en" ]] && [[ "${LANGUAGE,,}" != "en-"* ]]; then
language=$(getLanguage "$LANGUAGE" "desc")
desc=+" ($language)"
desc+=" ($language)"
fi
info "Detected: $desc"
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)"
local fallback="/run/assets/${DETECTED%%-*}.xml"
@ -588,7 +667,7 @@ prepareImage() {
desc=$(printVersion "$DETECTED" "$DETECTED")
! setMachine "$DETECTED" "$iso" "$dir" "$desc" && return 1
setMachine "$DETECTED" "$iso" "$dir" "$desc" || return 1
skipVersion "$DETECTED" && return 0
if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then
@ -614,11 +693,15 @@ updateXML() {
local language="$2"
local culture region user admin pass keyboard
[ -z "$YRES" ] && YRES="720"
[ -z "$XRES" ] && XRES="1280"
if [ -n "${VM_NET_IP:-}" ]; then
sed -i "s/ 20.20.20.1 / ${VM_NET_IP%.*}.1 /g" "$asset"
fi
sed -i "s/<VerticalResolution>1080<\/VerticalResolution>/<VerticalResolution>$YRES<\/VerticalResolution>/g" "$asset"
sed -i "s/<HorizontalResolution>1920<\/HorizontalResolution>/<HorizontalResolution>$XRES<\/HorizontalResolution>/g" "$asset"
[ -z "$HEIGHT" ] && HEIGHT="720"
[ -z "$WIDTH" ] && WIDTH="1280"
sed -i "s/<VerticalResolution>1080<\/VerticalResolution>/<VerticalResolution>$HEIGHT<\/VerticalResolution>/g" "$asset"
sed -i "s/<HorizontalResolution>1920<\/HorizontalResolution>/<HorizontalResolution>$WIDTH<\/HorizontalResolution>/g" "$asset"
culture=$(getLanguage "$language" "culture")
@ -651,15 +734,26 @@ updateXML() {
sed -i "s/<Username>Docker<\/Username>/<Username>$user<\/Username>/g" "$asset"
fi
if [ -n "$PASSWORD" ]; then
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)
[ -n "$PASSWORD" ] && pass="$PASSWORD" || pass="admin"
pw=$(printf '%s' "${pass}Password" | iconv -f utf-8 -t utf-16le | base64 -w 0)
admin=$(printf '%s' "${pass}AdministratorPassword" | iconv -f utf-8 -t utf-16le | base64 -w 0)
sed -i "s/<Value>password<\/Value>/<Value>$admin<\/Value>/g" "$asset"
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 -z "s/<Password>...............<Value \/>/<Password>\n <Value>$pass<\/Value>/g" -i "$asset"
sed -z "s/<Password>...........<Value \/>/<Password>\n <Value>$pw<\/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
return 0
@ -671,8 +765,13 @@ addDriver() {
local path="$2"
local target="$3"
local driver="$4"
local desc=""
local folder=""
if [ -z "$id" ]; then
warn "no Windows version specified for \"$driver\" driver!" && return 0
fi
case "${id,,}" in
"win7x86"* ) folder="w7/x86" ;;
"win7x64"* ) folder="w7/amd64" ;;
@ -692,7 +791,12 @@ addDriver() {
esac
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
[ ! -d "$path/$driver/$folder" ] && return 0
@ -704,48 +808,68 @@ addDriver() {
esac
local dest="$path/$target/$driver"
mv "$path/$driver/$folder" "$dest"
mkdir -p "$dest" || return 1
cp -Lr "$path/$driver/$folder/." "$dest" || return 1
return 0
}
addDrivers() {
local file="$1"
local index="$2"
local version="$3"
local src="$1"
local tmp="$2"
local file="$3"
local index="$4"
local version="$5"
local drivers="$tmp/drivers"
rm -rf "$drivers"
mkdir -p "$drivers"
local msg="Adding drivers to image..."
info "$msg" && html "$msg"
local drivers="$TMP/drivers"
mkdir -p "$drivers"
if [ -z "$version" ]; then
version="win11x64"
warn "Windows version unknown, falling back to Windows 11 drivers..."
fi
if ! tar -xf /drivers.txz -C "$drivers" --warning=no-timestamp; then
error "Failed to extract driver!" && return 1
if ! bsdtar -xf /var/drivers.txz -C "$drivers"; then
error "Failed to extract drivers from archive!" && return 1
fi
local target="\$WinPEDriver\$"
local dest="$drivers/$target"
mkdir -p "$dest"
mkdir -p "$dest" || return 1
wimlib-imagex update "$file" "$index" --command "delete --force --recursive /$target" >/dev/null || true
addDriver "$version" "$drivers" "$target" "qxl"
addDriver "$version" "$drivers" "$target" "viofs"
addDriver "$version" "$drivers" "$target" "sriov"
addDriver "$version" "$drivers" "$target" "smbus"
addDriver "$version" "$drivers" "$target" "qxldod"
addDriver "$version" "$drivers" "$target" "viorng"
addDriver "$version" "$drivers" "$target" "viostor"
addDriver "$version" "$drivers" "$target" "NetKVM"
addDriver "$version" "$drivers" "$target" "Balloon"
addDriver "$version" "$drivers" "$target" "vioscsi"
addDriver "$version" "$drivers" "$target" "pvpanic"
addDriver "$version" "$drivers" "$target" "vioinput"
addDriver "$version" "$drivers" "$target" "viogpudo"
addDriver "$version" "$drivers" "$target" "vioserial"
addDriver "$version" "$drivers" "$target" "qemupciserial"
addDriver "$version" "$drivers" "$target" "qxl" || return 1
addDriver "$version" "$drivers" "$target" "viofs" || return 1
addDriver "$version" "$drivers" "$target" "sriov" || return 1
addDriver "$version" "$drivers" "$target" "smbus" || return 1
addDriver "$version" "$drivers" "$target" "qxldod" || return 1
addDriver "$version" "$drivers" "$target" "viorng" || return 1
addDriver "$version" "$drivers" "$target" "viostor" || return 1
addDriver "$version" "$drivers" "$target" "viomem" || return 1
addDriver "$version" "$drivers" "$target" "NetKVM" || return 1
addDriver "$version" "$drivers" "$target" "Balloon" || return 1
addDriver "$version" "$drivers" "$target" "vioscsi" || return 1
addDriver "$version" "$drivers" "$target" "pvpanic" || return 1
addDriver "$version" "$drivers" "$target" "vioinput" || return 1
addDriver "$version" "$drivers" "$target" "viogpudo" || return 1
addDriver "$version" "$drivers" "$target" "vioserial" || return 1
addDriver "$version" "$drivers" "$target" "qemupciserial" || return 1
case "${version,,}" in
"win11x64"* | "win2025"* )
# Workaround Virtio GPU driver bug
local dst="$src/\$OEM\$/\$\$/Drivers"
mkdir -p "$dst" || return 1
cp -Lr "$dest/." "$dst" || return 1
rm -rf "$dest/viogpudo"
;;
esac
if ! wimlib-imagex update "$file" "$index" --command "add $dest /$target" >/dev/null; then
return 1
@ -755,36 +879,12 @@ addDrivers() {
return 0
}
addFolder() {
local src="$1"
local folder="/oem"
[ ! -d "$folder" ] && folder="/OEM"
[ ! -d "$folder" ] && folder="$STORAGE/oem"
[ ! -d "$folder" ] && folder="$STORAGE/OEM"
[ ! -d "$folder" ] && return 0
local msg="Adding OEM folder to image..."
info "$msg" && html "$msg"
local dest="$src/\$OEM\$/\$1/"
mkdir -p "$dest"
! cp -r "$folder" "$dest" && return 1
local file
file=$(find "$dest" -maxdepth 1 -type f -iname install.bat | head -n 1)
[ -f "$file" ] && unix2dos -q "$file"
return 0
}
updateImage() {
local dir="$1"
local asset="$2"
local language="$3"
local tmp="/tmp/install"
local file="autounattend.xml"
local org="${file//.xml/.org}"
local dat="${file//.xml/.dat}"
@ -800,14 +900,17 @@ updateImage() {
fi
fi
src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1)
rm -rf "$tmp"
mkdir -p "$tmp"
src=$(find "$dir" -maxdepth 1 -type d -iname sources -print -quit)
if [ ! -d "$src" ]; then
error "failed to locate 'sources' folder in ISO image, $FB" && return 1
fi
wim=$(find "$src" -maxdepth 1 -type f -iname boot.wim | head -n 1)
[ ! -f "$wim" ] && wim=$(find "$src" -maxdepth 1 -type f -iname boot.esd | head -n 1)
wim=$(find "$src" -maxdepth 1 -type f -iname boot.wim -print -quit)
[ ! -f "$wim" ] && wim=$(find "$src" -maxdepth 1 -type f -iname boot.esd -print -quit)
if [ ! -f "$wim" ]; then
error "failed to locate 'boot.wim' or 'boot.esd' in ISO image, $FB" && return 1
@ -820,25 +923,22 @@ updateImage() {
index="2"
fi
if ! addDrivers "$wim" "$index" "$DETECTED"; then
error "Failed to add drivers to image!" && return 1
if ! addDrivers "$src" "$tmp" "$wim" "$index" "$DETECTED"; then
error "Failed to add drivers to image!"
fi
if ! addFolder "$src"; then
error "Failed to add OEM folder to image!" && return 1
error "Failed to add OEM folder to image!"
fi
if wimlib-imagex extract "$wim" "$index" "/$file" "--dest-dir=$TMP" >/dev/null 2>&1; then
if ! wimlib-imagex extract "$wim" "$index" "/$dat" "--dest-dir=$TMP" >/dev/null 2>&1; then
if ! wimlib-imagex extract "$wim" "$index" "/$org" "--dest-dir=$TMP" >/dev/null 2>&1; then
if wimlib-imagex extract "$wim" "$index" "/$file" "--dest-dir=$tmp" >/dev/null 2>&1; then
if ! wimlib-imagex extract "$wim" "$index" "/$dat" "--dest-dir=$tmp" >/dev/null 2>&1; then
if ! wimlib-imagex extract "$wim" "$index" "/$org" "--dest-dir=$tmp" >/dev/null 2>&1; then
if ! wimlib-imagex update "$wim" "$index" --command "rename /$file /$org" > /dev/null; then
warn "failed to backup original answer file ($file)."
fi
fi
fi
rm -f "$TMP/$dat"
rm -f "$TMP/$org"
rm -f "$TMP/$file"
fi
if [[ "$MANUAL" != [Yy1]* ]]; then
@ -846,7 +946,7 @@ updateImage() {
xml=$(basename "$asset")
info "Adding $xml for automatic installation..."
local answer="$TMP/$xml"
local answer="$tmp/$xml"
cp "$asset" "$answer"
updateXML "$answer" "$language"
@ -857,27 +957,23 @@ updateImage() {
wimlib-imagex update "$wim" "$index" --command "add $answer /$dat" > /dev/null || true
fi
rm -f "$answer"
fi
if [[ "$MANUAL" == [Yy1]* ]]; then
wimlib-imagex update "$wim" "$index" --command "delete --force /$file" > /dev/null || true
if wimlib-imagex extract "$wim" "$index" "/$org" "--dest-dir=$TMP" >/dev/null 2>&1; then
if ! wimlib-imagex update "$wim" "$index" --command "add $TMP/$org /$file" > /dev/null; then
if wimlib-imagex extract "$wim" "$index" "/$org" "--dest-dir=$tmp" >/dev/null 2>&1; then
if ! wimlib-imagex update "$wim" "$index" --command "add $tmp/$org /$file" > /dev/null; then
warn "failed to restore original answer file ($org)."
fi
fi
rm -f "$TMP/$org"
fi
local find="$file"
[[ "$MANUAL" == [Yy1]* ]] && find="$org"
path=$(find "$dir" -maxdepth 1 -type f -iname "$find" | head -n 1)
path=$(find "$dir" -maxdepth 1 -type f -iname "$find" -print -quit)
if [ -f "$path" ]; then
if [[ "$MANUAL" != [Yy1]* ]]; then
@ -887,6 +983,7 @@ updateImage() {
fi
fi
rm -rf "$tmp"
return 0
}
@ -896,7 +993,8 @@ removeImage() {
[ ! -f "$iso" ] && return 0
[ -n "$CUSTOM" ] && return 0
! rm -f "$iso" 2> /dev/null && warn "failed to remove $iso !"
rm -f "$iso" 2> /dev/null || warn "failed to remove $iso !"
return 0
}
@ -929,30 +1027,30 @@ buildImage() {
fi
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_gb=$(( (space + 1073741823)/1073741824 ))
space_gb=$(formatBytes "$space")
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
if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then
! genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -V "${LABEL::30}" \
-udf -boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -allow-limited-size -quiet "$dir" 2> "$log" && failed="y"
genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -V "${LABEL::30}" \
-udf -boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -allow-limited-size -quiet "$dir" 2> "$log" || failed="y"
else
case "${DETECTED,,}" in
"win2k"* | "winxp"* | "win2003"* )
! genisoimage -o "$out" -b "$ETFS" -no-emul-boot -boot-load-seg 1984 -boot-load-size 4 -c "$cat" -iso-level 2 -J -l -D -N -joliet-long \
-relaxed-filenames -V "${LABEL::30}" -quiet "$dir" 2> "$log" && failed="y" ;;
genisoimage -o "$out" -b "$ETFS" -no-emul-boot -boot-load-seg 1984 -boot-load-size 4 -c "$cat" -iso-level 2 -J -l -D -N -joliet-long \
-relaxed-filenames -V "${LABEL::30}" -quiet "$dir" 2> "$log" || failed="y" ;;
"win9"* )
! genisoimage -o "$out" -b "$ETFS" -J -r -V "${LABEL::30}" -quiet "$dir" 2> "$log" && failed="y" ;;
genisoimage -o "$out" -b "$ETFS" -J -r -V "${LABEL::30}" -quiet "$dir" 2> "$log" || failed="y" ;;
* )
! genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 2 -J -l -D -N -joliet-long -relaxed-filenames -V "${LABEL::30}" \
-udf -allow-limited-size -quiet "$dir" 2> "$log" && failed="y" ;;
genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 2 -J -l -D -N -joliet-long -relaxed-filenames -V "${LABEL::30}" \
-udf -allow-limited-size -quiet "$dir" 2> "$log" || failed="y" ;;
esac
fi
@ -968,7 +1066,7 @@ buildImage() {
[ -s "$log" ] && error="$(<"$log")"
[[ "$error" != "$hide" ]] && echo "$error"
! mv -f "$out" "$BOOT" && return 1
mv -f "$out" "$BOOT" || return 1
return 0
}
@ -976,49 +1074,49 @@ bootWindows() {
rm -rf "$TMP"
if [ -f "$STORAGE/windows.args" ]; then
ARGS=$(<"$STORAGE/windows.args")
ARGS="${ARGS//[![:print:]]/}"
ARGUMENTS="$ARGS ${ARGUMENTS:-}"
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
[ -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
if [ -s "$STORAGE/windows.mode" ] && [ -f "$STORAGE/windows.mode" ]; then
BOOT_MODE=$(<"$STORAGE/windows.mode")
BOOT_MODE="${BOOT_MODE//[![:print:]]/}"
fi
if [ -s "$STORAGE/windows.old" ] && [ -f "$STORAGE/windows.old" ]; then
[[ "${PLATFORM,,}" == "x64" ]] && MACHINE=$(<"$STORAGE/windows.old")
fi
return 0
fi
# Migrations
[[ "${PLATFORM,,}" != "x64" ]] && return 0
if [ -f "$STORAGE/windows.old" ]; then
if [[ "${PLATFORM,,}" == "x64" ]]; 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
MACHINE="${MACHINE//[![:print:]]/}"
fi
fi

View file

@ -4,25 +4,26 @@ set -Eeuo pipefail
handle_curl_error() {
local error_code="$1"
local server_name="$2"
case "$error_code" in
1) error "Unsupported protocol!" ;;
2) error "Failed to initialize curl!" ;;
3) error "The URL format is malformed!" ;;
5) error "Failed to resolve address of proxy host!" ;;
6) error "Failed to resolve Microsoft servers! Is there an Internet connection?" ;;
7) error "Failed to contact Microsoft servers! Is there an Internet connection or is the server down?" ;;
8) error "Microsoft servers returned a malformed HTTP response!" ;;
6) error "Failed to resolve $server_name servers! Is there an Internet connection?" ;;
7) error "Failed to contact $server_name servers! Is there an Internet connection or is the server down?" ;;
8) error "$server_name servers returned a malformed HTTP response!" ;;
16) error "A problem was detected in the HTTP2 framing layer!" ;;
22) error "Microsoft servers returned a failing HTTP status code!" ;;
22) error "$server_name servers returned a failing HTTP status code!" ;;
23) error "Failed at writing Windows media to disk! Out of disk space or permission error?" ;;
26) error "Failed to read Windows media from disk!" ;;
27) error "Ran out of memory during download!" ;;
28) error "Connection timed out to Microsoft server!" ;;
35) error "SSL connection error from Microsoft server!" ;;
28) error "Connection timed out to $server_name server!" ;;
35) error "SSL connection error from $server_name server!" ;;
36) error "Failed to continue earlier download!" ;;
52) error "Received no data from the Microsoft server!" ;;
63) error "Microsoft servers returned an unexpectedly large response!" ;;
52) error "Received no data from the $server_name server!" ;;
63) error "$server_name servers returned an unexpectedly large response!" ;;
# POSIX defines exit statuses 1-125 as usable by us
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02
$((error_code <= 125)))
@ -63,77 +64,75 @@ download_windows() {
local lang="$2"
local desc="$3"
local sku_id=""
local sku_url=""
local iso_url=""
local iso_json=""
local language=""
local session_id=""
local user_agent=""
local download_type=""
local windows_version=""
local iso_download_link=""
local download_page_html=""
local product_edition_id=""
local iso_download_link_html=""
local iso_download_page_html=""
local language_skuid_table_html=""
case "${id,,}" in
"win11x64" ) windows_version="11" ;;
"win10x64" ) windows_version="10" ;;
"win81x64" ) windows_version="8" ;;
* ) error "Invalid VERSION specified, value \"$id\" is not recognized!" && return 1 ;;
esac
local language_skuid_json=""
local profile="606624d44113"
user_agent=$(get_agent)
language=$(getLanguage "$lang" "name")
local url="https://www.microsoft.com/en-us/software-download/windows$windows_version"
case "$windows_version" in
8 | 10) url+="ISO";;
case "${id,,}" in
"win11x64" ) windows_version="11" && download_type="1" ;;
"win10x64" ) windows_version="10" && download_type="1" ;;
"win11arm64" ) windows_version="11arm64" && download_type="2" ;;
* ) error "Invalid VERSION specified, value \"$id\" is not recognized!" && return 1 ;;
esac
local url="https://www.microsoft.com/en-us/software-download/windows$windows_version"
[[ "${id,,}" == "win10"* ]] && url+="ISO"
# 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="${session_id//[![:print:]]/}"
# 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
# This is the *only* request we make that Fido doesn't. Fido manually maintains a list of all the Windows release/edition product edition IDs in its script (see: $WindowsVersions array). This is helpful for downloading older releases (e.g. Windows 10 1909, 21H1, etc.) but we always want to get the newest release which is why we get this value dynamically
# Also, keeping a "$WindowsVersions" array like Fido does would be way too much of a maintenance burden
# Remove "Accept" header that curl sends by default
[[ "$DEBUG" == [Yy1]* ]] && echo " - Parsing download page: ${url}"
iso_download_page_html=$(curl --silent --max-time 30 --user-agent "$user_agent" --header "Accept:" --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url") || {
handle_curl_error $?
[[ "$DEBUG" == [Yy1]* ]] && echo "Parsing download page: ${url}"
download_page_html=$(curl --silent --max-time 30 --user-agent "$user_agent" --header "Accept:" --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url") || {
handle_curl_error "$?" "Microsoft"
return $?
}
[[ "$DEBUG" == [Yy1]* ]] && echo -n "Getting Product edition ID: "
# tr: Filter for only numerics to prevent HTTP parameter injection
# head -c was recently added to POSIX: https://austingroupbugs.net/view.php?id=407
product_edition_id=$(echo "$iso_download_page_html" | grep -Eo '<option value="[0-9]+">Windows' | cut -d '"' -f 2 | head -n 1 | tr -cd '0-9' | head -c 16)
product_edition_id=$(echo "$download_page_html" | grep -Eo '<option value="[0-9]+">Windows' | cut -d '"' -f 2 | head -n 1 | tr -cd '0-9' | head -c 16)
[[ "$DEBUG" == [Yy1]* ]] && echo "$product_edition_id"
if [ -z "$product_edition_id" ]; then
error "Product edition ID not found!"
return 1
fi
[[ "$DEBUG" == [Yy1]* ]] && echo "Permit Session ID: $session_id"
# Permit Session ID
# "org_id" is always the same value
curl --silent --max-time 30 --output /dev/null --user-agent "$user_agent" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "https://vlscppe.microsoft.com/tags?org_id=y6jn8c31&session_id=$session_id" || {
# This should only happen if there's been some change to how this API works
handle_curl_error $?
handle_curl_error "$?" "Microsoft"
return $?
}
# Extract everything after the last slash
local url_segment_parameter="${url##*/}"
[[ "$DEBUG" == [Yy1]* ]] && echo -n "Getting language SKU ID: "
# Get language -> skuID association table
# SKU ID: This specifies the language of the ISO. We always use "English (United States)", however, the SKU for this changes with each Windows release
# We must make this request so our next one will be allowed
# --data "" is required otherwise no "Content-Length" header will be sent causing HTTP response "411 Length Required"
language_skuid_table_html=$(curl --silent --max-time 30 --request POST --user-agent "$user_agent" --data "" --header "Accept:" --max-filesize 10K --fail --proto =https --tlsv1.2 --http1.1 -- "https://www.microsoft.com/en-US/api/controls/contentinclude/html?pageId=a8f8f489-4c7f-463a-9ca6-5cff94d8d041&host=www.microsoft.com&segments=software-download,$url_segment_parameter&query=&action=getskuinformationbyproductedition&sessionId=$session_id&productEditionId=$product_edition_id&sdVersion=2") || {
handle_curl_error $?
sku_url="https://www.microsoft.com/software-download-connector/api/getskuinformationbyproductedition?profile=$profile&ProductEditionId=$product_edition_id&SKU=undefined&friendlyFileName=undefined&Locale=en-US&sessionID=$session_id"
language_skuid_json=$(curl --silent --max-time 30 --request GET --user-agent "$user_agent" --referer "$url" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "$sku_url") || {
handle_curl_error "$?" "Microsoft"
return $?
}
# tr: Filter for only alphanumerics or "-" to prevent HTTP parameter injection
sku_id=$(echo "$language_skuid_table_html" | grep -m 1 ">${language}<" | sed 's/&quot;//g' | cut -d ',' -f 1 | cut -d ':' -f 2 | tr -cd '[:alnum:]-' | head -c 16)
{ sku_id=$(echo "$language_skuid_json" | jq --arg LANG "$language" -r '.Skus[] | select(.Language==$LANG).Id') 2>/dev/null; rc=$?; } || :
if [ -z "$sku_id" ]; then
if [ -z "$sku_id" ] || [[ "${sku_id,,}" == "null" ]] || (( rc != 0 )); then
language=$(getLanguage "$lang" "desc")
error "No download in the $language language available for $desc!"
return 1
@ -144,28 +143,31 @@ download_windows() {
# Get ISO download link
# If any request is going to be blocked by Microsoft it's always this last one (the previous requests always seem to succeed)
# --referer: Required by Microsoft servers to allow request
iso_download_link_html=$(curl --silent --max-time 30 --request POST --user-agent "$user_agent" --data "" --referer "$url" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "https://www.microsoft.com/en-US/api/controls/contentinclude/html?pageId=6e2a1789-ef16-4f27-a296-74ef7ef5d96b&host=www.microsoft.com&segments=software-download,$url_segment_parameter&query=&action=GetProductDownloadLinksBySku&sessionId=$session_id&skuId=$sku_id&language=English&sdVersion=2")
if ! [ "$iso_download_link_html" ]; then
iso_url="https://www.microsoft.com/software-download-connector/api/GetProductDownloadLinksBySku?profile=$profile&ProductEditionId=undefined&SKU=$sku_id&friendlyFileName=undefined&Locale=en-US&sessionID=$session_id"
iso_json=$(curl --silent --max-time 30 --request GET --user-agent "$user_agent" --referer "$url" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "$iso_url")
if ! [ "$iso_json" ]; then
# This should only happen if there's been some change to how this API works
error "Microsoft servers gave us an empty response to our request for an automated download."
return 1
fi
if echo "$iso_download_link_html" | grep -q "We are unable to complete your request at this time."; then
if echo "$iso_json" | grep -q "Sentinel marked this request as rejected."; then
error "Microsoft blocked the automated download request based on your IP address."
return 1
fi
# Filter for 64-bit ISO download URL
# sed: HTML decode "&" character
# tr: Filter for only alphanumerics or punctuation
iso_download_link=$(echo "$iso_download_link_html" | grep -o "https://software.download.prss.microsoft.com.*IsoX64" | cut -d '"' -f 1 | sed 's/&amp;/\&/g' | tr -cd '[:alnum:][:punct:]')
if echo "$iso_json" | grep -q "We are unable to complete your request at this time."; then
error "Microsoft blocked the automated download request based on your IP address."
return 1
fi
if ! [ "$iso_download_link" ]; then
# This should only happen if there's been some change to the download endpoint web address
{ iso_download_link=$(echo "$iso_json" | jq --argjson TYPE "$download_type" -r '.ProductDownloadOptions[] | select(.DownloadType==$TYPE).Uri') 2>/dev/null; rc=$?; } || :
if [ -z "$iso_download_link" ] || [[ "${iso_download_link,,}" == "null" ]] || (( rc != 0 )); then
error "Microsoft servers gave us no download link to our request for an automated download!"
info "Response: $iso_json"
return 1
fi
@ -207,6 +209,9 @@ download_windows_eval() {
"win2022-eval" )
enterprise_type="server"
windows_version="windows-server-2022" ;;
"win2019-hv" )
enterprise_type="server"
windows_version="hyper-v-server-2019" ;;
"win2019-eval" )
enterprise_type="server"
windows_version="windows-server-2019" ;;
@ -229,7 +234,7 @@ download_windows_eval() {
[[ "$DEBUG" == [Yy1]* ]] && echo "Parsing download page: ${url}"
iso_download_page_html=$(curl --silent --max-time 30 --user-agent "$user_agent" --location --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url") || {
handle_curl_error $?
handle_curl_error "$?" "Microsoft"
return $?
}
@ -241,10 +246,10 @@ download_windows_eval() {
[[ "$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^^}"
else
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/?linkid=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${culture,,}&country=${country,,}"
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,,}"
fi
iso_download_links=$(echo "$iso_download_page_html" | grep -io "$filter") || {
@ -283,11 +288,11 @@ download_windows_eval() {
[[ "$DEBUG" == [Yy1]* ]] && echo "Found download link: $iso_download_link"
# Follow redirect so proceeding log message is useful
# This is a request we make this Fido doesn't
# We don't need to set "--max-filesize" here because this is a HEAD request and the output is to /dev/null anyway
# This is a request we make that Fido doesn't
iso_download_link=$(curl --silent --max-time 30 --user-agent "$user_agent" --location --output /dev/null --silent --write-out "%{url_effective}" --head --fail --proto =https --tlsv1.2 --http1.1 -- "$iso_download_link") || {
# This should only happen if the Microsoft servers are down
handle_curl_error $?
handle_curl_error "$?" "Microsoft"
return $?
}
@ -305,11 +310,11 @@ getWindows() {
language=$(getLanguage "$lang" "desc")
edition=$(printEdition "$version" "$desc")
local msg="Requesting $desc from Microsoft server..."
local msg="Requesting $desc from the Microsoft servers..."
info "$msg" && html "$msg"
case "${version,,}" in
"win2008r2" | "win81${PLATFORM,,}-enterprise-eval" | "win11${PLATFORM,,}-enterprise-iot-eval" )
"win2008r2" | "win81${PLATFORM,,}"* | "win11${PLATFORM,,}-enterprise-iot"* | "win11${PLATFORM,,}-enterprise-ltsc"* )
if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then
error "No download in the $language language available for $edition!"
MIDO_URL="" && return 1
@ -317,8 +322,9 @@ getWindows() {
esac
case "${version,,}" in
"win11${PLATFORM,,}-enterprise-iot-eval" ) ;;
"win11${PLATFORM,,}-enterprise-ltsc-eval" ) ;;
"win11${PLATFORM,,}" ) ;;
"win11${PLATFORM,,}-enterprise-iot"* ) ;;
"win11${PLATFORM,,}-enterprise-ltsc"* ) ;;
* )
if [[ "${PLATFORM,,}" != "x64" ]]; then
error "No download for the ${PLATFORM^^} platform available for $edition!"
@ -327,26 +333,24 @@ getWindows() {
esac
case "${version,,}" in
"win81${PLATFORM,,}" | "win10${PLATFORM,,}" | "win11${PLATFORM,,}" )
"win10${PLATFORM,,}" | "win11${PLATFORM,,}" )
download_windows "$version" "$lang" "$edition" && return 0
;;
"win11${PLATFORM,,}-enterprise"* | "win10${PLATFORM,,}-enterprise"* )
download_windows_eval "$version" "$lang" "$edition" && return 0
;;
"win2025-eval" | "win2022-eval" | "win2019-eval" | "win2016-eval" | "win2012r2-eval" )
"win2025-eval" | "win2022-eval" | "win2019-eval" | "win2019-hv" | "win2016-eval" | "win2012r2-eval" )
download_windows_eval "$version" "$lang" "$edition" && return 0
;;
"win81${PLATFORM,,}-enterprise-eval" )
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
;;
"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
"win81${PLATFORM,,}-enterprise"* | "win2008r2" )
;;
* ) error "Invalid VERSION specified, value \"$version\" is not recognized!" ;;
esac
MIDO_URL=""
return 1
MIDO_URL=$(getMido "$version" "$lang" "")
[ -z "$MIDO_URL" ] && return 1
return 0
}
getCatalog() {
@ -416,7 +420,7 @@ getESD() {
local eFile="esd_edition.xml"
local fFile="products_filter.xml"
{ wget "$winCatalog" -O "$dir/$wFile" -q --timeout=30; rc=$?; } || :
{ wget "$winCatalog" -O "$dir/$wFile" -q --timeout=30 --no-http-keep-alive; rc=$?; } || :
msg="Failed to download $winCatalog"
(( rc == 3 )) && error "$msg , cannot write file (disk full?)" && return 1
@ -468,6 +472,18 @@ getESD() {
return 0
}
isCompressed() {
local file="$1"
case "${file,,}" in
*".7z" | *".zip" | *".rar" | *".lzma" | *".bz" | *".bz2" )
return 0 ;;
esac
return 1
}
verifyFile() {
local iso="$1"
@ -476,7 +492,9 @@ verifyFile() {
local check="$4"
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
local hash=""
@ -499,7 +517,7 @@ verifyFile() {
info "Succesfully verified ISO!" && return 0
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
}
@ -511,14 +529,17 @@ downloadFile() {
local size="$4"
local lang="$5"
local desc="$6"
local rc total progress domain dots space folder
local msg="Downloading $desc"
local rc total total_gb progress domain dots agent space folder
rm -f "$iso"
agent=$(get_agent)
if [ -n "$size" ] && [[ "$size" != "0" ]]; then
folder=$(dirname -- "$iso")
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
# Check if running with interactive TTY or redirected to docker log
@ -528,8 +549,8 @@ downloadFile() {
progress="--progress=dot:giga"
fi
local msg="Downloading $desc"
html "$msg..."
/run/progress.sh "$iso" "$size" "$msg ([P])..." &
domain=$(echo "$url" | awk -F/ '{print $3}')
dots=$(echo "$domain" | tr -cd '.' | wc -c)
@ -540,25 +561,26 @@ downloadFile() {
fi
info "$msg..."
/run/progress.sh "$iso" "$size" "$msg ([P])..." &
{ wget "$url" -O "$iso" -q --timeout=30 --show-progress "$progress"; rc=$?; } || :
{ wget "$url" -O "$iso" -q --timeout=30 --no-http-keep-alive --user-agent "$agent" --show-progress "$progress"; rc=$?; } || :
fKill "progress.sh"
if (( rc == 0 )) && [ -f "$iso" ]; then
total=$(stat -c%s "$iso")
total_gb=$(formatBytes "$total")
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
! verifyFile "$iso" "$size" "$total" "$sum" && return 1
verifyFile "$iso" "$size" "$total" "$sum" || return 1
isCompressed "$url" && UNPACK="Y"
html "Download finished successfully..." && return 0
fi
msg="Failed to download $url"
(( rc == 3 )) && error "$msg , cannot write file (disk full?)" && 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"
return 1
@ -569,14 +591,21 @@ downloadImage() {
local iso="$1"
local version="$2"
local lang="$3"
local delay=5
local tried="n"
local success="n"
local url sum size base desc language
local msg="Will retry after $delay seconds..."
if [[ "${version,,}" == "http"* ]]; then
base=$(basename "$iso")
desc=$(fromFile "$base")
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
info "$msg" && html "$msg" && sleep "$delay"
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
rm -f "$iso"
return 1
fi
@ -596,11 +625,23 @@ downloadImage() {
fi
if isMido "$version" "$lang"; then
tried="y"
success="n"
if getWindows "$version" "$lang" "$desc"; then
success="y"
else
info "$msg" && html "$msg" && sleep "$delay"
getWindows "$version" "$lang" "$desc" && success="y"
fi
if [[ "$success" == "y" ]]; then
size=$(getMido "$version" "$lang" "size" )
sum=$(getMido "$version" "$lang" "sum")
downloadFile "$iso" "$MIDO_URL" "$sum" "$size" "$lang" "$desc" && return 0
info "$msg" && html "$msg" && sleep "$delay"
downloadFile "$iso" "$MIDO_URL" "$sum" "$size" "$lang" "$desc" && return 0
rm -f "$iso"
fi
fi
@ -614,10 +655,20 @@ downloadImage() {
fi
tried="y"
success="n"
if getESD "$TMP/esd" "$version" "$lang" "$desc"; then
success="y"
else
info "$msg" && html "$msg" && sleep "$delay"
getESD "$TMP/esd" "$version" "$lang" "$desc" && success="y"
fi
if [[ "$success" == "y" ]]; then
ISO="${ISO%.*}.esd"
downloadFile "$ISO" "$ESD" "$ESD_SUM" "$ESD_SIZE" "$lang" "$desc" && return 0
info "$msg" && html "$msg" && sleep "$delay"
downloadFile "$ISO" "$ESD" "$ESD_SUM" "$ESD_SIZE" "$lang" "$desc" && return 0
rm -f "$ISO"
ISO="$iso"
fi
@ -636,6 +687,8 @@ downloadImage() {
size=$(getSize "$i" "$version" "$lang")
sum=$(getHash "$i" "$version" "$lang")
downloadFile "$iso" "$url" "$sum" "$size" "$lang" "$desc" && return 0
info "$msg" && html "$msg" && sleep "$delay"
downloadFile "$iso" "$url" "$sum" "$size" "$lang" "$desc" && return 0
rm -f "$iso"
fi

View file

@ -29,7 +29,7 @@ boot() {
if [ -s "$QEMU_PTY" ]; then
if [ "$(stat -c%s "$QEMU_PTY")" -gt 7 ]; then
info "Windows started succesfully, visit http://localhost:8006/ to view the screen..."
info "Windows started succesfully, visit http://127.0.0.1:8006/ to view the screen..."
return 0
fi
fi

View file

@ -14,17 +14,21 @@ if [[ "$DHCP" == [Yy1]* ]]; then
interface="$VM_NET_DEV"
fi
share="/shared"
if [ ! -d "$share" ] && [ -d "$STORAGE/shared" ]; then
share="$STORAGE/shared"
if [[ "${NETWORK,,}" == "user"* ]]; then
interface="127.0.0.1"
fi
mkdir -p "$share"
addShare() {
local dir="$1"
local name="$2"
local comment="$3"
if [ -z "$(ls -A "$share")" ]; then
mkdir -p "$dir" || return 1
ls -A "$dir" >/dev/null 2>&1 || return 1
chmod 777 "$share"
if [ -z "$(ls -A "$dir")" ]; then
chmod 777 "$dir" || return 1
{ echo "--------------------------------------------------------"
echo " $APP for Docker v$(</run/version)..."
@ -36,17 +40,31 @@ if [ -z "$(ls -A "$share")" ]; then
echo "To change its location, include the following bind mount in your compose file:"
echo ""
echo " volumes:"
echo " - \"/home/user/example:/shared\""
echo " - \"/home/example:/${name,,}\""
echo ""
echo "Or in your run command:"
echo ""
echo " -v \"/home/user/example:/shared\""
echo " -v \"/home/example:/${name,,}\""
echo ""
echo "Replace the example path /home/user/example with the desired shared folder."
echo "Replace the example path /home/example with the desired shared folder."
echo ""
} | unix2dos > "$share/readme.txt"
} | unix2dos > "$dir/readme.txt"
fi
fi
{ echo ""
echo "[$name]"
echo " path = $dir"
echo " comment = $comment"
echo " writable = yes"
echo " guest ok = yes"
echo " guest only = yes"
echo " force user = root"
echo " force group = root"
} >> "/etc/samba/smb.conf"
return 0
}
{ echo "[global]"
echo " server string = Dockur"
@ -58,29 +76,51 @@ fi
echo " guest account = nobody"
echo " map to guest = Bad User"
echo " server min protocol = NT1"
echo " follow symlinks = yes"
echo " wide links = yes"
echo " unix extensions = no"
echo ""
echo " # disable printing services"
echo " load printers = no"
echo " printing = bsd"
echo " printcap name = /dev/null"
echo " disable spoolss = yes"
echo ""
echo "[Data]"
echo " path = $share"
echo " comment = Shared"
echo " writable = yes"
echo " guest ok = yes"
echo " guest only = yes"
echo " force user = root"
echo " force group = root"
} > "/etc/samba/smb.conf"
share="/data"
[ ! -d "$share" ] && [ -d "$STORAGE/data" ] && share="$STORAGE/data"
[ ! -d "$share" ] && [ -d "/shared" ] && share="/shared"
[ ! -d "$share" ] && [ -d "$STORAGE/shared" ] && share="$STORAGE/shared"
if ! addShare "$share" "Data" "Shared"; then
error "Failed to add shared folder '$share'. Please check its permissions." && return 0
fi
if [ -d "/data2" ]; then
addShare "/data2" "Data2" "Shared" || error "Failed to add shared folder '/data2'. Please check its permissions."
fi
if [ -d "/data3" ]; then
addShare "/data3" "Data3" "Shared" || error "Failed to add shared folder '/data3'. Please check its permissions."
fi
IFS=',' read -r -a dirs <<< "${SHARES:-}"
for dir in "${dirs[@]}"; do
[ ! -d "$dir" ] && continue
dir_name=$(basename "$dir")
addShare "$dir" "$dir_name" "Shared $dir_name" || error "Failed to create shared folder for $dir!"
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
error "Samba daemon failed to start!"
smbd -i --debug-stdout || true
fi
# Enable Web Service Discovery
wsdd -i "$interface" -p -n "$hostname" &
echo "$!" > /var/run/wsdd.pid