Error: Failed to detect Windows version. Please provide the version using the --windows-version flag
Distrobuilder is unable to detect the Windows version of the ISO. You need to call distrobuilder with the --windows-version flag.
distrobuilder repack-windows --windows-version=<version> <source-iso> <target-iso> where <version> is one of w10 (Windows 10), 2k12 (Windows Server 2012), 2k16 (Windows Server 2016), or 2k19 (Windows Server 2019).
root@lxd1:/# distrobuilder repack-windows --windows-version=w10 path/to/origin/windows.iso path/to/win10.iso
INFO Mounting Windows ISO
INFO Downloading drivers ISO
INFO Mounting driver ISO
INFO Modifying WIM file {“file”: “boot.wim”, “index”: 2}
Error: Failed to retrieve wim file information: Failed to run: wimlib-imagex info /var/cache/distrobuilder.534409939/overlay/sources/install.w im: [ERROR] Can’t open “/var/cache/distrobuilder.534409939/overlay/sources/install.wim” read-only: No such file or directory
ERROR: Exiting with error code 47:
Failed to open a file
root@lxd1:~# wimlib-imagex --version
wimlib-imagex 1.13.1 (using wimlib 1.13.1)
Copyright (C) 2012-2018 Eric Biggers
License GPLv3+; GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
I cannot confirm this issue, but there have been problems with this in the past, if I remember correctly. I’ve proposed a possible fix (see https://github.com/lxc/distrobuilder/pull/426) which might solve the problem.
I know that some folks use the Windows .exe tool to generate the ISO and those ISOs have usually not worked so well. Instead downloading the .iso directly from the website works a lot better.
Could you please try again with the latest edge snap of distrobuilder? Just run snap refresh distrobuilder --channel=latest/edge to update distrobuilder.
I found this usefull.
"
The Windows image repacker depends on: genisoimage, hivexregedit (libwin-hivex-perl), rsync and wimlib-imagex (wimtools). Missing dependencies are detected and reported by distrobuilder on startup.
"
Source: LXD Youtube Chanel.