> For the complete documentation index, see [llms.txt](https://book.konstantinsecurity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.konstantinsecurity.com/readme/architect/vm/create-a-vhd-file-from-a-linux-disk.md).

# Create a VHD file from a Linux disk

<https://serverfault.com/questions/682322/create-a-vhd-file-from-a-linux-disk>

Convert in Windows a RAW PhysicalDrive2 to VHD qemu-img.exe convert -f raw -O vpc \\.\PhysicalDrive2 CentOS-5-8.vhd Convert in Linux a RAW sdb to QCOW2 qemu-img convert -f raw -O qcow2 /dev/sdb fitsu\_MKB3021LT.qcow2 Convert a QCOW2, RAW, VMDK or VDI image to VHDX qemu-img.exe convert source.img -O vhdx -o subformat=dynamic dest.vhdx Convert a QCOW2, RAW, VMDK or VDI image to VHD qemu-img.exe convert source.img -O vpc -o subformat=dynamic dest.vhd
