From bb0a0b47b8b7e7c3e36b5bce6cceede52be0b4f8 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 12 Nov 2024 12:17:51 +0100 Subject: [PATCH 001/206] build: Use same version number for ARM64 build (#873) --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index e5abb6f..a36dbd2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,10 @@ ADD --chmod=755 https://raw.githubusercontent.com/christgau/wsdd/v0.8/src/wsdd.p ADD --chmod=664 https://github.com/qemus/virtiso-whql/releases/download/v1.9.43-0/virtio-win-1.9.43.tar.xz /drivers.txz FROM dockurr/windows-arm:2.22 AS build-arm64 + +ARG VERSION_ARG="0.0" +RUN echo "$VERSION_ARG" > /run/version + FROM build-${TARGETARCH} EXPOSE 8006 3389 From d7fcf9a5da70f50eb633fb3b360dff8fd1941fc3 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 12 Nov 2024 12:34:03 +0100 Subject: [PATCH 002/206] build: Use same version number for ARM64 build (#874) --- Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a36dbd2..7e9e776 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM scratch AS build-amd64 COPY --from=qemux/qemu-docker:6.06 / / -ARG VERSION_ARG="0.0" ARG DEBCONF_NOWARNINGS="yes" ARG DEBIAN_FRONTEND="noninteractive" ARG DEBCONF_NONINTERACTIVE_SEEN="true" @@ -22,7 +21,6 @@ RUN set -eu && \ libxml2-utils \ libarchive-tools && \ apt-get clean && \ - echo "$VERSION_ARG" > /run/version && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* COPY --chmod=755 ./src /run/ @@ -32,12 +30,11 @@ ADD --chmod=755 https://raw.githubusercontent.com/christgau/wsdd/v0.8/src/wsdd.p ADD --chmod=664 https://github.com/qemus/virtiso-whql/releases/download/v1.9.43-0/virtio-win-1.9.43.tar.xz /drivers.txz FROM dockurr/windows-arm:2.22 AS build-arm64 +FROM build-${TARGETARCH} ARG VERSION_ARG="0.0" RUN echo "$VERSION_ARG" > /run/version -FROM build-${TARGETARCH} - EXPOSE 8006 3389 VOLUME /storage From da8bbdcb4747ef88258833d76b07b5f5d98d5fdc Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 12 Nov 2024 12:51:43 +0100 Subject: [PATCH 003/206] build: Synchronize versions between platforms (#876) --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e9e776..801a2ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +ARG VERSION_ARG="4.00" + FROM scratch AS build-amd64 COPY --from=qemux/qemu-docker:6.06 / / @@ -29,10 +31,10 @@ 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-whql/releases/download/v1.9.43-0/virtio-win-1.9.43.tar.xz /drivers.txz -FROM dockurr/windows-arm:2.22 AS build-arm64 +FROM dockurr/windows-arm:${VERSION_ARG} AS build-arm64 FROM build-${TARGETARCH} -ARG VERSION_ARG="0.0" +ARG VERSION_ARG="4.00" RUN echo "$VERSION_ARG" > /run/version EXPOSE 8006 3389 From 3aa2f6e128c64797f0f611e20544791251af79c5 Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 13 Nov 2024 01:12:10 +0100 Subject: [PATCH 004/206] build: Update qemu-docker to v6.07 (#882) --- Dockerfile | 4 ++-- readme.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 801a2ee..f7252ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ARG VERSION_ARG="4.00" FROM scratch AS build-amd64 -COPY --from=qemux/qemu-docker:6.06 / / +COPY --from=qemux/qemu-docker:6.07 / / ARG DEBCONF_NOWARNINGS="yes" ARG DEBIAN_FRONTEND="noninteractive" @@ -37,8 +37,8 @@ FROM build-${TARGETARCH} ARG VERSION_ARG="4.00" RUN echo "$VERSION_ARG" > /run/version -EXPOSE 8006 3389 VOLUME /storage +EXPOSE 8006 3389 ENV VERSION="11" ENV RAM_SIZE="4G" diff --git a/readme.md b/readme.md index 4ad3c42..4d7b8db 100644 --- a/readme.md +++ b/readme.md @@ -361,7 +361,7 @@ kubectl apply -f kubernetes.yml - you are not using "Docker Desktop for Linux" as it does not support KVM, instead make use of Docker Engine directly. - - it could help to add `privileged: true` to your compose file (or `sudo` to your `run` command), to rule out any permission issue. + - it could help to add `privileged: true` to your compose file (or `sudo` to your `docker run` command), to rule out any permission issue. ### How do I run macOS in a container? From 658c84c55f1dc08367d83ac5407abf13e55212db Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 13 Nov 2024 03:24:11 +0100 Subject: [PATCH 005/206] docs: Add compatibility chart (#883) --- readme.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/readme.md b/readme.md index 4d7b8db..29e1bdd 100644 --- a/readme.md +++ b/readme.md @@ -58,6 +58,16 @@ Via Kubernetes: kubectl apply -f kubernetes.yml ``` +## Compatibility ⚙️ + +| **Product** | **Platform** | | +|---|---|---| +| Docker Engine | Linux| ✅ | +| Docker Desktop | Linux | ❌ | +| Docker Desktop | macOS | ❌ | +| Docker Desktop | Windows 11 | ✅ | +| Docker Desktop | Windows 10 | ❌ | + ## FAQ 💬 ### How do I use it? From 6919e36aee1e86c9e30f4977dfcf231cc824d668 Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 13 Nov 2024 03:34:45 +0100 Subject: [PATCH 006/206] docs: Add Kubernetes URL (#885) --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 29e1bdd..1a72923 100644 --- a/readme.md +++ b/readme.md @@ -55,7 +55,7 @@ docker run -it --rm -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN --stop-ti Via Kubernetes: ```shell -kubectl apply -f kubernetes.yml +kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/master/kubernetes.yml ``` ## Compatibility ⚙️ From 66f595d84a1c891daa4d262cd5a19ac2b4713d85 Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 13 Nov 2024 04:37:27 +0100 Subject: [PATCH 007/206] fix: Disable HTTP keepalives (#887) --- src/mido.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mido.sh b/src/mido.sh index be7884f..d739553 100644 --- a/src/mido.sh +++ b/src/mido.sh @@ -457,7 +457,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 @@ -583,7 +583,7 @@ downloadFile() { 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 --show-progress "$progress"; rc=$?; } || : fKill "progress.sh" From 2c4094b0f799e26c49cadb43075b595b6708a146 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 15 Nov 2024 05:16:48 +0100 Subject: [PATCH 008/206] feat: Improved download method (#903) --- Dockerfile | 9 +++--- readme.md | 1 - src/define.sh | 33 +++++++++---------- src/install.sh | 8 ++--- src/mido.sh | 87 +++++++++++++++++++++++++------------------------- 5 files changed, 70 insertions(+), 68 deletions(-) diff --git a/Dockerfile b/Dockerfile index f7252ce..a610fbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -ARG VERSION_ARG="4.00" - +ARG VERSION_ARG="latest" FROM scratch AS build-amd64 -COPY --from=qemux/qemu-docker:6.07 / / + +COPY --from=qemux/qemu-docker:6.08 / / ARG DEBCONF_NOWARNINGS="yes" ARG DEBIAN_FRONTEND="noninteractive" @@ -11,6 +11,7 @@ RUN set -eu && \ apt-get update && \ apt-get --no-install-recommends -y install \ bc \ + jq \ curl \ 7zip \ wsdd \ @@ -34,7 +35,7 @@ ADD --chmod=664 https://github.com/qemus/virtiso-whql/releases/download/v1.9.43- FROM dockurr/windows-arm:${VERSION_ARG} AS build-arm64 FROM build-${TARGETARCH} -ARG VERSION_ARG="4.00" +ARG VERSION_ARG="0.00" RUN echo "$VERSION_ARG" > /run/version VOLUME /storage diff --git a/readme.md b/readme.md index 1a72923..ed9c719 100644 --- a/readme.md +++ b/readme.md @@ -103,7 +103,6 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas | `10l` | Windows 10 LTSC | 4.6 GB | | `10e` | Windows 10 Enterprise | 5.2 GB | |||| - | `8` | Windows 8.1 Pro | 4.0 GB | | `8e` | Windows 8.1 Enterprise | 3.7 GB | | `7e` | Windows 7 Enterprise | 3.0 GB | | `ve` | Windows Vista Enterprise | 3.0 GB | diff --git a/src/define.sh b/src/define.sh index a2706e3..00fe997 100644 --- a/src/define.sh +++ b/src/define.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash set -Eeuo pipefail -: "${XRES:=""}" -: "${YRES:=""}" +: "${WIDTH:=""}" +: "${HEIGHT:=""}" : "${VERIFY:=""}" : "${REGION:=""}" : "${MANUAL:=""}" @@ -164,7 +164,7 @@ getLanguage() { desc="English" culture="en-GB" ;; "en" | "en-"* ) - lang="English (United States)" + lang="English" desc="English" culture="en-US" ;; "mx" | "es-mx" ) @@ -280,15 +280,15 @@ getLanguage() { desc="$lang" culture="uk-UA" ;; "hk" | "zh-hk" | "cn-hk" ) - lang="Chinese Traditional" + lang="Chinese (Traditional)" desc="Chinese HK" culture="zh-TW" ;; "tw" | "zh-tw" | "cn-tw" ) - lang="Chinese Traditional" + lang="Chinese (Traditional)" desc="Chinese TW" culture="zh-TW" ;; "zh" | "zh-"* | "cn" | "cn-"* ) - lang="Chinese Simplified" + lang="Chinese (Simplified)" desc="Chinese" culture="zh-CN" ;; esac @@ -671,10 +671,6 @@ getMido() { size=4898582528 sum="e4ab2e3535be5748252a8d5d57539a6e59be8d6726345ee10e7afd2cb89fefb5" ;; - "win81x64" ) - size=4320526336 - sum="d8333cf427eb3318ff6ab755eb1dd9d433f0e2ae43745312c1cd23e83ca1ce51" - ;; "win81x64-enterprise-eval" ) size=3961473024 sum="2dedd44c45646c74efc5a028f65336027e14a56f76686a4631cf94ffe37c72f2" @@ -766,6 +762,11 @@ getLink1() { sum="d8333cf427eb3318ff6ab755eb1dd9d433f0e2ae43745312c1cd23e83ca1ce51" url="8.x/8.1/en_windows_8.1_with_update_x64_dvd_6051480.iso" ;; + "win81x64-enterprise" | "win81x64-enterprise-eval" ) + size=4139163648 + sum="c3c604c03677504e8905090a8ce5bb1dde76b6fd58e10f32e3a25bef21b2abe1" + url="8.x/8.1/en_windows_8.1_enterprise_with_update_x64_dvd_6054382.iso" + ;; "win2025" | "win2025-eval" ) size=5307176960 sum="2293897341febdcea599f5412300b470b5288c6fd2b89666a7b27d283e8d3cf3" @@ -2122,11 +2123,11 @@ prepareInstall() { local install="$dir/\$OEM\$/\$1/OEM/install.bat" [ -f "$install" ] && oem="\"Script\"=\"cmd /C start \\\"Install\\\" \\\"cmd /C C:\\\\OEM\\\\install.bat\\\"\"" - [ -z "$YRES" ] && YRES="720" - [ -z "$XRES" ] && XRES="1280" + [ -z "$WIDTH" ] && WIDTH="1280" + [ -z "$HEIGHT" ] && HEIGHT="720" - XHEX=$(printf '%x\n' "$XRES") - YHEX=$(printf '%x\n' "$YRES") + XHEX=$(printf '%x\n' "$WIDTH") + YHEX=$(printf '%x\n' "$HEIGHT") local username="Docker" local password="*" @@ -2178,8 +2179,8 @@ prepareInstall() { echo "" echo "[Display]" echo " BitsPerPel=32" - echo " XResolution=$XRES" - echo " YResolution=$YRES" + echo " XResolution=$WIDTH" + echo " YResolution=$HEIGHT" echo "" echo "[Networking]" echo " InstallDefaultComponents=Yes" diff --git a/src/install.sh b/src/install.sh index b03f55a..e22b99e 100644 --- a/src/install.sh +++ b/src/install.sh @@ -620,11 +620,11 @@ updateXML() { local language="$2" local culture region user admin pass keyboard - [ -z "$YRES" ] && YRES="720" - [ -z "$XRES" ] && XRES="1280" + [ -z "$HEIGHT" ] && HEIGHT="720" + [ -z "$WIDTH" ] && WIDTH="1280" - sed -i "s/1080<\/VerticalResolution>/$YRES<\/VerticalResolution>/g" "$asset" - sed -i "s/1920<\/HorizontalResolution>/$XRES<\/HorizontalResolution>/g" "$asset" + sed -i "s/1080<\/VerticalResolution>/$HEIGHT<\/VerticalResolution>/g" "$asset" + sed -i "s/1920<\/HorizontalResolution>/$WIDTH<\/HorizontalResolution>/g" "$asset" culture=$(getLanguage "$language" "culture") diff --git a/src/mido.sh b/src/mido.sh index d739553..776f716 100644 --- a/src/mido.sh +++ b/src/mido.sh @@ -63,31 +63,33 @@ 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) @@ -96,44 +98,39 @@ download_windows() { # 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") || { + [[ "$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 $? 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 '