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.