Unable To Install Windows From A Local Iso File Despite Specifying In The Compose YAML

by ADMIN 87 views

Introduction

In this article, we will explore the issue of not being able to install Windows from a local ISO file despite specifying it in the compose YAML file. We will delve into the details of the problem, provide a step-by-step guide to reproduce the issue, and offer potential solutions to resolve the problem.

Operating System

The operating system used in this scenario is Fedora 41.

Docker Compose

The Docker compose file used in this scenario is as follows:

# For documentation, FAQ, additional configuration options and technical help, visit: https://github.com/dockur/windows

name: "WindowsContainer" # Docker Compose Project Name.
volumes:
  # Create Volume 'data'.
  # Located @ '/var/lib/docker/volumes/winapps_data/_data' (Docker).
  # Located @ '/var/lib/containers/storage/volumes/winapps_data/_data' or '~/.local/share/containers/storage/volumes/winapps_data/_data' (Podman).
  data:
services:
  windows:
    image: ghcr.io/dockur/windows:latest
    container_name: WindowsContainer # Created Docker VM Name.
    environment:
      # Version of Windows to configure. For valid options, visit:
      # https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-select-the-windows-version
      # https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-install-a-custom-image
      VERSION: "11"
      RAM_SIZE: "8G" # RAM allocated to the Windows VM.
      CPU_CORES: "4" # CPU cores allocated to the Windows VM.
      DISK_SIZE: "64G" # Size of the primary hard disk.
      #DISK2_SIZE: "32G" # Uncomment to add an additional hard disk to the Windows VM. Ensure it is mounted as a volume below.
      USERNAME: "notrealusername" # Edit here to set a custom Windows username. The default is 'MyWindowsUser'.
      PASSWORD: "notrealpassword" # Edit here to set a password for the Windows user. The default is 'MyWindowsPassword'.
      HOME: "${HOME}" # Set path to Linux user home folder.
    ports:
      - 8006:8006 # Map '8006' on Linux host to '8006' on Windows VM --> For VNC Web Interface @ http://127.0.0.1:8006.
      - 3389:3389/tcp # Map '3389' on Linux host to '3389' on Windows VM --> For Remote Desktop Protocol (RDP).
      - 3389:3389/udp # Map '3389' on Linux host to '3389' on Windows VM --> For Remote Desktop Protocol (RDP).
    cap_add:
      - NET_ADMIN # Add network permission
    stop_grace_period: 60s # Wait 60 seconds before sending SIGTERM when attempting to shut down the Windows VM.
    restart: on-failure # Restart the Windows VM if the exit code indicates an error.
    volumes:
      - data:/storage # Mount volume 'data' to use as Windows 'C:' drive.
      - ${HOME}:/shared # Mount Linux home directory @ '\\host.lan\Data'.
      #- /path/to/second/hard/disk:/storage2 # Uncomment to mount the second hard disk within the Windows VM. Ensure 'DISK2_SIZE' is specified above.
      - ./oem:/oem # Enables automatic post-install execution of 'oem/install.bat', applying Windows registry modifications contained within 'oem/RDPApps.reg'.
      - ${HOME}/Downloads/Win11_24H2_English_x64.iso:/custom.iso # Uncomment to use a custom Windows ISO. If specified, 'VERSION' (e.g. 'tiny11') will be ignored.\

    devices:
      - /dev/kvm # Enable KVM.
      - /dev/net/tun # Enable tuntap
      #- /dev/sdX:/disk1 # Uncomment to mount a disk directly within the Windows VM (Note: 'disk1' will be mounted as the main drive. THIS DISK WILL BE FORMATTED BY DOCKER).
      ###Test to mount happiness drive
      #- /dev/sdY:/disk2 # Uncomment to mount a disk directly within the Windows VM (Note: 'disk2' and higher will be mounted as secondary drives. THIS DISK WILL NOT BE FORMATTED).
    sysctls:
      - net.ipv4.ip_forward=1

Docker Log

The Docker log output is as follows:

john@fedora:~/dev$ podman compose --file ./composeTest.yaml up
>>>> Executing external compose provider "/usr/bin/podman-compose". Please see podman-compose(1) for how to disable this message. <<<<

534e8d9285ebaecf52ea10faa9e243abb5249d16baf5607d36cb613e7ba0034c
1f496c54efa7aa3df5c43b5781e10640e4f0d8831b07a0629e63357e4642f1f7
[windows] | ❯ Starting Windows for Docker v4.34...
[windows] | ❯ For support visit https://github.com/dockur/windows
[windows] | ❯ CPU: Intel Core i7 11850H | RAM: 55/63 GB | DISK: 893 GB (btrfs) | KERNEL: 6.13.11-200.fc41.x86_64...
[windows] | 
[windows] | ❯ Warning: you are using the BTRFS filesystem for /storage, this might introduce issues with Windows Setup!
[windows] | ❯ Requesting Windows 11 from the Microsoft servers...

Problem

The problem is that the container is downloading Windows instead of getting it from the specified ISO file from the local volume as specified in the volume from the compose YAML.

Cause

The cause of this problem is that the VERSION environment variable is set to "11", which is not a valid option for the ghcr.io/dockur/windows:latest image. This causes the container to download Windows instead of using the specified ISO file.

Solution

To resolve this problem, you need to set the VERSION environment variable to a valid option, such as "tiny11". You also need to uncomment the line that specifies the custom Windows ISO file, and update the VERSION environment variable to "custom".

is the updated compose YAML file:

# For documentation, FAQ, additional configuration options and technical help, visit: https://github.com/dockur/windows

name: "WindowsContainer" # Docker Compose Project Name.
volumes:
  # Create Volume 'data'.
  # Located @ '/var/lib/docker/volumes/winapps_data/_data' (Docker).
  # Located @ '/var/lib/containers/storage/volumes/winapps_data/_data' or '~/.local/share/containers/storage/volumes/winapps_data/_data' (Podman).
  data:
services:
  windows:
    image: ghcr.io/dockur/windows:latest
    container_name: WindowsContainer # Created Docker VM Name.
    environment:
      # Version of Windows to configure. For valid options, visit:
      # https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-select-the-windows-version
      # https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-install-a-custom-image
      VERSION: "custom"
      RAM_SIZE: "8G" # RAM allocated to the Windows VM.
      CPU_CORES: "4" # CPU cores allocated to the Windows VM.
      DISK_SIZE: "64G" # Size of the primary hard disk.
      #DISK2_SIZE: "32G" # Uncomment to add an additional hard disk to the Windows VM. Ensure it is mounted as a volume below.
      USERNAME: "notrealusername" # Edit here to set a custom Windows username. The default is 'MyWindowsUser'.
      PASSWORD: "notrealpassword" # Edit here to set a password for the Windows user. The default is 'MyWindowsPassword'.
      HOME: "${HOME}" # Set path to Linux user home folder.
    ports:
      - 8006:8006 # Map '8006' on Linux host to '8006' on Windows VM --> For VNC Web Interface @ http://127.0.0.1:8006.
      - 3389:3389/tcp # Map '3389' on Linux host to '3389' on Windows VM --> For Remote Desktop Protocol (RDP).
      - 3389:3389/udp # Map '3389' on Linux host to '3389' on Windows VM --> For Remote Desktop Protocol (RDP).
    cap_add:
      - NET_ADMIN # Add network permission
    stop_grace_period: 60s # Wait 60 seconds before sending SIGTERM when attempting to shut down the Windows VM.
    restart: on-failure # Restart the Windows VM if the exit code indicates an error.
    volumes:
      - data:/storage # Mount volume 'data' to use as Windows 'C:' drive.
      - ${HOME}:/shared # Mount Linux user home directory @ '\\host.lan\Data'.
      #- /path/to/second/hard/disk:/storage2 # Uncomment to mount the second hard disk within the Windows<br/>
**Q&A: Unable to Install Windows from a Local ISO File Despite Specifying in the Compose YAML**
====================================================================================

**Q: What is the issue with installing Windows from a local ISO file despite specifying it in the compose YAML?**
-----------------------------------------------------------------------------------------

A: The issue is that the container is downloading Windows instead of getting it from the specified ISO file from the local volume as specified in the volume from the compose YAML.

**Q: What is the cause of this problem?**
-----------------------------------------

A: The cause of this problem is that the `VERSION` environment variable is set to `"11"`, which is not a valid option for the `ghcr.io/dockur/windows:latest` image. This causes the container to download Windows instead of using the specified ISO file.

**Q: How can I resolve this problem?**
-----------------------------------------

A: To resolve this problem, you need to set the `VERSION` environment variable to a valid option, such as `"tiny11"`. You also need to uncomment the line that specifies the custom Windows ISO file, and update the `VERSION` environment variable to `"custom"`.

**Q: What is the updated compose YAML file that I need to use?**
---------------------------------------------------------

A: The updated compose YAML file is as follows:

```yml
# For documentation, FAQ, additional configuration options and technical help, visit: https://github.com/dockur/windows

name: "WindowsContainer" # Docker Compose Project Name.
volumes:
  # Create Volume 'data'.
  # Located @ '/var/lib/docker/volumes/winapps_data/_data' (Docker).
  # Located @ '/var/lib/containers/storage/volumes/winapps_data/_data' or '~/.local/share/containers/storage/volumes/winapps_data/_data' (Podman).
  data:
services:
  windows:
    image: ghcr.io/dockur/windows:latest
    container_name: WindowsContainer # Created Docker VM Name.
    environment:
      # Version of Windows to configure. For valid options, visit:
      # https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-select-the-windows-version
      # https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-install-a-custom-image
      VERSION: "custom"
      RAM_SIZE: "8G" # RAM allocated to the Windows VM.
      CPU_CORES: "4" # CPU cores allocated to the Windows VM.
      DISK_SIZE: "64G" # Size of the primary hard disk.
      #DISK2_SIZE: "32G" # Uncomment to add an additional hard disk to the Windows VM. Ensure it is mounted as a volume below.
      USERNAME: "notrealusername" # Edit here to set a custom Windows username. The default is 'MyWindowsUser'.
      PASSWORD: "notrealpassword" # Edit here to set a password for the Windows user. The default is 'MyWindowsPassword'.
      HOME: "${HOME}" # Set path to Linux user home folder.
    ports:
      - 8006:8006 # Map '8006' on Linux host to '8006' on Windows VM --> For VNC Web Interface @ http://127.0.0.1:8006.
      - 3389:3389/tcp # Map '3389' on Linux host to '3389 on Windows VM --> For Remote Desktop Protocol (RDP).
      - 3389:3389/udp # Map '3389' on Linux host to '3389' on Windows VM --> For Remote Desktop Protocol (RDP).
    cap_add:
      - NET_ADMIN # Add network permission
    stop_grace_period: 60s # Wait 60 seconds before sending SIGTERM when attempting to shut down the Windows VM.
    restart: on-failure # Restart the Windows VM if the exit code indicates an error.
    volumes:
      - data:/storage # Mount volume 'data' to use as Windows 'C:' drive.
      - ${HOME}:/shared # Mount Linux user home directory @ '\\host.lan\Data'.
      #- /path/to/second/hard/disk:/storage2 # Uncomment to mount the second hard disk within the Windows VM. Ensure 'DISK2_SIZE' is specified above.
      - ./oem:/oem # Enables automatic post-install execution of 'oem/install.bat', applying Windows registry modifications contained within 'oem/RDPApps.reg'.
      - ${HOME}/Downloads/Win11_24H2_English_x64.iso:/custom.iso # Uncomment to use a custom Windows ISO. If specified, 'VERSION' (e.g. 'tiny11') will be ignored.\

    devices:
      - /dev/kvm # Enable KVM.
      - /dev/net/tun # Enable tuntap
      #- /dev/sdX:/disk1 # Uncomment to mount a disk directly within the Windows VM (Note: 'disk1' will be mounted as the main drive. THIS DISK WILL BE FORMATTED BY DOCKER).
      ###Test to mount happiness drive
      #- /dev/sdY:/disk2 # Uncomment to mount a disk directly within the Windows VM (Note: 'disk2' and higher will be mounted as secondary drives. THIS DISK WILL NOT BE FORMATTED).
    sysctls:
      - net.ipv4.ip_forward=1

Q: What are the benefits of using a custom Windows ISO file?

A: The benefits of using a custom Windows ISO file are:

  • You can use a specific version of Windows that is not available in the ghcr.io/dockur/windows:latest image.
  • You can customize the Windows installation by modifying the registry and installing additional software.
  • You can use a Windows ISO file that is not publicly available.

Q: How can I troubleshoot issues with installing Windows from a local ISO file?

A: To troubleshoot issues with installing Windows from a local ISO file, you can:

  • Check the Docker logs for errors.
  • Verify that the VERSION environment variable is set correctly.
  • Ensure that the custom Windows ISO file is in the correct location.
  • Try using a different version of Windows or a different ISO file.

Q: What are some common issues that can occur when installing Windows from a local ISO file?

A: Some common issues that can occur when installing Windows from a local ISO file are:

  • The container is unable to download the Windows ISO file.
  • The container is unable to install Windows from the ISO file.
  • The container is unable to mount the Windows ISO file as a volume.
  • The container is unable to access the Windows installation media.

Q: How can I issues with installing Windows from a local ISO file?

A: To prevent issues with installing Windows from a local ISO file, you can:

  • Verify that the VERSION environment variable is set correctly.
  • Ensure that the custom Windows ISO file is in the correct location.
  • Try using a different version of Windows or a different ISO file.
  • Check the Docker logs for errors.
  • Ensure that the container has the necessary permissions to access the Windows installation media.