Forked from bitroniq/Converting-qcow2-to-vmdk-and-vhdx.md
Created
April 27, 2025 16:08
-
-
Save jfbvm/a254f1262ae5a89c9c89e6a89e014f4d to your computer and use it in GitHub Desktop.
Revisions
-
bitroniq revised this gist
Apr 8, 2021 . 1 changed file with 8 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,20 +16,24 @@ qemu-img convert -O vdi ubuntu.qcow2 ubuntu.vdi ``` ### Convert qcow2 to vmdk and make it VMware Workstation Player Compatible ```bash qemu-img convert -f qcow2 -O vmdk ubuntu.qcow2 ubuntu.vmdk ``` ### Convert qcow2 to vmdk and make it ESXi Compatible (doesn't work with VMware Workstation Player) ```bash qemu-img convert -f qcow2 -O vmdk -o subformat=streamOptimized ubuntu.qcow2 ubuntu.vmdk ``` ### Covert for ESXi 6 - Create a VMDK version 6 image (instead of version 4) (doesn't work with VMware Workstation Player) ```bash qemu-img convert -f qcow2 -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 ubuntu.qcow2 ubuntu.vmdk ``` * https://linux.die.net/man/1/qemu-img ### Convert qcow2 to Microsoft Hyper-V new vhdx format -
bitroniq revised this gist
Apr 2, 2021 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,3 @@ ## VM images ## vGateway images extensions -
bitroniq revised this gist
Apr 2, 2021 . 1 changed file with 7 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ https://gist.github.com/bitroniq/59273e85c506175998a384d733b4e155 ## VM images ## vGateway images extensions @@ -10,18 +12,19 @@ ## Example commands Convert qcow2 to other formats ### Convert for VirtualBox (.vdi) ```bash qemu-img convert -O vdi ubuntu.qcow2 ubuntu.vdi ``` ### Convert qcow2 to vmdk and make it VMware Workstation and ESXi Compatible ```bash qemu-img convert -f qcow2 -O vmdk -o subformat=streamOptimized ubuntu.qcow2 ubuntu.vmdk ``` ### Covert for ESXi 6 - Create a VMDK version 6 image (instead of version 4) * https://linux.die.net/man/1/qemu-img -
bitroniq revised this gist
Apr 2, 2021 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ * .qcow2 - KVM type Virtual Machines * .vmdk - VMware and VirtualBox and ESXi * .vdi - VirtualBox * .vhdx - Microsoft Hyper-V * .vhd - Azure requires fixed size @@ -15,6 +16,12 @@ qemu-img convert -f qcow2 -O vmdk -o subformat=streamOptimized ubuntu.qcow2 ubuntu.vmdk ``` ### Convert for VirtualBox (.vdi) ```bash qemu-img convert -O vdi ubuntu.qcow2 ubuntu.vdi ``` ### Covert for ESXi 6 - Create a VMDK version 6 image (instead of version 4) * https://linux.die.net/man/1/qemu-img @@ -40,6 +47,7 @@ qemu-img convert -o subformat=fixed,force_size -O vpc MyLinuxVM.qcow2 MyLinuxVM. ## Example convert.sh script root@aws1-cm-01:~/temp# cat convert.sh ```bash #!/bin/bash -
bitroniq revised this gist
Apr 2, 2021 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,7 +40,6 @@ qemu-img convert -o subformat=fixed,force_size -O vpc MyLinuxVM.qcow2 MyLinuxVM. ## Example convert.sh script ```bash #!/bin/bash -
bitroniq revised this gist
Apr 2, 2021 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,3 @@ ## VM images ## vGateway images extensions -
bitroniq revised this gist
Apr 2, 2021 . 1 changed file with 8 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ https://gist.github.com/bitroniq/59273e85c506175998a384d733b4e155 ## VM images ## vGateway images extensions @@ -7,24 +9,26 @@ * .vhdx - Microsoft Hyper-V * .vhd - Azure requires fixed size ## Example commands Convert qcow2 to other formats ### Convert qcow2 to vmdk and make it VMware Workstation and ESXi Compatible ```bash qemu-img convert -f qcow2 -O vmdk -o subformat=streamOptimized ubuntu.qcow2 ubuntu.vmdk ``` ### Covert for ESXi 6 - Create a VMDK version 6 image (instead of version 4) * https://linux.die.net/man/1/qemu-img ```bash qemu-img convert -f qcow2 -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 ubuntu.qcow2 ubuntu.vmdk ``` ### Convert qcow2 to Microsoft Hyper-V new vhdx format ```bash qemu-img convert -f qcow2 -O vhdx -o subformat=dynamic ubuntu.qcow2 ubuntu.vhdx ``` ### For Azure (VHD images on Azure must have a virtual size aligned to 1 MB.) -
bitroniq revised this gist
Apr 2, 2021 . 1 changed file with 36 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,11 @@ ## VM images ## vGateway images extensions * .qcow2 - KVM type Virtual Machines * .vmdk - VMware and VirtualBox and ESXi * .vhdx - Microsoft Hyper-V * .vhd - Azure requires fixed size ## Example commands Convert qcow2 to vmdk and make it ESXi Compatible @@ -19,8 +20,37 @@ qemu-img convert -f qcow2 -O vmdk -o subformat=streamOptimized ubuntu.qcow2 ubun ```bash qemu-img convert -f qcow2 -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 ubuntu.qcow2 ubuntu.vmdk ``` ## Example commands Convert qcow2 to other formats ```bash qemu-img convert -f qcow2 -O vhdx -o subformat=dynamic ubuntu.qcow2 ubuntu.vmdk ``` ### For Azure (VHD images on Azure must have a virtual size aligned to 1 MB.) * https://docs.microsoft.com/en-us/azure/virtual-machines/linux/create-upload-generic#resizing-vhds ```bash # requires qemu 2.6+ qemu-img convert -o subformat=fixed,force_size -O vpc MyLinuxVM.qcow2 MyLinuxVM.vhd ``` ## Example convert.sh script root@aws1-cm-01:~/temp# cat convert.sh ```bash #!/bin/bash echo "vGateway Name: " read vgwname echo "provide link:" read link curl $link > ${vgwname}.qcow2 echo "Converting..." qemu-img convert \ -f qcow2 \ -O vmdk \ -o subformat=streamOptimized \ ${vgwname}.qcow2 ${vgwname}.vmdk ``` -
bitroniq revised this gist
Mar 31, 2021 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,9 @@ ## VM images * `.qcow2` - KVM type Virtual Machines * `.vmdk` - VMware and VirtualBox and ESXi * `.vhdx` - Microsoft Hyper-V and Azure ## Example commands Convert qcow2 to vmdk and make it ESXi Compatible -
bitroniq revised this gist
Mar 31, 2021 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,14 +8,19 @@ ## Example commands Convert qcow2 to vmdk and make it ESXi Compatible ```bash qemu-img convert -f qcow2 -O vmdk -o subformat=streamOptimized ubuntu.qcow2 ubuntu.vmdk ``` ### For ESXi 6 - Create a VMDK version 6 image (instead of version 4) * https://linux.die.net/man/1/qemu-img ```bash qemu-img convert -f qcow2 -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 ubuntu.qcow2 ubuntu.vmdk ``` ## Example commands Convert qcow2 to vmdk and make it Hyper-V Compatible ```bash qemu-img convert -f qcow2 -O vhdx -o subformat=dynamic ubuntu.qcow2 ubuntu.vmdk ``` -
bitroniq renamed this gist
Mar 31, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
bitroniq created this gist
Mar 31, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ # Converting images with qemu-img convert ## VM images * .qcow2 - KVM type Virtual Machines * .vmdk - VMware and VirtualBox and ESXi * .vhdx - Microsoft Hyper-V and Azure ## Example commands Convert qcow2 to vmdk and make it ESXi Compatible qemu-img convert -f qcow2 -O vmdk -o subformat=streamOptimized ubuntu.qcow2 ubuntu.vmdk ### For ESXi 6 - Create a VMDK version 6 image (instead of version 4) * https://linux.die.net/man/1/qemu-img qemu-img convert -f qcow2 -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 ubuntu.qcow2 ubuntu.vmdk ## Example commands Convert qcow2 to vmdk and make it Hyper-V Compatible qemu-img convert -f qcow2 -O vhdx -o subformat=dynamic ubuntu.qcow2 ubuntu.vmdk