Creating Virtual machine with .OVF format

Hello members, I would like to create virtual machine images with some pre-installed software in a .*OVF/OVA* format. So that I can use these* OVF *images/templates for any hypervisor to create a VM. Do you have any suggestions or some available web scripts/links to do this..? Thanks, Ajay

On Thu, Apr 08, 2021 at 05:51:54PM -0400, Ajay Kumar wrote:
Hello members,
I would like to create virtual machine images with some pre-installed software in a .*OVF/OVA* format. So that I can use these* OVF *images/templates for any hypervisor to create a VM. Do you have any suggestions or some available web scripts/links to do this..?
Hi, no, I'm not aware of any such online tools (let alone unlicensed). But if I were to script this, I'd do it this way: Prerequisites: 1) create your VM image with a disk type RAW (can be QCOW2 as well, but you'd then have to use different steps for conversion) for example you could download one of them cloud images and use libguestfs tools to remove the cloud-init part 2) get a fedora machine (I tried it on Fedora only) - a VM is fine On ^that Fedora machine: 3) install RPM fusion repo 4) install the VirtualBox-server package 5) upload your RAW disk image created in step 1) to this machine 6) convert the RAW image to VDI which virtualbox understands: $ VBoxManage convertfromraw <yourimage>.raw <outputpath> --format VDI 7) create a dummy VM object $ VBoxManage createvm --name dummy --register 8) attach a storage controller to ^this dummy VM $ VBoxManage storagectl dummy --name dummycontroller --add scsi 9) attach the converted VDI disk to the dummy VM object $ VBoxManage storageattach dummy --storagectl dummycontroller \ --medium <path_to_VDI> \ --port 1 \ # this can be arbitrary number --type hdd 10) export the dummy machine as OVA $ VBoxManage export dummy --output <filename>.ova I mean, quite a few hoops to jump, but like I said, I have no knowledge of opensource tools that could do it in one step, but at least the ^above can all be automated (you'll have to look for more sensible settings to VBoxManage though) and I myself would most likely going with something like that. If you don't need automation, just use the virtualbox GUI to import the raw disk and export the machine in OVA. Regards, Erik

On Thu, Apr 08, 2021 at 05:51:54PM -0400, Ajay Kumar wrote:
Hello members,
I would like to create virtual machine images with some pre-installed software in a .*OVF/OVA* format. So that I can use these* OVF *images/templates for any hypervisor to create a VM.
Big caveat: OVF/OVA only really ensures a portable packaging / description format, and does /not/ actually provide hypervisor execution portability. ie any hypervisor can have tools to consume an OVF/OVA, but that doesn't mean the disk image inside can actually be run on any hypervisor. Each hypervisor has its own set of virtual hardware that it emulates, and there is little overlap between the different options (VMware, Hyperv, KVM). eg if a disk image is built to use virtio-blk for its storage, then you can run that on KVM, but not on VMware/HyperV. Likewise if you pick the HyperV paravirtualized storage driver, then you're unlikely to have to easily run on VMware/KVM. If you work hard you might be able to create disk images that really are portable across hypervisors by ensuring the OS can automagically detect the drivers based on hardware it sees, but this is really unrelated to any use of OVF/OVA. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (3)
-
Ajay Kumar
-
Daniel P. Berrangé
-
Erik Skultety