Compare commits

..

4 Commits
v1.06 ... v1.08

Author SHA1 Message Date
Kroese
accd1799d2 feat: Display progress via web (#61) 2024-01-20 17:03:59 +01:00
Kroese
6566d249fc feat: Use Virtiso image for drivers (#59) 2024-01-19 21:29:03 +01:00
Kroese
a2cc998c60 feat: Show warnings (#58) 2024-01-19 15:18:56 +01:00
Kroese
6e24a2ae51 docs: Readme (#57) 2024-01-19 08:12:16 +01:00
4 changed files with 53 additions and 49 deletions

View File

@@ -16,8 +16,8 @@ RUN apt-get update \
COPY ./src /run/
COPY ./assets /run/assets
ADD https://github.com/qemus/virtiso/raw/master/virtio-win.iso /run/drivers.iso
ADD https://raw.githubusercontent.com/ElliotKillick/Mido/main/Mido.sh /run/mido.sh
ADD https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso /run/drivers.iso
RUN chmod +x /run/*.sh

View File

@@ -60,7 +60,9 @@ docker run -it --rm -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN dockurr/w
- Sit back and relax while the magic happens, the whole installation will be performed fully automatic.
- Once you see the desktop, your Windows installation is ready for use. Enjoy it, and don't forget to star this repo!
- Once you see the desktop, your Windows installation is ready for use.
- Enjoy your brand new machine, and don't forget to star this repo!
* ### How do I select the Windows version?

View File

@@ -1,11 +1,9 @@
#!/usr/bin/env bash
set -Eeuo pipefail
echo " Starting Windows for Docker v$(</run/version)..."
echo " For support visit https://github.com/dockur/windows"
echo
APP="Windows"
export BOOT_MODE=windows
SUPPORT="https://github.com/dockur/windows"
cd /run
@@ -20,11 +18,7 @@ cd /run
trap - ERR
if [[ "${DISPLAY,,}" == "web" ]]; then
nginx -e stderr
fi
echo && info "Booting Windows using $VERS..."
info "Booting $APP using $VERS..."
[[ "$DEBUG" == [Yy1]* ]] && set -x
exec qemu-system-x86_64 ${ARGS:+ $ARGS}

View File

@@ -46,7 +46,7 @@ else
EXTERNAL="N"
fi
MSG="Please wait while Windows is being started..."
MSG="Windows is being started, please wait..."
BASE="custom.iso"
if [ ! -f "$STORAGE/$BASE" ]; then
@@ -55,7 +55,7 @@ if [ ! -f "$STORAGE/$BASE" ]; then
BASE="$VERSION.iso"
if [ ! -f "$STORAGE/$BASE" ]; then
MSG="Please wait while Windows is being downloaded..."
MSG="Windows is being downloaded, please wait..."
fi
else
@@ -65,14 +65,13 @@ if [ ! -f "$STORAGE/$BASE" ]; then
BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g')
if [ ! -f "$STORAGE/$BASE" ]; then
MSG="Please wait while '$BASE' is being downloaded..."
MSG="Image '$BASE' is being downloaded, please wait..."
fi
fi
fi
# Display wait message
/run/server.sh "Windows" "$MSG" &
html "$MSG"
[ -f "$STORAGE/$BASE" ] && return 0
@@ -120,7 +119,8 @@ if ((SIZE<10000000)); then
echo && error "Invalid ISO file: Size is smaller than 10 MB" && exit 62
fi
echo && info "Extracting downloaded ISO image..."
MSG="Extracting downloaded ISO image..."
echo && info "$MSG" && html "$MSG"
DIR="$TMP/unpack"
rm -rf "$DIR"
@@ -128,8 +128,20 @@ rm -rf "$DIR"
7z x "$ISO" -o"$DIR" > /dev/null
echo
XML=""
FB="falling back to manual installation!"
ETFS="boot/etfsboot.com"
EFISYS="efi/microsoft/boot/efisys_noprompt.bin"
if [ ! -f "$DIR/$ETFS" ] || [ ! -f "$DIR/$EFISYS" ]; then
if [ ! -f "$DIR/$ETFS" ]; then
warn "failed to locate file 'etfsboot.com' in ISO image, $FB"
else
warn "failed to locate file 'efisys_noprompt.bin' in ISO image, $FB"
fi
mv "$ISO" "$STORAGE/$BASE"
rm -rf "$TMP"
echo && return 0
fi
if [ -z "$MANUAL" ]; then
@@ -141,6 +153,8 @@ if [ -z "$MANUAL" ]; then
fi
XML=""
if [[ "$MANUAL" != [Yy1]* ]]; then
if [[ "$EXTERNAL" != [Yy1]* ]]; then
@@ -148,7 +162,8 @@ if [[ "$MANUAL" != [Yy1]* ]]; then
else
info "Detecting Windows version from ISO image..."
MSG="Detecting Windows version from ISO image..."
info "$MSG" && html "$MSG"
LOC="$DIR/sources/install.wim"
[ ! -f "$LOC" ] && LOC="$DIR/sources/install.esd"
@@ -179,17 +194,17 @@ if [[ "$MANUAL" != [Yy1]* ]]; then
else
if [ -z "$NAME" ]; then
error "Warning: failed to detect Windows version from image, $FB"
warn "failed to detect Windows version from image, $FB"
else
if [[ "${NAME,,}" == "windows 7" ]]; then
error "Warning: detected Windows 7 image, $FB"
warn "detected Windows 7 image, $FB"
else
error "Warning: failed to detect Windows version from string '$NAME', $FB"
warn "failed to detect Windows version from string '$NAME', $FB"
fi
fi
fi
else
error "Warning: failed to locate 'install.wim' or 'install.esd' in ISO image, $FB"
warn "failed to locate 'install.wim' or 'install.esd' in ISO image, $FB"
fi
echo
fi
@@ -204,7 +219,8 @@ if [ -f "$ASSET" ]; then
if [ -f "$LOC" ]; then
info "Adding XML file for automatic installation..."
MSG="Adding XML file for automatic installation..."
info "$MSG" && html "$MSG"
RESULT=$(wimlib-imagex info -xml "$LOC" | tr -d '\000')
@@ -217,7 +233,7 @@ if [ -f "$ASSET" ]; then
wimlib-imagex update "$LOC" "$INDEX" --command "add $ASSET /autounattend.xml" > /dev/null
else
error "Warning: failed to locate 'boot.wim' or 'boot.esd' in ISO image, $FB"
warn "failed to locate 'boot.wim' or 'boot.esd' in ISO image, $FB"
fi
LOC="$DIR/autounattend.xml"
@@ -240,35 +256,27 @@ if [ -f "$ASSET" ]; then
echo
else
[ -n "$XML" ] && error "Warning: XML file '$XML' does not exist, $FB" && echo
fi
ETFS="boot/etfsboot.com"
EFISYS="efi/microsoft/boot/efisys_noprompt.bin"
if [ -f "$DIR/$ETFS" ]; then
if [ -f "$DIR/$EFISYS" ]; then
CAT="BOOT.CAT"
LABEL="${BASE%.*}"
LABEL="${LABEL::32}"
ISO="$TMP/$LABEL.tmp"
rm -f "$ISO"
info "Generating new ISO image for installation..."
genisoimage -b "$ETFS" -no-emul-boot -c "$CAT" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -quiet -V "$LABEL" -udf \
-boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -o "$ISO" -allow-limited-size "$DIR"
else
error "Failed to locate file 'efisys_noprompt.bin' in ISO image, $FB"
if [ -n "$XML" ]; then
warn "XML file '$XML' does not exist, $FB" && echo
fi
else
error "Failed to locate file 'etfsboot.com' in ISO image, $FB"
fi
CAT="BOOT.CAT"
LABEL="${BASE%.*}"
LABEL="${LABEL::30}"
ISO="$TMP/$LABEL.tmp"
rm -f "$ISO"
MSG="Generating new ISO image for installation..."
info "$MSG" && html "$MSG"
genisoimage -b "$ETFS" -no-emul-boot -c "$CAT" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -quiet -V "$LABEL" -udf \
-boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -o "$ISO" -allow-limited-size "$DIR"
mv "$ISO" "$STORAGE/$BASE"
rm -rf "$TMP"
html "Successfully prepared image for installation..."
echo
return 0