Compare commits

...

16 Commits
v3.22 ... v4.00

Author SHA1 Message Date
Kroese
80c5ba2231 build: Docker lint exception (#813) 2024-10-15 00:49:05 +02:00
Kroese
760fe9a31f feat: Include ARM64 version in image (#812) 2024-10-15 00:45:28 +02:00
Kroese
01c61dd32d build: Remove ARM64 platform (#811) 2024-10-14 18:56:43 +02:00
Kroese
815a3f3c66 feat: Support multiple shared folders (#810) 2024-10-14 16:40:15 +02:00
Kroese
69b450299c fix: Continue without drivers (#809) 2024-10-14 15:23:59 +02:00
Kroese
b347232ac8 feat: Check returnvalues for drivers (#807) 2024-10-14 03:26:19 +02:00
Kroese
955f8a08a0 fix: Dereference symbolic links (#806) 2024-10-14 01:03:52 +02:00
Kroese
a659c1c9da feat: Use bsdtar to extract driver archive (#805) 2024-10-13 21:14:38 +02:00
Kroese
16c3a047c2 fix: Shared folder mount (#804) 2024-10-13 12:00:31 +02:00
Kroese
3cab3d1c7b feat: Extract drivers to temporary folder (#803) 2024-10-13 11:28:21 +02:00
Kroese
ff55f843bd feat: Additional download mirrors (#801) 2024-10-12 19:02:03 +02:00
Kroese
edb300dfec feat: Additional download mirrors (#799) 2024-10-12 18:09:13 +02:00
Kroese
9db3651654 feat: Select LTSC edition based on key (#798) 2024-10-12 16:54:35 +02:00
Kroese
0dabce04a6 docs: Features (#797) 2024-10-12 15:52:51 +02:00
Kroese
5f4c0938ac feat: Extract temporary files to RAM (#796) 2024-10-12 14:26:04 +02:00
Kroese
94a84b0c2d feat: Remove empty Windows.old folder (#793) 2024-10-11 11:33:50 +02:00
15 changed files with 226 additions and 199 deletions

View File

@@ -50,7 +50,7 @@ jobs:
labels: | labels: |
org.opencontainers.image.title=${{ vars.NAME }} org.opencontainers.image.title=${{ vars.NAME }}
env: env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
- -
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3

View File

@@ -21,5 +21,5 @@ jobs:
uses: hadolint/hadolint-action@v3.1.0 uses: hadolint/hadolint-action@v3.1.0
with: with:
dockerfile: Dockerfile dockerfile: Dockerfile
ignore: DL3008 ignore: DL3006,DL3008
failure-threshold: warning failure-threshold: warning

View File

@@ -1,4 +1,4 @@
FROM scratch FROM scratch AS build-amd64
COPY --from=qemux/qemu-docker:6.05 / / COPY --from=qemux/qemu-docker:6.05 / /
ARG VERSION_ARG="0.0" ARG VERSION_ARG="0.0"
@@ -19,7 +19,8 @@ RUN set -eu && \
dos2unix \ dos2unix \
cabextract \ cabextract \
genisoimage \ genisoimage \
libxml2-utils && \ libxml2-utils \
libarchive-tools && \
apt-get clean && \ apt-get clean && \
echo "$VERSION_ARG" > /run/version && \ echo "$VERSION_ARG" > /run/version && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@@ -30,6 +31,9 @@ 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=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 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.20 AS build-arm64
FROM build-${TARGETARCH}
EXPOSE 8006 3389 EXPOSE 8006 3389
VOLUME /storage VOLUME /storage

View File

@@ -448,7 +448,7 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>23</Order> <Order>23</Order>
<CommandLine>rd /q c:\Windows.old 2>nul</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">

View File

@@ -451,7 +451,7 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>23</Order> <Order>23</Order>
<CommandLine>rd /q c:\Windows.old 2>nul</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">

View File

@@ -61,12 +61,6 @@
</DiskConfiguration> </DiskConfiguration>
<ImageInstall> <ImageInstall>
<OSImage> <OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/image/index</Key>
<Value>2</Value>
</MetaData>
</InstallFrom>
<InstallTo> <InstallTo>
<DiskID>0</DiskID> <DiskID>0</DiskID>
<PartitionID>3</PartitionID> <PartitionID>3</PartitionID>
@@ -87,7 +81,7 @@
<FullName>Docker</FullName> <FullName>Docker</FullName>
<Organization>Windows for Docker</Organization> <Organization>Windows for Docker</Organization>
<ProductKey> <ProductKey>
<Key /> <Key>CGK42-GYN6Y-VD22B-BX98W-J8JXD</Key>
</ProductKey> </ProductKey>
</UserData> </UserData>
<EnableFirewall>false</EnableFirewall> <EnableFirewall>false</EnableFirewall>
@@ -457,7 +451,7 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>23</Order> <Order>23</Order>
<CommandLine>rd /q c:\Windows.old 2>nul</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">

View File

@@ -61,12 +61,6 @@
</DiskConfiguration> </DiskConfiguration>
<ImageInstall> <ImageInstall>
<OSImage> <OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/image/index</Key>
<Value>1</Value>
</MetaData>
</InstallFrom>
<InstallTo> <InstallTo>
<DiskID>0</DiskID> <DiskID>0</DiskID>
<PartitionID>3</PartitionID> <PartitionID>3</PartitionID>
@@ -87,7 +81,7 @@
<FullName>Docker</FullName> <FullName>Docker</FullName>
<Organization>Windows for Docker</Organization> <Organization>Windows for Docker</Organization>
<ProductKey> <ProductKey>
<Key /> <Key>M7XTQ-FN8P6-TTKYV-9D4CC-J462D</Key>
</ProductKey> </ProductKey>
</UserData> </UserData>
<EnableFirewall>false</EnableFirewall> <EnableFirewall>false</EnableFirewall>
@@ -457,7 +451,7 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>23</Order> <Order>23</Order>
<CommandLine>rd /q c:\Windows.old 2>nul</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">

View File

@@ -451,7 +451,7 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>23</Order> <Order>23</Order>
<CommandLine>rd /q c:\Windows.old 2>nul</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">

View File

@@ -342,7 +342,7 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>rd /q c:\Windows.old 2>nul</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">

View File

@@ -345,7 +345,7 @@
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">
<Order>22</Order> <Order>22</Order>
<CommandLine>rd /q c:\Windows.old 2>nul</CommandLine> <CommandLine>cmd /C rd /q C:\Windows.old</CommandLine>
<Description>Remove empty Windows.old folder</Description> <Description>Remove empty Windows.old folder</Description>
</SynchronousCommand> </SynchronousCommand>
<SynchronousCommand wcm:action="add"> <SynchronousCommand wcm:action="add">

View File

@@ -16,7 +16,6 @@ Windows inside a Docker container.
## Features ✨ ## Features ✨
- Multi-language
- ISO downloader - ISO downloader
- KVM acceleration - KVM acceleration
- Web-based viewer - Web-based viewer
@@ -140,7 +139,7 @@ kubectl apply -f kubernetes.yml
```yaml ```yaml
volumes: volumes:
- /home/user/example:/shared - /home/user/example:/data
``` ```
The example folder `/home/user/example` will be available as ` \\host.lan\Data`. The example folder `/home/user/example` will be available as ` \\host.lan\Data`.

View File

@@ -1637,6 +1637,30 @@ validVersion() {
return 1 return 1
} }
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 | head -n 1)
[ -f "$file" ] && unix2dos -q "$file"
return 0
}
migrateFiles() { migrateFiles() {
local base="$1" local base="$1"
@@ -1653,7 +1677,7 @@ migrateFiles() {
[[ "${version,,}" == "win7x64" ]] && file="en_windows_7_enterprise_with_sp1_x64_dvd_u_677651.iso" [[ "${version,,}" == "win7x64" ]] && file="en_windows_7_enterprise_with_sp1_x64_dvd_u_677651.iso"
[ ! -f "$STORAGE/$file" ] && return 0 [ ! -f "$STORAGE/$file" ] && return 0
! mv -f "$STORAGE/$file" "$base" && return 1 mv -f "$STORAGE/$file" "$base" || return 1
return 0 return 0
} }
@@ -1665,7 +1689,10 @@ prepareInstall() {
local arch="$4" local arch="$4"
local key="$5" local key="$5"
local driver="$6" local driver="$6"
local drivers="$TMP/drivers" local drivers="/tmp/drivers"
rm -rf "$drivers"
mkdir -p "$drivers"
ETFS="[BOOT]/Boot-NoEmul.img" ETFS="[BOOT]/Boot-NoEmul.img"
@@ -1676,9 +1703,7 @@ prepareInstall() {
local msg="Adding drivers to image..." local msg="Adding drivers to image..."
info "$msg" && html "$msg" info "$msg" && html "$msg"
mkdir -p "$drivers" if ! bsdtar -xf /drivers.txz -C "$drivers"; then
if ! tar -xf /drivers.txz -C "$drivers" --warning=no-timestamp; then
error "Failed to extract drivers!" && return 1 error "Failed to extract drivers!" && return 1
fi fi
@@ -1689,21 +1714,21 @@ prepareInstall() {
error "Failed to locate required storage drivers!" && return 1 error "Failed to locate required storage drivers!" && return 1
fi fi
cp "$drivers/viostor/$driver/$arch/viostor.sys" "$target" cp -L "$drivers/viostor/$driver/$arch/viostor.sys" "$target" || return 1
mkdir -p "$dir/\$OEM\$/\$1/Drivers/viostor" mkdir -p "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1
cp "$drivers/viostor/$driver/$arch/viostor.cat" "$dir/\$OEM\$/\$1/Drivers/viostor" cp -L "$drivers/viostor/$driver/$arch/viostor.cat" "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1
cp "$drivers/viostor/$driver/$arch/viostor.inf" "$dir/\$OEM\$/\$1/Drivers/viostor" cp -L "$drivers/viostor/$driver/$arch/viostor.inf" "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1
cp "$drivers/viostor/$driver/$arch/viostor.sys" "$dir/\$OEM\$/\$1/Drivers/viostor" cp -L "$drivers/viostor/$driver/$arch/viostor.sys" "$dir/\$OEM\$/\$1/Drivers/viostor" || return 1
if [ ! -f "$drivers/NetKVM/$driver/$arch/netkvm.sys" ]; then if [ ! -f "$drivers/NetKVM/$driver/$arch/netkvm.sys" ]; then
error "Failed to locate required network drivers!" && return 1 error "Failed to locate required network drivers!" && return 1
fi fi
mkdir -p "$dir/\$OEM\$/\$1/Drivers/NetKVM" mkdir -p "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
cp "$drivers/NetKVM/$driver/$arch/netkvm.cat" "$dir/\$OEM\$/\$1/Drivers/NetKVM" cp -L "$drivers/NetKVM/$driver/$arch/netkvm.cat" "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
cp "$drivers/NetKVM/$driver/$arch/netkvm.inf" "$dir/\$OEM\$/\$1/Drivers/NetKVM" cp -L "$drivers/NetKVM/$driver/$arch/netkvm.inf" "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
cp "$drivers/NetKVM/$driver/$arch/netkvm.sys" "$dir/\$OEM\$/\$1/Drivers/NetKVM" cp -L "$drivers/NetKVM/$driver/$arch/netkvm.sys" "$dir/\$OEM\$/\$1/Drivers/NetKVM" || return 1
if [ ! -f "$target/TXTSETUP.SIF" ]; then if [ ! -f "$target/TXTSETUP.SIF" ]; then
error "The file TXTSETUP.SIF could not be found!" && return 1 error "The file TXTSETUP.SIF could not be found!" && return 1
@@ -1721,9 +1746,9 @@ prepareInstall() {
error "Failed to locate required SATA drivers!" && return 1 error "Failed to locate required SATA drivers!" && return 1
fi fi
mkdir -p "$dir/\$OEM\$/\$1/Drivers/sata" mkdir -p "$dir/\$OEM\$/\$1/Drivers/sata" || return 1
cp -a "$drivers/sata/xp/$arch/." "$dir/\$OEM\$/\$1/Drivers/sata" cp -Lr "$drivers/sata/xp/$arch/." "$dir/\$OEM\$/\$1/Drivers/sata" || return 1
cp -a "$drivers/sata/xp/$arch/." "$target" cp -Lr "$drivers/sata/xp/$arch/." "$target" || return 1
sed -i '/^\[SCSI.Load\]/s/$/\niaStor=iaStor.sys,4/' "$target/TXTSETUP.SIF" sed -i '/^\[SCSI.Load\]/s/$/\niaStor=iaStor.sys,4/' "$target/TXTSETUP.SIF"
sed -i '/^\[FileFlags\]/s/$/\niaStor.sys = 16/' "$target/TXTSETUP.SIF" sed -i '/^\[FileFlags\]/s/$/\niaStor.sys = 16/' "$target/TXTSETUP.SIF"
@@ -1748,23 +1773,14 @@ prepareInstall() {
warn "this version of $desc requires a volume license key (VLK), it will ask for one during installation." warn "this version of $desc requires a volume license key (VLK), it will ask for one during installation."
fi fi
local oem="" if ! addFolder "$dir"; then
local folder="/oem" error "Failed to add OEM folder to image!" && return 1
[ ! -d "$folder" ] && folder="/OEM"
[ ! -d "$folder" ] && folder="$STORAGE/oem"
[ ! -d "$folder" ] && folder="$STORAGE/OEM"
if [ -d "$folder" ]; then
file=$(find "$folder" -maxdepth 1 -type f -iname install.bat | head -n 1)
if [ -f "$file" ]; then
unix2dos -q "$file"
oem="\"Script\"=\"cmd /C start \\\"Install\\\" \\\"cmd /C C:\\\\OEM\\\\install.bat\\\"\""
fi
fi fi
local oem=""
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 "$YRES" ] && YRES="720"
[ -z "$XRES" ] && XRES="1280" [ -z "$XRES" ] && XRES="1280"
@@ -1957,18 +1973,6 @@ prepareInstall() {
echo "" echo ""
} | unix2dos > "$dir/\$OEM\$/cmdlines.txt" } | unix2dos > "$dir/\$OEM\$/cmdlines.txt"
[ ! -d "$folder" ] && return 0
msg="Adding OEM folder to image..."
info "$msg" && html "$msg"
local dest="$dir/\$OEM\$/\$1/"
mkdir -p "$dest"
if ! cp -r "$folder" "$dest"; then
error "Failed to copy OEM folder!" && return 1
fi
return 0 return 0
} }
@@ -1992,7 +1996,7 @@ prepare2k3() {
key="P4WJG-WK3W7-3HM8W-RWHCK-8JTRY" key="P4WJG-WK3W7-3HM8W-RWHCK-8JTRY"
fi fi
! prepareInstall "$iso" "$dir" "$desc" "$arch" "$key" "$driver" && return 1 prepareInstall "$iso" "$dir" "$desc" "$arch" "$key" "$driver" || return 1
return 0 return 0
} }
@@ -2017,7 +2021,7 @@ prepareXP() {
key="B2RBK-7KPT9-4JP6X-QQFWM-PJD6G" key="B2RBK-7KPT9-4JP6X-QQFWM-PJD6G"
fi fi
! prepareInstall "$iso" "$dir" "$desc" "$arch" "$key" "$driver" && return 1 prepareInstall "$iso" "$dir" "$desc" "$arch" "$key" "$driver" || return 1
return 0 return 0
} }

View File

@@ -541,7 +541,7 @@ detectImage() {
fi fi
info=$(wimlib-imagex info -xml "$wim" | tr -d '\000') info=$(wimlib-imagex info -xml "$wim" | tr -d '\000')
! checkPlatform "$info" && exit 67 checkPlatform "$info" || exit 67
DETECTED=$(detectVersion "$info") DETECTED=$(detectVersion "$info")
@@ -561,7 +561,7 @@ detectImage() {
if [[ "${LANGUAGE,,}" != "en" ]] && [[ "${LANGUAGE,,}" != "en-"* ]]; then if [[ "${LANGUAGE,,}" != "en" ]] && [[ "${LANGUAGE,,}" != "en-"* ]]; then
language=$(getLanguage "$LANGUAGE" "desc") language=$(getLanguage "$LANGUAGE" "desc")
desc=+" ($language)" desc+=" ($language)"
fi fi
info "Detected: $desc" info "Detected: $desc"
@@ -588,7 +588,7 @@ prepareImage() {
desc=$(printVersion "$DETECTED" "$DETECTED") desc=$(printVersion "$DETECTED" "$DETECTED")
! setMachine "$DETECTED" "$iso" "$dir" "$desc" && return 1 setMachine "$DETECTED" "$iso" "$dir" "$desc" || return 1
skipVersion "$DETECTED" && return 0 skipVersion "$DETECTED" && return 0
if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then
@@ -704,7 +704,8 @@ addDriver() {
esac esac
local dest="$path/$target/$driver" 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 return 0
} }
@@ -712,49 +713,51 @@ addDriver() {
addDrivers() { addDrivers() {
local src="$1" local src="$1"
local file="$2" local tmp="$2"
local index="$3" local file="$3"
local version="$4" local index="$4"
local version="$5"
local drivers="$tmp/drivers"
rm -rf "$drivers"
mkdir -p "$drivers"
local msg="Adding drivers to image..." local msg="Adding drivers to image..."
info "$msg" && html "$msg" info "$msg" && html "$msg"
local drivers="$TMP/drivers" if ! bsdtar -xf /drivers.txz -C "$drivers"; then
mkdir -p "$drivers" error "Failed to extract drivers from archive!" && return 1
if ! tar -xf /drivers.txz -C "$drivers" --warning=no-timestamp; then
error "Failed to extract driver!" && return 1
fi fi
local target="\$WinPEDriver\$" local target="\$WinPEDriver\$"
local dest="$drivers/$target" 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 wimlib-imagex update "$file" "$index" --command "delete --force --recursive /$target" >/dev/null || true
addDriver "$version" "$drivers" "$target" "qxl" addDriver "$version" "$drivers" "$target" "qxl" || return 1
addDriver "$version" "$drivers" "$target" "viofs" addDriver "$version" "$drivers" "$target" "viofs" || return 1
addDriver "$version" "$drivers" "$target" "sriov" addDriver "$version" "$drivers" "$target" "sriov" || return 1
addDriver "$version" "$drivers" "$target" "smbus" addDriver "$version" "$drivers" "$target" "smbus" || return 1
addDriver "$version" "$drivers" "$target" "qxldod" addDriver "$version" "$drivers" "$target" "qxldod" || return 1
addDriver "$version" "$drivers" "$target" "viorng" addDriver "$version" "$drivers" "$target" "viorng" || return 1
addDriver "$version" "$drivers" "$target" "viomem" addDriver "$version" "$drivers" "$target" "viostor" || return 1
addDriver "$version" "$drivers" "$target" "viostor" addDriver "$version" "$drivers" "$target" "viomem" || return 1
addDriver "$version" "$drivers" "$target" "NetKVM" addDriver "$version" "$drivers" "$target" "NetKVM" || return 1
addDriver "$version" "$drivers" "$target" "Balloon" addDriver "$version" "$drivers" "$target" "Balloon" || return 1
addDriver "$version" "$drivers" "$target" "vioscsi" addDriver "$version" "$drivers" "$target" "vioscsi" || return 1
addDriver "$version" "$drivers" "$target" "pvpanic" addDriver "$version" "$drivers" "$target" "pvpanic" || return 1
addDriver "$version" "$drivers" "$target" "vioinput" addDriver "$version" "$drivers" "$target" "vioinput" || return 1
addDriver "$version" "$drivers" "$target" "viogpudo" addDriver "$version" "$drivers" "$target" "viogpudo" || return 1
addDriver "$version" "$drivers" "$target" "vioserial" addDriver "$version" "$drivers" "$target" "vioserial" || return 1
addDriver "$version" "$drivers" "$target" "qemupciserial" addDriver "$version" "$drivers" "$target" "qemupciserial" || return 1
case "${version,,}" in case "${version,,}" in
"win11x64"* | "win2025"* ) "win11x64"* | "win2025"* )
# Workaround Virtio GPU driver bug # Workaround Virtio GPU driver bug
local dst="$src/\$OEM\$/\$\$/Drivers" local dst="$src/\$OEM\$/\$\$/Drivers"
mkdir -p "$dst" mkdir -p "$dst" || return 1
! cp -a "$dest/." "$dst" && return 1 cp -Lr "$dest/." "$dst" || return 1
rm -rf "$dest/viogpudo" rm -rf "$dest/viogpudo"
;; ;;
esac esac
@@ -767,36 +770,12 @@ addDrivers() {
return 0 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/OEM"
mkdir -p "$dest"
! cp -a "$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() { updateImage() {
local dir="$1" local dir="$1"
local asset="$2" local asset="$2"
local language="$3" local language="$3"
local tmp="/tmp/install"
local file="autounattend.xml" local file="autounattend.xml"
local org="${file//.xml/.org}" local org="${file//.xml/.org}"
local dat="${file//.xml/.dat}" local dat="${file//.xml/.dat}"
@@ -812,6 +791,9 @@ updateImage() {
fi fi
fi fi
rm -rf "$tmp"
mkdir -p "$tmp"
src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1) src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1)
if [ ! -d "$src" ]; then if [ ! -d "$src" ]; then
@@ -832,25 +814,22 @@ updateImage() {
index="2" index="2"
fi fi
if ! addDrivers "$src" "$wim" "$index" "$DETECTED"; then if ! addDrivers "$src" "$tmp" "$wim" "$index" "$DETECTED"; then
error "Failed to add drivers to image!" && return 1 error "Failed to add drivers to image!"
fi fi
if ! addFolder "$src"; then if ! addFolder "$src"; then
error "Failed to add OEM folder to image!" && return 1 error "Failed to add OEM folder to image!"
fi fi
if wimlib-imagex extract "$wim" "$index" "/$file" "--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" "/$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" "/$org" "--dest-dir=$tmp" >/dev/null 2>&1; then
if ! wimlib-imagex update "$wim" "$index" --command "rename /$file /$org" > /dev/null; then if ! wimlib-imagex update "$wim" "$index" --command "rename /$file /$org" > /dev/null; then
warn "failed to backup original answer file ($file)." warn "failed to backup original answer file ($file)."
fi fi
fi fi
fi fi
rm -f "$TMP/$dat"
rm -f "$TMP/$org"
rm -f "$TMP/$file"
fi fi
if [[ "$MANUAL" != [Yy1]* ]]; then if [[ "$MANUAL" != [Yy1]* ]]; then
@@ -858,7 +837,7 @@ updateImage() {
xml=$(basename "$asset") xml=$(basename "$asset")
info "Adding $xml for automatic installation..." info "Adding $xml for automatic installation..."
local answer="$TMP/$xml" local answer="$tmp/$xml"
cp "$asset" "$answer" cp "$asset" "$answer"
updateXML "$answer" "$language" updateXML "$answer" "$language"
@@ -869,22 +848,18 @@ updateImage() {
wimlib-imagex update "$wim" "$index" --command "add $answer /$dat" > /dev/null || true wimlib-imagex update "$wim" "$index" --command "add $answer /$dat" > /dev/null || true
fi fi
rm -f "$answer"
fi fi
if [[ "$MANUAL" == [Yy1]* ]]; then if [[ "$MANUAL" == [Yy1]* ]]; then
wimlib-imagex update "$wim" "$index" --command "delete --force /$file" > /dev/null || true 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 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 update "$wim" "$index" --command "add $tmp/$org /$file" > /dev/null; then
warn "failed to restore original answer file ($org)." warn "failed to restore original answer file ($org)."
fi fi
fi fi
rm -f "$TMP/$org"
fi fi
local find="$file" local find="$file"
@@ -899,6 +874,7 @@ updateImage() {
fi fi
fi fi
rm -rf "$tmp"
return 0 return 0
} }
@@ -908,7 +884,8 @@ removeImage() {
[ ! -f "$iso" ] && return 0 [ ! -f "$iso" ] && return 0
[ -n "$CUSTOM" ] && 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 return 0
} }
@@ -951,20 +928,20 @@ buildImage() {
if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then 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}" \ 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" -udf -boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -allow-limited-size -quiet "$dir" 2> "$log" || failed="y"
else else
case "${DETECTED,,}" in case "${DETECTED,,}" in
"win2k"* | "winxp"* | "win2003"* ) "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 \ 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" ;; -relaxed-filenames -V "${LABEL::30}" -quiet "$dir" 2> "$log" || failed="y" ;;
"win9"* ) "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}" \ 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" ;; -udf -allow-limited-size -quiet "$dir" 2> "$log" || failed="y" ;;
esac esac
fi fi
@@ -980,7 +957,7 @@ buildImage() {
[ -s "$log" ] && error="$(<"$log")" [ -s "$log" ] && error="$(<"$log")"
[[ "$error" != "$hide" ]] && echo "$error" [[ "$error" != "$hide" ]] && echo "$error"
! mv -f "$out" "$BOOT" && return 1 mv -f "$out" "$BOOT" || return 1
return 0 return 0
} }

View File

@@ -309,7 +309,7 @@ getWindows() {
info "$msg" && html "$msg" info "$msg" && html "$msg"
case "${version,,}" in case "${version,,}" in
"win2008r2" | "win81${PLATFORM,,}-enterprise-eval" | "win11${PLATFORM,,}-enterprise-iot-eval" ) "win2008r2" | "win81${PLATFORM,,}-enterprise"* | "win11${PLATFORM,,}-enterprise-iot"* | "win11${PLATFORM,,}-enterprise-ltsc"* )
if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then
error "No download in the $language language available for $edition!" error "No download in the $language language available for $edition!"
MIDO_URL="" && return 1 MIDO_URL="" && return 1
@@ -317,8 +317,8 @@ getWindows() {
esac esac
case "${version,,}" in case "${version,,}" in
"win11${PLATFORM,,}-enterprise-iot-eval" ) ;; "win11${PLATFORM,,}-enterprise-iot"* ) ;;
"win11${PLATFORM,,}-enterprise-ltsc-eval" ) ;; "win11${PLATFORM,,}-enterprise-ltsc"* ) ;;
* ) * )
if [[ "${PLATFORM,,}" != "x64" ]]; then if [[ "${PLATFORM,,}" != "x64" ]]; then
error "No download for the ${PLATFORM^^} platform available for $edition!" error "No download for the ${PLATFORM^^} platform available for $edition!"
@@ -336,15 +336,56 @@ getWindows() {
"win2025-eval" | "win2022-eval" | "win2019-eval" | "win2016-eval" | "win2012r2-eval" ) "win2025-eval" | "win2022-eval" | "win2019-eval" | "win2016-eval" | "win2012r2-eval" )
download_windows_eval "$version" "$lang" "$edition" && return 0 download_windows_eval "$version" "$lang" "$edition" && return 0
;; ;;
"win81${PLATFORM,,}-enterprise-eval" ) "win81${PLATFORM,,}-enterprise"* | "win2008r2" )
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
;; ;;
* ) error "Invalid VERSION specified, value \"$version\" is not recognized!" ;; * ) error "Invalid VERSION specified, value \"$version\" is not recognized!" ;;
esac esac
if [[ "${PLATFORM,,}" != "x64" ]]; then
MIDO_URL=""
return 1
fi
if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then
MIDO_URL=""
return 1
fi
case "${version,,}" in
"win81${PLATFORM,,}-enterprise"* )
MIDO_URL="https://download.microsoft.com/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X64FREE_EN-US_DV9.ISO"
return 0
;;
"win11${PLATFORM,,}-enterprise-iot"* | "win11${PLATFORM,,}-enterprise-ltsc"* )
MIDO_URL="https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1.240331-1435.ge_release_CLIENT_IOT_LTSC_EVAL_x64FRE_en-us.iso"
return 0
;;
"win2025-eval" )
MIDO_URL="https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1.240331-1435.ge_release_SERVER_EVAL_x64FRE_en-us.iso"
return 0
;;
"win2022-eval" )
MIDO_URL="https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/SERVER_EVAL_x64FRE_en-us.iso"
return 0
;;
"win2019-eval" )
MIDO_URL="https://software-download.microsoft.com/download/pr/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso"
return 0
;;
"win2016-eval" )
MIDO_URL="https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO"
return 0
;;
"win2012r2-eval" )
MIDO_URL="https://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO"
return 0
;;
"win2008r2" )
MIDO_URL="https://download.microsoft.com/download/4/1/D/41DEA7E0-B30D-4012-A1E3-F24DC03BA1BB/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso"
return 0
;;
esac
MIDO_URL="" MIDO_URL=""
return 1 return 1
} }
@@ -551,7 +592,7 @@ downloadFile() {
if [ "$total" -lt 100000000 ]; then if [ "$total" -lt 100000000 ]; then
error "Invalid download link: $url (is only $total bytes?). Please report this at $SUPPORT/issues." && return 1 error "Invalid download link: $url (is only $total bytes?). Please report this at $SUPPORT/issues." && return 1
fi fi
! verifyFile "$iso" "$size" "$total" "$sum" && return 1 verifyFile "$iso" "$size" "$total" "$sum" || return 1
html "Download finished successfully..." && return 0 html "Download finished successfully..." && return 0
fi fi

View File

@@ -14,39 +14,52 @@ if [[ "$DHCP" == [Yy1]* ]]; then
interface="$VM_NET_DEV" interface="$VM_NET_DEV"
fi fi
share="/shared" addShare() {
local dir="$1"
local name="$2"
local comment="$3"
if [ ! -d "$share" ] && [ -d "$STORAGE/shared" ]; then mkdir -p "$dir" || return 1
share="$STORAGE/shared"
fi
mkdir -p "$share" if [ -z "$(ls -A "$dir")" ]; then
if [ -z "$(ls -A "$share")" ]; then chmod 777 "$dir"
chmod 777 "$share" { echo "--------------------------------------------------------"
echo " $APP for Docker v$(</run/version)..."
echo " For support visit $SUPPORT"
echo "--------------------------------------------------------"
echo ""
echo "Using this folder you can share files with the host machine."
echo ""
echo "To change its location, include the following bind mount in your compose file:"
echo ""
echo " volumes:"
echo " - \"/home/example:/${name,,}\""
echo ""
echo "Or in your run command:"
echo ""
echo " -v \"/home/example:/${name,,}\""
echo ""
echo "Replace the example path /home/example with the desired shared folder."
echo ""
} | unix2dos > "$dir/readme.txt"
{ echo "--------------------------------------------------------" fi
echo " $APP for Docker v$(</run/version)..."
echo " For support visit $SUPPORT"
echo "--------------------------------------------------------"
echo ""
echo "Using this folder you can share files with the host machine."
echo ""
echo "To change its location, include the following bind mount in your compose file:"
echo ""
echo " volumes:"
echo " - \"/home/user/example:/shared\""
echo ""
echo "Or in your run command:"
echo ""
echo " -v \"/home/user/example:/shared\""
echo ""
echo "Replace the example path /home/user/example with the desired shared folder."
echo ""
} | unix2dos > "$share/readme.txt"
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 "[global]"
echo " server string = Dockur" echo " server string = Dockur"
@@ -64,17 +77,18 @@ fi
echo " printing = bsd" echo " printing = bsd"
echo " printcap name = /dev/null" echo " printcap name = /dev/null"
echo " disable spoolss = yes" 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" } > "/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"
addShare "$share" "Data" "Shared" || error "Failed to create shared folder!"
[ -d "/data2" ] && addShare "/data2" "Data2" "Shared"
[ -d "/data3" ] && addShare "/data3" "Data3" "Shared"
if ! smbd; then if ! smbd; then
error "Samba daemon failed to start!" error "Samba daemon failed to start!"
smbd -i --debug-stdout || true smbd -i --debug-stdout || true