I have a OVA file that I need to convert to VHD in order to use Hyper-V. Opening the .ova
file in winrar gives me one .ovf
file and one .vmdk
file. I tested the program Microsoft Virtual Machine Converter 3.0
that was recommended on SU but it required a host server. I do not have that, I only have the file.
3 Answers
Quite easy actually, install VirtualBox that comes with the program VBoxManage.exe. It can be used with clonehd
to specify the new format of the disk. You specify the original disk file, in this case the .vmdk, and then give a location and name to output the .vhd.
Open a cmd prompt, CD to C:\Program Files\Oracle\VirtualBox
or Virtualbox install directory and then run:
VBoxManage.exe clonehd --format vhd "C:\temp\VM\disk1.vmdk" "C:\temp\VM\disk1.vhd"
Documentation for VirtualBox: https://www.virtualbox.org/manual/ch08.html#vboxmanage-clonevdi
Then I created a new virtual machine from Hyper-V Manager
and selected "Use an existing virtual hard disk". Worked perfectly.
Use this guide for internet access:
I can't comment yet, but this is a followup to the comment of Ogglas
If you get the message:
'VBoxManage.exe' is not recognized as an internal or external command, operable program or batch file.
Try to enter the entire path of VBOXManage.exe in my case, that would be:
B:\Virtualbox\VBoxManage.exe
The new command would then be:
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonehd --format vhd "C:\temp\VM\disk1.vmdk" "C:\temp\VM\disk1.vhd"
Source: https://serverfault.com/questions/365423/how-to-run-vboxmanage-exe
I had trouble getting VirtualBox to do this correctly for me. Instead, I used an official Microsoft Tool. You can download the Microsoft Virtual Machine Converter here: https://www.microsoft.com/en-us/download/details.aspx?id=42497
An example of what I did to get this working for me:
Import-Module "C:\Program Files\Microsoft Virtual Machine Converter\mvmcCmdlet.psd1"
ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath C:\Temp\myvm.vmdk -VhdType DynamicHardDisk -VhdFormat Vhdx -DestinationLiteralPath C:\Temp\myvm
-
"this tool is no longer available" at that link. I found announcement of it being retired: techcommunity.microsoft.com/t5/system-center-blog/…. Jan 27, 2022 at 17:18
-
1aha! chocolatey has the last published version: community.chocolatey.org/packages/virtualmachineconverter Jan 27, 2022 at 17:20