Hi,

Hit this again and found this thread while searching...

> Shouldn’t specifying -S 0 for qemu-img convert solve the problem?

Doesn't seem to, at least with qemu-img version 7.0.0 
(v7.0.0-11902-g1d935f4a02-dirty)

PS C:\temp> & 'C:\Program Files\qemu\qemu-img.exe' convert -f raw -O vhdx -S 0 
.\jammy-server-cloudimg-amd64.img .\jammy-server-cloudimg-amd64.vhdx

PS C:\temp> fsutil.exe sparse queryFlag .\jammy-server-cloudimg-amd64.vhdx
This file is set as sparse

I've also tried the -S 0 in other places, but this seems to be 'correct' as per 
https://qemu-project.gitlab.io/qemu/tools/qemu-img.html

For anyone else finding this, the command in Windows 10/11 to "fix" the file is 
fsutil.exe sparse setFlag .\jammy-server-cloudimg-amd64.vhdx 0

qemu-img appears to have lost the ability to create old VHD format files, but 
creating a vhd with an older version of qemu-img and using Windows' built in 
Convert-VHD might work, too.

Regards,
Adam

Reply via email to