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 ./src /run/
COPY ./assets /run/assets 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://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 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. - 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? * ### How do I select the Windows version?

View File

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

View File

@@ -46,7 +46,7 @@ else
EXTERNAL="N" EXTERNAL="N"
fi fi
MSG="Please wait while Windows is being started..." MSG="Windows is being started, please wait..."
BASE="custom.iso" BASE="custom.iso"
if [ ! -f "$STORAGE/$BASE" ]; then if [ ! -f "$STORAGE/$BASE" ]; then
@@ -55,7 +55,7 @@ if [ ! -f "$STORAGE/$BASE" ]; then
BASE="$VERSION.iso" BASE="$VERSION.iso"
if [ ! -f "$STORAGE/$BASE" ]; then if [ ! -f "$STORAGE/$BASE" ]; then
MSG="Please wait while Windows is being downloaded..." MSG="Windows is being downloaded, please wait..."
fi fi
else else
@@ -65,14 +65,13 @@ if [ ! -f "$STORAGE/$BASE" ]; then
BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g') BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g')
if [ ! -f "$STORAGE/$BASE" ]; then if [ ! -f "$STORAGE/$BASE" ]; then
MSG="Please wait while '$BASE' is being downloaded..." MSG="Image '$BASE' is being downloaded, please wait..."
fi fi
fi fi
fi fi
# Display wait message html "$MSG"
/run/server.sh "Windows" "$MSG" &
[ -f "$STORAGE/$BASE" ] && return 0 [ -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 echo && error "Invalid ISO file: Size is smaller than 10 MB" && exit 62
fi fi
echo && info "Extracting downloaded ISO image..." MSG="Extracting downloaded ISO image..."
echo && info "$MSG" && html "$MSG"
DIR="$TMP/unpack" DIR="$TMP/unpack"
rm -rf "$DIR" rm -rf "$DIR"
@@ -128,8 +128,20 @@ rm -rf "$DIR"
7z x "$ISO" -o"$DIR" > /dev/null 7z x "$ISO" -o"$DIR" > /dev/null
echo echo
XML=""
FB="falling back to manual installation!" 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 if [ -z "$MANUAL" ]; then
@@ -141,6 +153,8 @@ if [ -z "$MANUAL" ]; then
fi fi
XML=""
if [[ "$MANUAL" != [Yy1]* ]]; then if [[ "$MANUAL" != [Yy1]* ]]; then
if [[ "$EXTERNAL" != [Yy1]* ]]; then if [[ "$EXTERNAL" != [Yy1]* ]]; then
@@ -148,7 +162,8 @@ if [[ "$MANUAL" != [Yy1]* ]]; then
else else
info "Detecting Windows version from ISO image..." MSG="Detecting Windows version from ISO image..."
info "$MSG" && html "$MSG"
LOC="$DIR/sources/install.wim" LOC="$DIR/sources/install.wim"
[ ! -f "$LOC" ] && LOC="$DIR/sources/install.esd" [ ! -f "$LOC" ] && LOC="$DIR/sources/install.esd"
@@ -179,17 +194,17 @@ if [[ "$MANUAL" != [Yy1]* ]]; then
else else
if [ -z "$NAME" ]; then if [ -z "$NAME" ]; then
error "Warning: failed to detect Windows version from image, $FB" warn "failed to detect Windows version from image, $FB"
else else
if [[ "${NAME,,}" == "windows 7" ]]; then if [[ "${NAME,,}" == "windows 7" ]]; then
error "Warning: detected Windows 7 image, $FB" warn "detected Windows 7 image, $FB"
else 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 fi
fi fi
else 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 fi
echo echo
fi fi
@@ -204,7 +219,8 @@ if [ -f "$ASSET" ]; then
if [ -f "$LOC" ]; 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') 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 wimlib-imagex update "$LOC" "$INDEX" --command "add $ASSET /autounattend.xml" > /dev/null
else 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 fi
LOC="$DIR/autounattend.xml" LOC="$DIR/autounattend.xml"
@@ -240,35 +256,27 @@ if [ -f "$ASSET" ]; then
echo echo
else else
[ -n "$XML" ] && error "Warning: XML file '$XML' does not exist, $FB" && echo if [ -n "$XML" ]; then
fi warn "XML file '$XML' does not exist, $FB" && echo
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"
fi fi
else
error "Failed to locate file 'etfsboot.com' in ISO image, $FB"
fi 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" mv "$ISO" "$STORAGE/$BASE"
rm -rf "$TMP" rm -rf "$TMP"
html "Successfully prepared image for installation..."
echo echo
return 0 return 0