Windows ISO create error

root@lxd2:/iso# distrobuilder repack-windows Win10_20H2_English_x64.iso Win10_distro.iso --debug
2021-05-18T04:53:00Z INFO distrobuilder/main_repack-windows.go:132 Mounting Windows ISO
2021-05-18T04:53:00Z INFO distrobuilder/main_repack-windows.go:190 Mounting driver ISO
Error: Failed to retrieve wim file information: Failed to run: wimlib-imagex info /var/cache/distrobuilder.189775707/overlay/sources/install.wim: [ERROR] Error reading data from WIM file: Input/output error
ERROR: Exiting with error code 50:
Could not read data from a file

What is the issue? I have installed

sudo snap install distrobuilder --edge --classic
sudo apt install -y libguestfs-tools
apt-get install wimtools

@monstermunchkin is this something you can help with?

Using Ubuntu 20LTS server, LXD 4.14 and snap installed distrobuilder and apt installed libguestfs-tools and wimtools, then ran:

sudo distrobuilder repack-windows Windows.iso Windows-distrobuilder.iso --windows-version w10 --debug

I just got the Windows 10 iso from M$ and had to specify --windows-version w10. I get a similar error, cant read a file, although different error code. Here is the tail of the debug output:

2021-05-19T18:19:14Z	DEBUG	distrobuilder/main_repack-windows.go:566	Updating Windows registry	{"hivefile": "DRIVERS"}
2021-05-19T18:19:14Z	DEBUG	distrobuilder/main_repack-windows.go:573	Updating Windows registry	{"hivefile": "SYSTEM"}
2021-05-19T18:19:15Z	DEBUG	distrobuilder/main_repack-windows.go:580	Updating Windows registry	{"hivefile": "SOFTWARE"}
Error: Failed to retrieve wim file information: Failed to run: wimlib-imagex info /var/cache/distrobuilder.617109801/overlay/sources/install.wim: [ERROR] Can't open "/var/cache/distrobuilder.617109801/overlay/sources/install.wim" read-only: No such file or directory
ERROR: Exiting with error code 47:
       Failed to open a file.

This issue has been reported several times. However, I’m unable to reproduce it, and it’s very unlikely that boot.wim exists but install.wim doesn’t.

What filesystem are you using?

I’ve tried this on both an ext4 partition and on zfs, same result. Ran watch on /var/cache/distrobuilder.*/overlay and it stays empty, no sources folder even. So it appears I am either missing some file(s) using --classic only (didn’t use edge per instructions), or something doesn’t get extracted or copied due to some permissions, but I didn’t see any specific warning or error.

Anything else I can try to debug this?

Created an Ubuntu 20 LTS droplet on DIgitalOcean, to get as clean an install as I could, apt update, apt upgrade, did a snap install of distrobuilder and apt install of requirements.

I then proceeded to try to repack and I got:

sudo distrobuilder repack-windows Windows.iso Windows-repacked.iso --windows-version w10
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.106266254/overlay/sources/install.wim: [ERROR] Can’t open “/var/cache/distrobuilder.106266254/overlay/sources/install.wim” read-only: No such file or directory
ERROR: Exiting with error code 47:
Failed to open a file.

Same thing. Seems pretty easy to replicate, @monstermunchkin ?

@fdion we added a --disable-overlay option to distrobuilder. Would you mind trying running the distrobuilder edge snap with that option? This is just to rule out any issues with overlayfs.

I have this problem
Windows iso files from the media creation tool have install.esd instead of install.wim
I think unless you have Volume Licencing/MSDN/Insider/Academic option then you must use this tool.
So then for these iso files must an intermediate step be performed on a windows machine to convert install.esd → install.wim?
or can distrobuilder be modified to check for this alternative iso

In our experience, the Windows download website gives .iso to anyone who’s not using Windows. There also likely is some kind of way to get a regular .iso while using WIndows (ideally without modifying your browser’ user agent).

Download Windows 10 Disc Image (ISO File) is what I use and on Linux that gets me a direct download link to a .iso which includes install.wim.

I believe you get install.esd when your ISO is effectively hand-assembled locally by that Windows tool. My guess is that this tool then can minimize the needed download by re-using files that you already have on your local system.

Thanks for the reply. You are correct. From a linux desktop the iso is directly available. (win7 and 10 prompt for the tool download only).

In case anyone is interested I got the ‘esd’ iso to install, without distrobuilder, by following default procedure, with the unmodified windows iso

Then added the virt-driver iso as an ide disk by a raw.qemu command similar to here

lxc config edit vm-2
added under
raw.apparmor: /mnt/fs-0/** rwk,
raw.qemu: -drive file=/mnt/fs-0/virtio-win-0.1.185.iso,index=1,media=cdrom,if=ide

Changin wherever the iso is installated and appropriate file permissions.

And then starting the vm; selecting the scsi virtio driver on install etc.