Convert Proxmox .raw to HyperV .vhdx

Show raw device names

zfs list 
#example output may look something like this
rpool/data/vm-100-disk-1

Export to file

dd if=/dev/zvol/rpool/data/vm-100-disk-1 of=/file.raw

Convert to HyperV

qemu-img convert -f raw /file.raw -O vhdx -o subformat=dynamic /file.vhdx

Mount file.vhdx on HyperV and start

One liner method:

Forget about the export and feed the raw device directly to qemu-img

qemu-img convert -f raw /dev/zvol/rpool/data/vm-100-disk-1 -O vhdx -o subformat=dynamic /file.vhdx

 

2 thoughts on “Convert Proxmox .raw to HyperV .vhdx”

  1. Note to show progress bar you can use -p for qemu-img convert command like:

    qemu-img convert -p -f raw /dev/zvol/rpool/data/vm-100-disk-1 -O vhdx -o subformat=dynamic /file.vhdx

    And you can do the same for dd by appending “status=progress” at the end.

    dd if=/dev/zvol/rpool/data/vm-100-disk-1 of=/file.raw status=progress

Leave a Reply

Your email address will not be published. Required fields are marked *