Convert VMX to OVF with OVFtool

I am trying to convert VMX to OVF format using OVFTool as shown below, however it gives an 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 a solution.

+6
source share
6 answers

I had a similar situation in vmware fusion trying to use .vmx, which was probably created on windows. I could boot the virtual machine, but any attempt to export the machine using ovftool or use vmware-vdiskmanager was launched using:

 Error: Failed to open disk: source.vmdk Completed with errors 

diskname was fully valid, the path was valid, permissions were valid, and the only key was to run ovftool with:

 ovftool --X:logToConsole --X:logLevel=verbose source.vmx dest.ova Opening VMX source: source.vmx verbose -[10C2513C0] Opening source verbose -[10C2513C0] Failed to open disk: ./source.vmdk verbose -[10C2513C0] Exception: Failed to open disk: source.vmdk. Reason: Disk encoding error Error: Failed to open disk: source.vmdk 

as others suggested, I looked into .vmdk. there I found 3 more tips:

 encoding="windows-1252" createType="monolithicSparse" # Extent description RW 16777216 SPARSE "source.vmdk" 

so first I converted monolithicSparse vmdk to a "pre-allocated virtual disk divided into 2GB files":

 vmware-vdiskmanager -r source.vmdk -t3 foo.vmdk 

then I could edit "foo.vmdk" to change the encoding, which now looks like this:

 encoding="utf-8" createType="twoGbMaxExtentFlat" # Extent description RW 8323072 FLAT "foo-f001.vmdk" 0 RW 8323072 FLAT "foo-f002.vmdk" 0 RW 131072 FLAT "foo-f003.vmdk" 0 

and finally, after fixing the .vmx source:

 scsi0:0.fileName = "foo.vmdk" 

profit:

 ovftool source.vmx dest.ova ... Opening VMX source: source.vmx Opening OVA target: dest.ova Writing OVA package: dest.ova Transfer Completed Completed successfully 
+5
source

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 the .VMX file in the editor (this is a text file) and made sure that settings like

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

specify the correct file names. Then I noticed this line:

 .encoding = "windows-1251" 

This is a Cyrillic page, so I changed it to use the western code page

 .encoding = "windows-1252" 

Then running OVFTool gave another error

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

To fix this, I had to open the .VMDK file in the HEX editor (because it usually is a large binary file), I found the line there

 encoding = "windows-1251" 

(this is somewhere at the beginning of the file), and instead of "1251" - "1252".

And he did the trick!

+4
source

Try performing as described below.

C: \ Program Files \ VMware \ VMware OVF Tool> ovftool C: \ Win-Test \ Win-Test.vmx (the location of your vmx file) C: \ Win-Test \ win-test.ovf (destination)

+1
source

Perhaps ovftool cannot recognize the path you are specifying.

Try the following command:

 ovftool --eula@ =[path to eula] --X:logToConsole --targetType=OVA --compress=9 vi://[username]:[ESX address] [target address] 

Once you provide the ESX address, it will list the folders created in your ESX window. You can then invoke the above command with the addition of a folder name.

If there is no folder hierarchy in your mailbox, it simply lists the vm names.

Try again to add the same command [foldername]/[vmname no vmx file name required]

 ovftool --eula@ =[path to eula] --X:logToConsole --targetType=OVA --compress=9 vi://[username]:[ESX address]/[foldername if exist]/[vmname no vmx file name required] [target address] 
+1
source

I had the exact same problem. In my case, I opened the VMX file and dumped the IDE and sound controllers from the file and saved. Then I was able to convert everything to OVA using a tool with standard syntax.

eg. I fell:

 ide1:0.present = "TRUE" ide1:0.deviceType = "cdrom-image" 

and

 sound.present = "TRUE" sound.fileName = "-1" sound.autodetect = "TRUE" 

This allowed me to convert the file as usual.

0
source

For me, opening .vmx and deleting the following line:

 sata0:1.deviceType = "cdrom-image" 
0
source

Source: https://habr.com/ru/post/988732/


All Articles