On Oct 26, 2019, at 10:29 PM, Adam Baxter <address@hidden> wrote:
I'm trying to use qemu-img to convert a disk image to VHDX for use on Windows 10's Hyper-V - qemu-img version 4.1.0 (v4.1.0-11789-g013a2ecf4f-dirty)
'C:\Program Files\qemu\qemu-img.exe' convert C:\Users\Adam\Downloads\ubuntu-19.10-minimal-cloudimg-amd64.img -O vhdx -o subformat=fixed C:\Users\Adam\Downloads\ubuntu.vhdx (with or without subformat) results in the following error:
Checkpoint operation for 'New Virtual Machine' failed. (Virtual machine ID D8C746DE-89A4-4373-B330-471055C24F8F)
'New Virtual Machine' cannot create the storage required for the checkpoint using disk C:\Users\Adam\Downloads\ubuntu.vhdx: The requested operation could not be completed due to a virtual disk system limitation. Virtual hard disk files must be uncompressed and unencrypted and must not be sparse. (0xC03A001A). (Virtual machine ID D8C746DE-89A4-4373-B330-471055C24F8F)
Hyper-V doesn't seem to give much more information than that - how would I go about troubleshooting this?
You need to copy the resulting vhdx to a new file, either using the terminal copy command, or using Explorer. Unfortunately this issue has already been reported but not dealt with by anyone. Basically, qemu-img is creating a sparse file, with holes for all the empty sectors in the virtual disk, but Hyper-V doesn’t like this, and rejects the resulting files. You need to use some copy mechanism that will rewrite the image(s) as non-sparse files.
Or, if you know how to compile qemu-img and know what to fix in its source code, you could stop it from trying to write sparse output files.