diff --git a/Dockerfile b/Dockerfile index ae17da2..5360ad1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ARG VERSION_ARG="latest" FROM scratch AS build-amd64 -COPY --from=qemux/qemu:6.22 / / +COPY --from=qemux/qemu:7.00 / / ARG DEBCONF_NOWARNINGS="yes" ARG DEBIAN_FRONTEND="noninteractive" diff --git a/readme.md b/readme.md index 9492054..880675d 100644 --- a/readme.md +++ b/readme.md @@ -396,6 +396,10 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas You can use [dockur/macos](https://github.com/dockur/macos) for that. It shares many of the same features, except for the automatic installation. +### How do I run a Linux desktop in a container? + + You can use [qemus/qemu](https://github.com/qemus/qemu) in that case. + ### Is this project legal? Yes, this project contains only open-source code and does not distribute any copyrighted material. Any product keys found in the code are just generic placeholders provided by Microsoft for trial purposes. So under all applicable laws, this project will be considered legal. diff --git a/src/install.sh b/src/install.sh index 003b302..1ff6a0e 100644 --- a/src/install.sh +++ b/src/install.sh @@ -250,12 +250,12 @@ extractESD() { mkdir -p "$dir" size=16106127360 - size_gb=$(( (size + 1073741823)/1073741824 )) + size_gb=$(formatBytes "$size") space=$(df --output=avail -B 1 "$dir" | tail -n 1) - space_gb=$(( (space + 1073741823)/1073741824 )) + space_gb=$(formatBytes "$space") if (( size > space )); then - error "Not enough free space in $STORAGE, have $space_gb GB available but need at least $size_gb GB." && return 1 + error "Not enough free space in $STORAGE, have $space_gb available but need at least $size_gb." && return 1 fi local esdImageCount @@ -341,16 +341,16 @@ extractImage() { mkdir -p "$dir" size=$(stat -c%s "$iso") - size_gb=$(( (size + 1073741823)/1073741824 )) + size_gb=$(formatBytes "$size") space=$(df --output=avail -B 1 "$dir" | tail -n 1) - space_gb=$(( (space + 1073741823)/1073741824 )) + space_gb=$(formatBytes "$space") if ((size<100000000)); then error "Invalid ISO file: Size is smaller than 100 MB" && return 1 fi if (( size > space )); then - error "Not enough free space in $STORAGE, have $space_gb GB available but need at least $size_gb GB." && return 1 + error "Not enough free space in $STORAGE, have $space_gb available but need at least $size_gb." && return 1 fi rm -rf "$dir" @@ -953,12 +953,12 @@ buildImage() { fi size=$(du -h -b --max-depth=0 "$dir" | cut -f1) - size_gb=$(( (size + 1073741823)/1073741824 )) + size_gb=$(formatBytes "$size") space=$(df --output=avail -B 1 "$TMP" | tail -n 1) - space_gb=$(( (space + 1073741823)/1073741824 )) + space_gb=$(formatBytes "$space") if (( size > space )); then - error "Not enough free space in $STORAGE, have $space_gb GB available but need at least $size_gb GB." && return 1 + error "Not enough free space in $STORAGE, have $space_gb available but need at least $size_gb." && return 1 fi if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then diff --git a/src/mido.sh b/src/mido.sh index df6d147..bbaa5c2 100644 --- a/src/mido.sh +++ b/src/mido.sh @@ -516,14 +516,15 @@ downloadFile() { local size="$4" local lang="$5" local desc="$6" - local rc total progress domain dots space folder + local rc total total_gb progress domain dots space folder rm -f "$iso" if [ -n "$size" ] && [[ "$size" != "0" ]]; then folder=$(dirname -- "$iso") space=$(df --output=avail -B 1 "$folder" | tail -n 1) - (( size > space )) && error "Not enough free space left to download file!" && return 1 + total_gb=$(formatBytes "$space") + (( size > space )) && error "Not enough free space to download file, only $total_gb left!" && return 1 fi # Check if running with interactive TTY or redirected to docker log @@ -553,8 +554,9 @@ downloadFile() { if (( rc == 0 )) && [ -f "$iso" ]; then total=$(stat -c%s "$iso") + total_gb=$(formatBytes "$total") 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_gb ?). Please report this at $SUPPORT/issues." && return 1 fi verifyFile "$iso" "$size" "$total" "$sum" || return 1 html "Download finished successfully..." && return 0