In a Docker container I'm creating a full PC Linux image from scratch (using debootstrap and lots of other tools).
At the end of the process I'm using qemu-img convert -f raw -O vdi infile.raw outfile.vdi to generate a image file suitable for VirtualBox.
That works in essence - the disk boots inside VirtualBox.
However, when creating a new image and replacing outfile.vdi (of course with the VM powered off), then VirtualBox complains that the disk image is not okay because the UUID does not match the one stored in the VirtualBox media registry.
I am forced to remove and add the file again in the VM settings using the VirtualBox GUI so that I can start the VM again.
I guess there is some (random) UUID stored directly in the .vdi file, but I could not find a way to manually specify a fixed UUID with qemu-img.
How can I solve this problem? Perhaps another VirtualBox-compatible disk format would work better?
In case it matters: This all happens under a Windows host