Compare commits

..

20 Commits

Author SHA1 Message Date
Azim Muradov
588969ae5f fix: Path to "Desktop" folder on Windows XP (#1625)
Fix path to "Desktop" folder to work correctly with different locales on Windows XP.
2026-01-13 13:43:48 +01:00
Kroese
c7aac1edcf build: Update QEMU base image to v7.29 (#1583) 2025-11-22 05:02:48 +01:00
renovate[bot]
ea03c67a04 chore(deps): update actions/checkout action to v6 (#1580) 2025-11-21 12:38:58 +01:00
Gamal Moussa
bdb0488151 refactor: replace PID cleanup with loop (#1579) 2025-11-20 08:49:24 +01:00
Kroese
ad6f87046a build: Update VirtIO drivers to v1.9.49 (#1570) 2025-11-14 07:18:24 +01:00
Kroese
e7a3894210 fix: Update Workspaces configuration (#1569) 2025-11-14 06:26:07 +01:00
Kroese
8443559a76 build: Update QEMU base image to v7.28 (#1562) 2025-11-12 07:08:22 +01:00
Kroese
6dbac13cd1 fix: Use pcnet network adapter for Win9x (#1558) 2025-11-07 06:06:01 +01:00
Kroese
fd907bb78a feat: Update Windows Server download links (#1555) 2025-11-06 01:27:27 +01:00
Kroese
1a6a2dbad0 build: Use Github token (#1539) 2025-10-29 14:06:26 +01:00
Kroese
11a19f6a9d fix: Remove unnecessary operation (#1534) 2025-10-24 04:33:47 +02:00
Kroese
544501107a feat: Check if shared folder is writeable (#1531) 2025-10-22 12:19:39 +02:00
Kroese
122d1ff98e fix: Inherit owner from parent folder (#1526) 2025-10-22 10:06:26 +02:00
Kroese
c1c44c4da7 build: Add code quality checks (#1529) 2025-10-22 01:23:25 +02:00
Kroese
f661df3abc build: Update QEMU base image to v7.27 (#1528) 2025-10-21 23:19:54 +02:00
Kroese
a0bcd719be build: Add review workflow for shell formatting (#1527) 2025-10-21 22:46:06 +02:00
Kroese
9236127a86 fix: Add SELinux warning for shared folder (#1522) 2025-10-20 14:50:37 +02:00
Kroese
fa606aec53 build: Update wsddn package to v1.22 (#1521) 2025-10-20 14:48:46 +02:00
Kroese
8790b4ec7c fix: Remove SeaBIOS control characters (#1520) 2025-10-20 13:59:27 +02:00
Kroese
e3cf3ccf3d docs: Update docker run command (#1519) 2025-10-20 12:29:03 +02:00
34 changed files with 201 additions and 96 deletions

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -15,6 +15,5 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "codespaces.yml", "dockerComposeFile": "codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View File

@@ -22,7 +22,7 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
with: with:
fetch-depth: 0 fetch-depth: 0
- -

View File

@@ -9,7 +9,7 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- -
name: Run ShellCheck name: Run ShellCheck
uses: ludeeus/action-shellcheck@master uses: ludeeus/action-shellcheck@master

View File

@@ -12,13 +12,15 @@ jobs:
dockerHubDescription: dockerHubDescription:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 -
- name: Checkout repo
name: Docker Hub Description uses: actions/checkout@v6
uses: peter-evans/dockerhub-description@v5 -
with: name: Docker Hub Description
username: ${{ secrets.DOCKERHUB_USERNAME }} uses: peter-evans/dockerhub-description@v5
password: ${{ secrets.DOCKERHUB_TOKEN }} with:
repository: ${{ secrets.DOCKERHUB_REPO }} username: ${{ secrets.DOCKERHUB_USERNAME }}
short-description: ${{ github.event.repository.description }} password: ${{ secrets.DOCKERHUB_TOKEN }}
readme-filepath: ./readme.md repository: ${{ secrets.DOCKERHUB_REPO }}
short-description: ${{ github.event.repository.description }}
readme-filepath: ./readme.md

66
.github/workflows/review.yml vendored Normal file
View File

@@ -0,0 +1,66 @@
on:
pull_request:
name: "Review"
permissions:
contents: read
pull-requests: write
checks: write
jobs:
review:
name: review
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v6
-
name: Spelling
uses: reviewdog/action-misspell@v1
with:
locale: "US"
level: warning
pattern: |
*.md
*.sh
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Hadolint
uses: reviewdog/action-hadolint@v1
with:
level: warning
reporter: github-pr-review
hadolint_ignore: DL3006 DL3008
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: YamlLint
uses: reviewdog/action-yamllint@v1
with:
level: warning
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: ActionLint
uses: reviewdog/action-actionlint@v1
with:
level: warning
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Shellformat
uses: reviewdog/action-shfmt@v1
with:
level: warning
shfmt_flags: "-i 2 -ci -bn"
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Shellcheck
uses: reviewdog/action-shellcheck@v1
with:
level: warning
reporter: github-pr-review
shellcheck_flags: -x -e SC1091 -e SC2001 -e SC2002 -e SC2034 -e SC2064 -e SC2153 -e SC2317 -e SC2028
github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -3,7 +3,7 @@
ARG VERSION_ARG="latest" ARG VERSION_ARG="latest"
FROM scratch AS build-amd64 FROM scratch AS build-amd64
COPY --from=qemux/qemu:7.26 / / COPY --from=qemux/qemu:7.29 / /
ARG TARGETARCH ARG TARGETARCH
ARG DEBCONF_NOWARNINGS="yes" ARG DEBCONF_NOWARNINGS="yes"
@@ -19,7 +19,7 @@ RUN set -eu && \
cabextract \ cabextract \
libxml2-utils \ libxml2-utils \
libarchive-tools && \ libarchive-tools && \
wget "https://github.com/gershnik/wsdd-native/releases/download/v1.21/wsddn_1.21_${TARGETARCH}.deb" -O /tmp/wsddn.deb -q && \ wget "https://github.com/gershnik/wsdd-native/releases/download/v1.22/wsddn_1.22_${TARGETARCH}.deb" -O /tmp/wsddn.deb -q && \
dpkg -i /tmp/wsddn.deb && \ dpkg -i /tmp/wsddn.deb && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@@ -27,7 +27,7 @@ RUN set -eu && \
COPY --chmod=755 ./src /run/ COPY --chmod=755 ./src /run/
COPY --chmod=755 ./assets /run/assets COPY --chmod=755 ./assets /run/assets
ADD --chmod=664 https://github.com/qemus/virtiso-whql/releases/download/v1.9.48-0/virtio-win-1.9.48.tar.xz /var/drivers.txz ADD --chmod=664 https://github.com/qemus/virtiso-whql/releases/download/v1.9.49-0/virtio-win-1.9.49.tar.xz /var/drivers.txz
FROM dockurr/windows-arm:${VERSION_ARG} AS build-arm64 FROM dockurr/windows-arm:${VERSION_ARG} AS build-arm64
FROM build-${TARGETARCH} FROM build-${TARGETARCH}

View File

@@ -53,7 +53,7 @@ services:
##### Via Docker CLI: ##### Via Docker CLI:
```bash ```bash
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 docker run -it --rm --name windows -e "VERSION=11" -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v "${PWD:-.}/windows:/storage" --stop-timeout 120 docker.io/dockurr/windows
``` ```
##### Via Kubernetes: ##### Via Kubernetes:

View File

@@ -857,14 +857,14 @@ getLink1() {
url="8.x/8.1/en_windows_8.1_enterprise_with_update_x64_dvd_6054382.iso" url="8.x/8.1/en_windows_8.1_enterprise_with_update_x64_dvd_6054382.iso"
;; ;;
"win2025" | "win2025-eval" ) "win2025" | "win2025-eval" )
size=6786627584 size=7571058688
sum="bf3ef0849c7cb5e818e1035b7466d206af5aa227ace1a3f4b0de2bf00d2e2144" sum="d273d0a85565ffbc06a3d46313f619103e2830a3373306ddbb9a08b8824f509d"
url="server/2025/en-us_windows_server_2025_updated_april_2025_x64_dvd_ea86301d.iso" url="server/2025/en-us_windows_server_2025_updated_oct_2025_x64_dvd_6c0c5aa8.iso"
;; ;;
"win2022" | "win2022-eval" ) "win2022" | "win2022-eval" )
size=6005706752 size=6023239680
sum="cea2cb2c09de9910c236e64eae3a801c55e9c77ec25e8d81585e3a4581d24bfb" sum="5d6d91efa972cbdd6701d78db1dcf6a34c7024ca931c1718e7cb3d0c6dd54e88"
url="server/2022/en-us_windows_server_2022_updated_april_2025_x64_dvd_3f755ec1.iso" url="server/2022/en-us_windows_server_2022_updated_oct_2025_x64_dvd_26e9af36.iso"
;; ;;
"win2019" | "win2019-eval" ) "win2019" | "win2019-eval" )
size=5575774208 size=5575774208
@@ -1766,7 +1766,7 @@ prepareInstall() {
echo "" echo ""
echo "Call Domain.MoveHere(LocalAdminADsPath, \"$username\")" echo "Call Domain.MoveHere(LocalAdminADsPath, \"$username\")"
echo "" echo ""
echo "Set oLink = WshShell.CreateShortcut(WshShell.ExpandEnvironmentStrings(\"%userprofile%\\Desktop\\Shared.lnk\"))" echo "Set oLink = WshShell.CreateShortcut(WshShell.SpecialFolders(\"Desktop\") & \"\\Shared.lnk\")"
echo "With oLink" echo "With oLink"
echo " .TargetPath = \"\\\\host.lan\\Data\"" echo " .TargetPath = \"\\\\host.lan\\Data\""
echo " .Save" echo " .Save"
@@ -1915,16 +1915,16 @@ setMachine() {
USB="no" USB="no"
VGA="cirrus" VGA="cirrus"
DISK_TYPE="auto" DISK_TYPE="auto"
ADAPTER="rtl8139"
MACHINE="pc-i440fx-2.4" MACHINE="pc-i440fx-2.4"
BOOT_MODE="windows_legacy" ;; BOOT_MODE="windows_legacy"
[ -z "${ADAPTER:-}" ] && ADAPTER="pcnet" ;;
"win2k"* ) "win2k"* )
VGA="cirrus" VGA="cirrus"
MACHINE="pc" MACHINE="pc"
USB="pci-ohci" USB="pci-ohci"
DISK_TYPE="auto" DISK_TYPE="auto"
ADAPTER="rtl8139" BOOT_MODE="windows_legacy"
BOOT_MODE="windows_legacy" ;; [ -z "${ADAPTER:-}" ] && ADAPTER="rtl8139" ;;
"winxp"* | "win2003"* ) "winxp"* | "win2003"* )
DISK_TYPE="blk" DISK_TYPE="blk"
BOOT_MODE="windows_legacy" ;; BOOT_MODE="windows_legacy" ;;

View File

@@ -39,6 +39,8 @@ terminal
tail -fn +0 "$QEMU_LOG" --pid=$$ 2>/dev/null & tail -fn +0 "$QEMU_LOG" --pid=$$ 2>/dev/null &
cat "$QEMU_TERM" 2> /dev/null | tee "$QEMU_PTY" | \ cat "$QEMU_TERM" 2> /dev/null | tee "$QEMU_PTY" | \
sed -u -e 's/\x1B\[[=0-9;]*[a-z]//gi' \ sed -u -e 's/\x1B\[[=0-9;]*[a-z]//gi' \
-e 's/\x1B\x63//g' -e 's/\x1B\[[=?]7l//g' \
-e '/^$/d' -e 's/\x44\x53\x73//g' \
-e 's/failed to load Boot/skipped Boot/g' \ -e 's/failed to load Boot/skipped Boot/g' \
-e 's/0): Not Found/0)/g' & wait $! || : -e 's/0): Not Found/0)/g' & wait $! || :

View File

@@ -22,7 +22,11 @@ backup () {
fi fi
mkdir -p "$root" if ! makeDir "$root"; then
error "Failed to create directory \"$root\" !"
return 1
fi
local folder="$name" local folder="$name"
local dir="$root/$folder" local dir="$root/$folder"
@@ -34,7 +38,11 @@ backup () {
done done
rm -rf "$dir" rm -rf "$dir"
mkdir -p "$dir"
if ! makeDir "$dir"; then
error "Failed to create directory \"$dir\" !"
return 1
fi
[ -f "$iso" ] && mv -f "$iso" "$dir/" [ -f "$iso" ] && mv -f "$iso" "$dir/"
find "$STORAGE" -maxdepth 1 -type f -iname 'data.*' -not -iname '*.iso' -exec mv -n {} "$dir/" \; find "$STORAGE" -maxdepth 1 -type f -iname 'data.*' -not -iname '*.iso' -exec mv -n {} "$dir/" \;
@@ -127,7 +135,6 @@ startInstall() {
if [[ "${VERSION,,}" == "http"* ]]; then if [[ "${VERSION,,}" == "http"* ]]; then
file=$(basename "${VERSION%%\?*}") file=$(basename "${VERSION%%\?*}")
file="${file//+/ }"
printf -v file '%b' "${file//%/\\x}" printf -v file '%b' "${file//%/\\x}"
file="${file//[!A-Za-z0-9._-]/_}" file="${file//[!A-Za-z0-9._-]/_}"
@@ -156,7 +163,9 @@ startInstall() {
! backup "" && error "Backup failed!" ! backup "" && error "Backup failed!"
fi fi
mkdir -p "$TMP" if ! makeDir "$TMP"; then
error "Failed to create directory \"$TMP\" !"
fi
if [ -z "$CUSTOM" ]; then if [ -z "$CUSTOM" ]; then
@@ -178,6 +187,20 @@ startInstall() {
return 0 return 0
} }
writeFile() {
local txt="$1"
local path="$2"
echo "$txt" >"$path"
if ! setOwner "$path"; then
error "Failed to set the owner for \"$path\" !"
fi
return 0
}
finishInstall() { finishInstall() {
local iso="$1" local iso="$1"
@@ -188,6 +211,10 @@ finishInstall() {
error "Failed to find ISO file: $iso" && return 1 error "Failed to find ISO file: $iso" && return 1
fi fi
if [[ "$iso" == "$STORAGE/"* ]]; then
! setOwner "$iso" && error "Failed to set the owner for \"$iso\" !"
fi
if [[ "$aborted" != [Yy1]* ]]; then if [[ "$aborted" != [Yy1]* ]]; then
# Mark ISO as prepared via magic byte # Mark ISO as prepared via magic byte
byte="16" && [[ "$MANUAL" == [Yy1]* ]] && byte="17" byte="16" && [[ "$MANUAL" == [Yy1]* ]] && byte="17"
@@ -196,56 +223,68 @@ finishInstall() {
fi fi
fi fi
cp -f /run/version "$STORAGE/windows.ver" local file="$STORAGE/windows.ver"
cp -f /run/version "$file"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
if [[ "$iso" == "$STORAGE/"* ]]; then if [[ "$iso" == "$STORAGE/"* ]]; then
if [[ "$aborted" != [Yy1]* ]] || [ -z "$CUSTOM" ]; then if [[ "$aborted" != [Yy1]* ]] || [ -z "$CUSTOM" ]; then
base=$(basename "$iso") base=$(basename "$iso")
echo "$base" > "$STORAGE/windows.base" file="$STORAGE/windows.base"
writeFile "$base" "$file"
fi fi
fi fi
if [[ "${PLATFORM,,}" == "x64" ]]; then if [[ "${PLATFORM,,}" == "x64" ]]; then
if [[ "${BOOT_MODE,,}" == "windows_legacy" ]]; then if [[ "${BOOT_MODE,,}" == "windows_legacy" ]]; then
echo "$BOOT_MODE" > "$STORAGE/windows.mode" file="$STORAGE/windows.mode"
writeFile "$BOOT_MODE" "$file"
if [[ "${MACHINE,,}" != "q35" ]]; then if [[ "${MACHINE,,}" != "q35" ]]; then
echo "$MACHINE" > "$STORAGE/windows.old" file="$STORAGE/windows.old"
writeFile "$MACHINE" "$file"
fi fi
else else
# Enable secure boot + TPM on manual installs as Win11 requires # Enable secure boot + TPM on manual installs as Win11 requires
if [[ "$MANUAL" == [Yy1]* || "$aborted" == [Yy1]* ]]; then if [[ "$MANUAL" == [Yy1]* || "$aborted" == [Yy1]* ]]; then
if [[ "${DETECTED,,}" == "win11"* ]]; then if [[ "${DETECTED,,}" == "win11"* ]]; then
BOOT_MODE="windows_secure" BOOT_MODE="windows_secure"
echo "$BOOT_MODE" > "$STORAGE/windows.mode" file="$STORAGE/windows.mode"
writeFile "$BOOT_MODE" "$file"
fi fi
fi fi
# Enable secure boot on multi-socket systems to workaround freeze # Enable secure boot on multi-socket systems to workaround freeze
if [ -n "$SOCKETS" ] && [[ "$SOCKETS" != "1" ]]; then if [ -n "$SOCKETS" ] && [[ "$SOCKETS" != "1" ]]; then
BOOT_MODE="windows_secure" BOOT_MODE="windows_secure"
echo "$BOOT_MODE" > "$STORAGE/windows.mode" file="$STORAGE/windows.mode"
writeFile "$BOOT_MODE" "$file"
fi fi
fi fi
fi fi
if [ -n "${ARGS:-}" ]; then if [ -n "${ARGS:-}" ]; then
ARGUMENTS="$ARGS ${ARGUMENTS:-}" ARGUMENTS="$ARGS ${ARGUMENTS:-}"
echo "$ARGS" > "$STORAGE/windows.args" file="$STORAGE/windows.args"
writeFile "$ARGS" "$file"
fi fi
if [ -n "${VGA:-}" ] && [[ "${VGA:-}" != "virtio"* ]]; then if [ -n "${VGA:-}" ] && [[ "${VGA:-}" != "virtio"* ]]; then
echo "$VGA" > "$STORAGE/windows.vga" file="$STORAGE/windows.vga"
writeFile "$VGA" "$file"
fi fi
if [ -n "${USB:-}" ] && [[ "${USB:-}" != "qemu-xhci"* ]]; then if [ -n "${USB:-}" ] && [[ "${USB:-}" != "qemu-xhci"* ]]; then
echo "$USB" > "$STORAGE/windows.usb" file="$STORAGE/windows.usb"
writeFile "$USB" "$file"
fi fi
if [ -n "${DISK_TYPE:-}" ] && [[ "${DISK_TYPE:-}" != "scsi" ]]; then if [ -n "${DISK_TYPE:-}" ] && [[ "${DISK_TYPE:-}" != "scsi" ]]; then
echo "$DISK_TYPE" > "$STORAGE/windows.type" file="$STORAGE/windows.type"
writeFile "$DISK_TYPE" "$file"
fi fi
if [ -n "${ADAPTER:-}" ] && [[ "${ADAPTER:-}" != "virtio-net-pci" ]]; then if [ -n "${ADAPTER:-}" ] && [[ "${ADAPTER:-}" != "virtio-net-pci" ]]; then
echo "$ADAPTER" > "$STORAGE/windows.net" file="$STORAGE/windows.net"
writeFile "$ADAPTER" "$file"
fi fi
rm -rf "$TMP" rm -rf "$TMP"
@@ -351,7 +390,10 @@ extractESD() {
fi fi
rm -rf "$dir" rm -rf "$dir"
mkdir -p "$dir"
if ! makeDir "$dir"; then
error "Failed to create directory \"$dir\" !" && return 1
fi
size=9606127360 size=9606127360
size_gb=$(formatBytes "$size") size_gb=$(formatBytes "$size")
@@ -407,6 +449,8 @@ extractESD() {
error "Adding WinPE failed ($retVal)" && return 1 error "Adding WinPE failed ($retVal)" && return 1
} }
fKill "progress.sh"
local msg="Extracting $desc setup" local msg="Extracting $desc setup"
info "$msg..." info "$msg..."
@@ -486,14 +530,17 @@ extractImage() {
info "$msg..." && html "$msg..." info "$msg..." && html "$msg..."
rm -rf "$dir" rm -rf "$dir"
mkdir -p "$dir"
if ! makeDir "$dir"; then
error "Failed to create directory \"$dir\" !" && return 1
fi
size=$(stat -c%s "$iso") size=$(stat -c%s "$iso")
size_gb=$(formatBytes "$size") size_gb=$(formatBytes "$size")
space=$(df --output=avail -B 1 "$dir" | tail -n 1) space=$(df --output=avail -B 1 "$dir" | tail -n 1)
space_gb=$(formatBytes "$space") space_gb=$(formatBytes "$space")
if ((size<100000000)); then if (( size < 100000000 )); then
error "Invalid ISO file: Size is smaller than 100 MB" && return 1 error "Invalid ISO file: Size is smaller than 100 MB" && return 1
fi fi
@@ -1177,6 +1224,8 @@ buildImage() {
[[ "$error" != "$hide" ]] && echo "$error" [[ "$error" != "$hide" ]] && echo "$error"
mv -f "$out" "$BOOT" || return 1 mv -f "$out" "$BOOT" || return 1
! setOwner "$BOOT" && error "Failed to set the owner for \"$BOOT\" !"
return 0 return 0
} }

View File

@@ -487,7 +487,10 @@ getESD() {
info "$msg" && html "$msg" info "$msg" && html "$msg"
rm -rf "$dir" rm -rf "$dir"
mkdir -p "$dir"
if ! makeDir "$dir"; then
error "Failed to create directory \"$dir\" !" && return 1
fi
local xFile="products.xml" local xFile="products.xml"
local eFile="esd_edition.xml" local eFile="esd_edition.xml"

View File

@@ -76,6 +76,12 @@ finish() {
local pid local pid
local cnt=0 local cnt=0
local reason=$1 local reason=$1
local pids=(
"/var/run/tpm.pid"
"/var/run/wsdd.pid"
"/var/run/samba/nmbd.pid"
"/var/run/samba/smbd.pid"
)
touch "$QEMU_END" touch "$QEMU_END"
@@ -105,28 +111,21 @@ finish() {
if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$BOOT" ]; then if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$BOOT" ]; then
# Remove CD-ROM ISO after install # Remove CD-ROM ISO after install
if ready; then if ready; then
touch "$STORAGE/windows.boot" local file="$STORAGE/windows.boot"
touch "$file"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
if [[ "$REMOVE" != [Nn]* ]]; then if [[ "$REMOVE" != [Nn]* ]]; then
rm -f "$BOOT" 2>/dev/null || true rm -f "$BOOT" 2>/dev/null || true
fi fi
fi fi
fi fi
pid="/var/run/tpm.pid" for pid in "${pids[@]}"; do
[ -s "$pid" ] && pKill "$(<"$pid")" if [[ -s "$pid" ]]; then
rm -f "$pid" pKill "$(cat "$pid")"
fi
pid="/var/run/wsdd.pid" rm -f "$pid"
[ -s "$pid" ] && pKill "$(<"$pid")" done
rm -f "$pid"
pid="/var/run/samba/nmbd.pid"
[ -s "$pid" ] && pKill "$(<"$pid")"
rm -f "$pid"
pid="/var/run/samba/smbd.pid"
[ -s "$pid" ] && pKill "$(<"$pid")"
rm -f "$pid"
closeNetwork closeNetwork

View File

@@ -46,10 +46,21 @@ addShare() {
local cfg="$5" local cfg="$5"
local owner="" local owner=""
mkdir -p "$dir" || return 1 if [ ! -d "$dir" ]; then
if ! mkdir -p "$dir"; then
error "Failed to create shared folder ($dir)." && return 1
fi
fi
if ! ls -A "$dir" >/dev/null 2>&1; then if ! ls -A "$dir" >/dev/null 2>&1; then
error "Failed to access directory $dir" && return 1 msg="No permission to access shared folder ($dir)."
msg+=" If SELinux is active, you need to add the \":Z\" flag to the bind mount."
error "$msg" && return 1
fi
if [ ! -w "$dir" ]; then
msg="shared folder ($dir) is not writeable!"
warn "$msg"
fi fi
if [ -z "$(ls -A "$dir")" ]; then if [ -z "$(ls -A "$dir")" ]; then
@@ -136,26 +147,21 @@ share="/shared"
[ ! -d "$share" ] && [ -d "$STORAGE/data" ] && share="$STORAGE/data" [ ! -d "$share" ] && [ -d "$STORAGE/data" ] && share="$STORAGE/data"
[ ! -d "$share" ] && share="$tmp" [ ! -d "$share" ] && share="$tmp"
m1="Failed to add shared folder" ! addShare "$share" "/shared" "Data" "Shared" "$SAMBA_CONFIG" && return 0
m2="Please check its permissions."
if ! addShare "$share" "/shared" "Data" "Shared" "$SAMBA_CONFIG"; then
error "$m1 '$share'. $m2" && return 0
fi
if [ -d "/shared2" ]; then if [ -d "/shared2" ]; then
addShare "/shared2" "/shared2" "Data2" "Shared" "$SAMBA_CONFIG" || error "$m1 '/shared2'. $m2" addShare "/shared2" "/shared2" "Data2" "Shared" "$SAMBA_CONFIG" || :
else else
if [ -d "/data2" ]; then if [ -d "/data2" ]; then
addShare "/data2" "/shared2" "Data2" "Shared" "$SAMBA_CONFIG" || error "$m1 '/data2'. $m2." addShare "/data2" "/shared2" "Data2" "Shared" "$SAMBA_CONFIG" || :
fi fi
fi fi
if [ -d "/shared3" ]; then if [ -d "/shared3" ]; then
addShare "/shared3" "/shared3" "Data3" "Shared" "$SAMBA_CONFIG" || error "$m1 '/shared3'. $m2" addShare "/shared3" "/shared3" "Data3" "Shared" "$SAMBA_CONFIG" || :
else else
if [ -d "/data3" ]; then if [ -d "/data3" ]; then
addShare "/data3" "/shared3" "Data3" "Shared" "$SAMBA_CONFIG" || error "$m1 '/data3'. $m2" addShare "/data3" "/shared3" "Data3" "Shared" "$SAMBA_CONFIG" || :
fi fi
fi fi