qemu/kvm import ova
This commit is contained in:
30
_posts/2025-11-24-kvm-import-ova-appliance.md
Normal file
30
_posts/2025-11-24-kvm-import-ova-appliance.md
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
When downloading virtual machines they're usually packaged in an OVA file (Open Virtual Appliance). An OVA file is actually just a single file archive with an OVF package inside.
|
||||
An OVF package contains the metadata decribing the virtual machine (usually a .ovf file) and the virtual disks. The OVF standard doesn't specify a disk image format.
|
||||
Virtual machines made using vmware, virtualbox or Microsoft hyper-V are usually using disks in the vmdk, vdi or vhd/vhdx formats respectively, which are then packaged in the OVA file. However, while QEMU/KVM can read them, there are not the prefered formats. We'll see here how to convert them to a more appropriate format.
|
||||
|
||||
## instructions
|
||||
|
||||
We first have tp extract the OVA file with the following command:
|
||||
```
|
||||
tar -xvf your_vm.ova
|
||||
```
|
||||
|
||||
We'll then use qemu-img to convert the disks.
|
||||
|
||||
All the supported image formats are at the end of the help message with qemu-img.
|
||||
```
|
||||
qemu-img -h
|
||||
```
|
||||
|
||||
To convert from one format to another:
|
||||
```
|
||||
qemu-img convert -f vmdk -O qcow2 your_disk.vmdk your_disk.qcow2
|
||||
```
|
||||
The most stable and fastest is not using an image format but using block devices directly (with LVM). However if you cannot use block devices for some reason raw (which is not really a format) is the fastest.
|
||||
QCOW2 image format has some performance overhead but is able to use storage more efficiently with compression, support snapshots and is easier to backup. It's the usual format used with QEMU/KVM.
|
||||
|
||||
## final steps
|
||||
|
||||
Then we can import the whole virtual machine selecting the disk (after conversion) in QEMU/KVM, using virt-manager if you prefer to do it graphically. Or we can just add the disk to an existing virtual machine.
|
||||
When importing the virtual machine you can have a look at the .ovf file (the metadata) from the OVA file to see the ressources expected by the virtual machine.
|
||||
Reference in New Issue
Block a user