{"id":178,"date":"2018-01-23T06:09:45","date_gmt":"2018-01-23T06:09:45","guid":{"rendered":"http:\/\/zewwy.ca\/?p=178"},"modified":"2020-06-12T18:15:41","modified_gmt":"2020-06-12T23:15:41","slug":"lame-mans-v2v","status":"publish","type":"post","link":"https:\/\/zewwy.ca\/index.php\/2018\/01\/23\/lame-mans-v2v\/","title":{"rendered":"Lame mans V2V"},"content":{"rendered":"<h1 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Quick_V2Vs\"><\/span><strong>Quick V2V&#8217;s<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h1><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_77 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-black ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/zewwy.ca\/index.php\/2018\/01\/23\/lame-mans-v2v\/#Quick_V2Vs\" >Quick V2V&#8217;s<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/zewwy.ca\/index.php\/2018\/01\/23\/lame-mans-v2v\/#VMDK_to_VHDX\" >VMDK to VHDX<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/zewwy.ca\/index.php\/2018\/01\/23\/lame-mans-v2v\/#VHDX_to_VMDK\" >VHDX to VMDK<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/zewwy.ca\/index.php\/2018\/01\/23\/lame-mans-v2v\/#Using_qemu-img_in_Linux\" >Using qemu-img in Linux<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/zewwy.ca\/index.php\/2018\/01\/23\/lame-mans-v2v\/#Check_the_VHDX_file\" >Check the VHDX file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/zewwy.ca\/index.php\/2018\/01\/23\/lame-mans-v2v\/#Convert_VHD_to_VMDK_in_Linux\" >Convert VHD to VMDK in Linux<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/zewwy.ca\/index.php\/2018\/01\/23\/lame-mans-v2v\/#Using_qemu-img_in_Windows\" >Using qemu-img in Windows<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/zewwy.ca\/index.php\/2018\/01\/23\/lame-mans-v2v\/#Convert_VHD_to_VMDK_in_Windows\" >Convert VHD to VMDK in Windows<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>There are multiple ways to do a V2V depending on your migration\/conversion.<\/p>\n<p>See <a href=\"https:\/\/www.nakivo.com\/blog\/how-to-convert-vhd-to-vmdk-a-step-by-step-guide\/\">here<\/a>, <a href=\"http:\/\/www.vmwarearena.com\/top-3-free-tools-to-convert-vhd-to-vmdk\/\">here<\/a> and <a href=\"http:\/\/www.vmwarearena.com\/vmware-vcenter-converter-standalone\/\">here<\/a> for some source examples and more in depth reviews of alternative tools\/products, or even <a href=\"https:\/\/sourceforge.net\/projects\/vmdk2phys\/\">V2P<\/a> as unlikely as that maybe \ud83d\ude1b<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"VMDK_to_VHDX\"><\/span><strong>VMDK to VHDX<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This one will be short n sweet.<br \/>\nV2V a VMDK to a VHDX<\/p>\n<p>Get this.<\/p>\n<p>DO this:<\/p>\n<p>Import-Module &#8216;C:\\Program Files\\Microsoft Virtual Machine Converter\\MvmcCmdlet.psd1&#8217;<\/p>\n<p>ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath (Drive):\\VM-disk1.vmdk -VhdType DynamicHardDisk -VhdFormat vhdx -destination (Drive):\\vm-disk1<\/p>\n<p>This was nice, but after a good amount of time, I realized I don&#8217;t like using Hyper-V much&#8230;. so how do you convert back from VHDX to a VMDK?<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"VHDX_to_VMDK\"><\/span><strong>VHDX to VMDK<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>I used Linux open source tool;<\/p>\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Using_qemu-img_in_Linux\"><\/span><strong>Using qemu-img in Linux<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Ubuntu Linux is used in this example for running <em>qemu-img<\/em>.<\/p>\n<p>First, install <em>qemu-img<\/em> from the online software repositories:<\/p>\n<p><strong>sudo apt-get install qemu-utils<\/strong><\/p>\n<p>*Note if using Ubuntu live you will need to enable the community (*Universe) repository (outside the scope of this post)<\/p>\n<p>Go to the directory where virtual disk images are stored (in this example VHD and VHDX virtual disk files are stored in <em>\/media\/user1\/data\/<\/em>):<\/p>\n<p><strong>cd \/media\/user1\/data\/<\/strong><\/p>\n<h4><span class=\"ez-toc-section\" id=\"Check_the_VHDX_file\"><\/span><strong>Check the VHDX file<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Get the root privileges (with  the <strong>sudo su <\/strong>command) and view the VHD image information:<\/p>\n<p><strong>qemu-img info test-disk.vhd<\/strong><\/p>\n<p><a href=\"https:\/\/www.nakivo.com\/blog\/wp-content\/uploads\/2020\/01\/How-to-convert-VHD-to-VMDK-with-qemu-img-%E2%80%93-checking-the-VHD-info.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4064 size-full\" src=\"https:\/\/www.nakivo.com\/blog\/wp-content\/uploads\/2020\/01\/How-to-convert-VHD-to-VMDK-with-qemu-img-%E2%80%93-checking-the-VHD-info.png\" alt=\"How to convert VHD to VMDK with qemu-img \u2013 checking the VHD info\" width=\"553\" height=\"168\" \/><\/a><\/p>\n<p>Similarly, you can check the information about the VHDX virtual disk:<\/p>\n<p><strong>qemu-img info \/media\/user1\/data\/WinServer2016.vhdx<\/strong><\/p>\n<p><a href=\"https:\/\/www.nakivo.com\/blog\/wp-content\/uploads\/2020\/01\/Check-the-VHDX-info-before-you-convert-VHDX-to-VMDK-with-qemu-img.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4046 size-full\" src=\"https:\/\/www.nakivo.com\/blog\/wp-content\/uploads\/2020\/01\/Check-the-VHDX-info-before-you-convert-VHDX-to-VMDK-with-qemu-img.png\" alt=\"Check the VHDX info before you convert VHDX to VMDK with qemu-img\" width=\"619\" height=\"127\" \/><\/a><\/p>\n<h4><span class=\"ez-toc-section\" id=\"Convert_VHD_to_VMDK_in_Linux\"><\/span><strong>Convert VHD to VMDK in Linux<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>In order to convert VHD to VMDK with <em>qemu-img<\/em> in Linux, run the command as root:<\/p>\n<p><strong>qemu-img convert \/media\/user1\/data\/WinServer2016.vhdx -O vmdk \/media\/user1\/data\/WinServer2016qemu.vmdk -p<\/strong><\/p>\n<p>Where:<\/p>\n<p><strong><em>-O<\/em><\/strong> \u2013 define the output file format<\/p>\n<p><strong><em>-p<\/em><\/strong> \u2013 show the progress bar<\/p>\n<p>Wait until the conversion process is finished.<\/p>\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Using_qemu-img_in_Windows\"><\/span><strong>Using qemu-img in Windows<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Download <a href=\"https:\/\/cloudbase.it\/qemu-img-windows\/\">qemu-img<\/a> from the official web site (32-bit and 64-bit installers are available to download). In the current example, <em>qemu-img-win-x64-2_3_0<\/em> is used. Extract files form the downloaded archive, for example, to <em>C:\\Programs\\qemu-img\\<\/em>. Then launch the Windows command line (CMD) &#8211; Press <strong>Windows+R<\/strong> to open the \u201c<strong>Run<\/strong>\u201d box. Type \u201c<strong>cmd<\/strong>\u201d into the box and press Ctrl+Shift+Enter to <strong>run<\/strong> the <strong>command<\/strong> as an <strong>administrator<\/strong>.<\/p>\n<p>Go to the <em>qemu-img<\/em> directory:<\/p>\n<p><strong>cd C:\\Programs\\qemu-img<\/strong><\/p>\n<p>Commands of <em>qemu-img<\/em> in Linux and Windows are identical.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Convert_VHD_to_VMDK_in_Windows\"><\/span><strong>Convert VHD to VMDK in Windows<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Run CMD as administrator and go to the directory where <em>qemu-img<\/em> is installed.<\/p>\n<p>View the virtual disk information:<\/p>\n<p><strong>qemu-img.exe info c:\\Virtual\\Hyper-V\\test-disk.vhd<\/strong><\/p>\n<p>Convert the VHD disk image to the VMDK format:<\/p>\n<p><strong>qemu-img.exe convert -p c:\\Virtual\\Hyper-V\\test-disk.vhd -O vmdk c:\\Virtual\\Hyper-V\\test-disk.vmdk<\/strong><\/p>\n<p>Where:<\/p>\n<p><strong><em>-p<\/em><\/strong> \u2013 show progress<\/p>\n<p><strong><em>-O<\/em><\/strong> \u2013 the output file<\/p>\n<p>Wait until the conversion process is finished.<\/p>\n<p><a href=\"https:\/\/www.nakivo.com\/blog\/wp-content\/uploads\/2020\/01\/How-to-convert-VHD-to-VMDK-%E2%80%93-using-qemu-img-as-VHD-to-VMDK-converter.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4061 size-full\" src=\"https:\/\/www.nakivo.com\/blog\/wp-content\/uploads\/2020\/01\/How-to-convert-VHD-to-VMDK-%E2%80%93-using-qemu-img-as-VHD-to-VMDK-converter.png\" alt=\"How to convert VHD to VMDK \u2013 using qemu-img as VHD to VMDK converter\" width=\"960\" height=\"207\" \/><\/a><\/p>\n<p>Now the main thing to note is this conversion will be of a &#8220;type&#8221; that will only work with VMware Workstation&#8230; so if you need to mount this VMDK to a ESXi VM, <a href=\"https:\/\/kb.vmware.com\/s\/article\/1028943\">you&#8217;ll need to &#8220;import it&#8221; basically convert it to the proper type<\/a>&#8230; I&#8217;m usually a fan of VMware but this one is kind of lame.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quick V2V&#8217;s There are multiple ways to do a V2V depending on your migration\/conversion. See here, here and here for some source examples and more in depth reviews of alternative tools\/products, or even V2P as unlikely as that maybe \ud83d\ude1b VMDK to VHDX This one will be short n sweet. V2V a VMDK to a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/zewwy.ca\/index.php\/2018\/01\/23\/lame-mans-v2v\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Lame mans V2V&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","footnotes":""},"categories":[5,8],"tags":[],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-hypervisors","category-server-administration"],"_links":{"self":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/comments?post=178"}],"version-history":[{"count":3,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":915,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/178\/revisions\/915"}],"wp:attachment":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/media?parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/categories?post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/tags?post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}