Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
how to modify .ova file on linux/Mac using terminal....export vm (OVF 1.0) from virtualbox, then modify some tag and hash value for import vm to ESXi

extract ova files from an archive

$ tar -xvf vmName.ova

modify ovf for some invalid tag

$ vi vmName.ovf

re-calculate sha1 from vmName.ovf, then modify the hash value of

$ sha1sum vmName.ovf
$ vi

package to ova which source files from [vmName.ovf, vmName-disk1.vmdk,]

$ tar -cvf vmName-NEW.ova vmName.ovf vmName-disk1.vmdk
Copy link

rlazoryshchak commented Jul 17, 2019

tar -cvf vmName-NEW.ova vmName.ovf vmName-disk1.vmdk - no comma needed

Copy link

goodjob1114 commented Jul 31, 2019

tar -cvf vmName-NEW.ova vmName.ovf vmName-disk1.vmdk - no comma needed

OK~ Thanks!!!

Copy link

hesstobi commented Jan 11, 2020

On MacOS 10.15 i had to use

tar -cvf vmName-NEW.ova --format=ustar vmName.ovf vmName-disk1.vmdk

to get it imported.

Copy link

ParadingLunatic commented Feb 6, 2020

Figured I'd put this here as well. Looks like more recent version of ESXi/vCenter require sha256.

Copy link

evanjs commented Jun 4, 2020

Just a note for anybody that needs as much sleep as I do...
Make sure you run the command in the same directory the ovf, mf, and vmdk files are in.

Like this: tar -cvf nixos.ova .*.{ovf,vmdk,mf}
Not like this: tar -cvf nixos.ova ../nix-build-fix-esxi-image.drv-0/ova/*.{ovf,vmdk,mf}

Otherwise, the resulting ovf will be looking for the VMDK in a non-existent directory... 😪

Copy link

soyeliel commented Oct 18, 2021

to save time for those using mac. As mentioned by @ParadingLunatic ovf hash needs uses sha256 on newer releases. Here is the command for Mac Catalina

$ shasum -a 256 vmName.ovf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment