What is an OVA file?
OVA stands for Open Virtualization Archive or Open Virtual Appliance. An OVA file is a container used for the distribution and deployment of virtual machines in different environments. It is a single compressed file containing the OVF package, which is a standard format for virtual appliances.
An OVA file will typically contain:
- A virtual disk image such as VMDK
- An OVF descriptor which is an XML-like text file
- ISO virtual DVD image files
- MF – manifest file with the information about files included in the OVA or OVF VM package
- Certificate
- Other files
OVA files are platform-independent and supported by hypervisors such as VMware ESXi, VMware Workstation, Oracle VirtualBox, QEMU, and others. Unfortunately, Microsoft Hyper-V does not support deploying VMs from OVA/OVF templates and exporting VMs to OVA templates.
The workflow to import OVA to Hyper-V consists of three steps:
- Extract VMDK from OVA (extract a virtual disk file from an OVA template).
- Convert VMDK to VHD or VHDX.
- Create a VM in Hyper-V and import the converted virtual disk file.
Extracting the OVF package from the OVA file
Extract the contents of the OVA file using any tar/zip utility such as 7zip. The result will be an OVF package and related files, which are usually supplied in a separate directory with a virtual disk file and configuration file for the VM template.
Converting a Virtual Disk
The second step is to convert the virtual disk from VMDK format to VHD or VHDX format, which is supported by Hyper-V. You can convert the extracted virtual disk with your choice of free tools. Here are three options:
- QEMU (qemu-img)
- Oracle VirtualBox (vboxmanage)
- StarWind V2V Converter
QEMU
Qemu-img is a free utility for Windows to convert virtual disk images of different file formats. This utility is a command-line utility from the creators of QEMU.
- Download qemu-img from the official web page: https://www.qemu.org/download/
- Unpack the contents of the downloaded archive to a custom directory, for example, C:\Programs\qemu-img\
- Open the Windows command line (CMD). You can do this by clicking Start and typing CMD.
- Go to the directory where qemu-img is located if you did not add the location of this utility to the OS $PATH variable:
cd C:\Programs\qemu-img\
- Run the command to convert a VMDK virtual disk to VHDX:
qemu-img convert -p -f vmdk "C:\TEMP\VM\ovf\WinXP-test-disk1.vmdk" -O vhdx -o subformat=dynamic "C:\TEMP\VM\WinXP-HV.vhdx"
Where:
-p sets to show the progress of the process.
-f is the format of the source virtual disk image.
“C:\TEMP\VM\ovf\WinXP-test-disk1.vmdk” is the path of the source virtual disk.
-O is used to set the format of the output virtual disk image file (vhdx in this case).
-o subformat=dynamic sets the output VHDX, which is a dynamic disk in this case. A VHDX virtual disk can be fixed or dynamic.
“C:\TEMP\VM\WinXP-HV.vhdx” is the destination path for the output virtual disk file.
Wait until qemu-img finishes converting the VMDK file extracted from OVA to Hyper-V VHDX. The needed time depends on the size of the virtual disk file and the performance of the storage subsystem.
Oracle VirtualBox
Virtual Box Manager or vboxmanage is a command line utility that comes with VirtualBox, a free open-source hypervisor supported by Oracle. The vboxmanage utility can do more operations than the graphical user interface of VirtualBox and can convert virtual disks of different formats.
- Download VirtualBox from the official web page: https://www.virtualbox.org/wiki/Downloads
- Go to the directory where VirtualBox is installed (default installation path in this example):
cd "C:\Program Files (x86)\Oracle\VirtualBox"
- Run the command to convert a VMDK virtual disk to a VHD format for Hyper-V:
VBoxManage.exe clonehd --format vhd "C:\TEMP\VM\ovf\WinXP-test-disk1.vmdk" "C:\TEMP\VM\WinXP-HV.vhd"
The progress of the process is displayed in the console. Wait until the virtual disk cloning/converting process is finished.
StarWind V2V Converter
V2V Converter is a free Windows application for virtual machine (VM) migration and conversion developed by StarWind Software. It converts virtual machines from one format to another to facilitate migration between hypervisors and virtualization platforms.
- Download V2V Converter from the official web page: https://www.starwindsoftware.com/starwind-v2v-converter#download
- Launch the app and select the source virtual machine file.
- Choose the desired target format and destination location for the converted VM.
- Configure any additional settings or options as needed.
- Initiate the conversion process and monitor progress via the status indicator.
- Once the conversion is complete, verify the integrity of the converted VM and deploy it on the target hypervisor.