Skip to content

Instantly share code, notes, and snippets.

Embed
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 vmName.mf

$ sha1sum vmName.ovf
$ vi vmName.mf

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

$ tar -cvf vmName-NEW.ova vmName.ovf vmName-disk1.vmdk vmName.mf
@rlazoryshchak

This comment has been minimized.

Copy link

@rlazoryshchak rlazoryshchak commented Jul 17, 2019

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

@goodjob1114

This comment has been minimized.

Copy link
Owner Author

@goodjob1114 goodjob1114 commented Jul 31, 2019

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

OK~ Thanks!!!

@hesstobi

This comment has been minimized.

Copy link

@hesstobi 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 vmName.mf

to get it imported.

@ParadingLunatic

This comment has been minimized.

Copy link

@ParadingLunatic ParadingLunatic commented Feb 6, 2020

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

@evanjs

This comment has been minimized.

Copy link

@evanjs 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... 😪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.