convert VMX to OVF using OVFtool

Aditi S picture Aditi S · Jun 8, 2015 · Viewed 41.5k times · Source

I am trying to convert VMX to OVF format using OVFTool as below, however it gives error:

C:\Program Files\VMware\VMware OVF Tool>ovftool.exe
vi://vcenter.com:port/folder/myfolder/abc.vmx abc.ovf
Error: Failed to open file: https://vcenter.com:port/folder/myfolder/abc.vmx
Completed with errors

Please let me know if you have any solution.

Answer

Vladimir Shutow picture Vladimir Shutow · Mar 18, 2016

I had a similar problem with OVFTool trying to export to OVF format.

Export failed: Failed to open file: C:\Virtual\test\test.vmx.

First, I opened .VMX file in editor (it's a text file) and made sure that settings like

scsi0:0.fileName = "test.vmdk"
nvram = "test.nvram"
extendedConfigFile = "test.vmxf"

mention proper file names. Then I noticed this line:

.encoding = "windows-1251"

This is Cyrillic code page, so I modified it to use Western code page

.encoding = "windows-1252"

Then, running OVFTool gave a different error

Export failed: Failed to open disk: test.vmdk.

To fix it I had to open .VMDK file in HEX editor (because it's usually a big binary file), found there the string

encoding = "windows-1251"

(it's somewhere in the beginning of the file), and replaced "1251" with "1252".

And it did the trick!