FusionH3
Contributor
Contributor

MacOS Command-line syntax for OVFTool

Jump to solution

Getting command line errors trying to export a Fusion VM (XP.vmwarevm) to and OVF file.

#  "/Applications/VMware OVF Tool/ovftool" Machines/XP.vmwarevm XP.ovf

Error: Is a directory

#

My feeling if that ovftool help and the ovftool manual do not provide simple-usage examples that relate to Mac/Fusion usage.

VMware ovftool 3.0.1 (build-801290)

VMware Fusion Professional Version 5.0.1 (825449)

Mac OS X 10.7.5

XP.vmwarevm is a single file VM (the vmdk is built-in) created with 5.0.1, set as 5+ compatible.  Have tried 2-3+ compatible, also.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
WoodyZ
Immortal
Immortal

If I execute the ovftool by itself it replies:

Error: No source or target specified. Try 'ovftool --help' for more options.

Completed with errors

So executing ovftool --help the top part of the output states:

Usage: ovftool [options] <source> [<target>]

where

<source>: Source URL locator to an OVF package, VMX file, or virtual machine in

          vCenter or on ESX Server.

<target>: Destination URL locator which specifies either a file location, or a

          location in the vCenter inventory or on an ESX Server.

If <target> is not specified, information about the source is displayed to the

console.

The bottom part of the output states:

For more help, type: --help <topic>, where topics are:

locators    : For detailed source and destination locator syntax

examples    : For examples of use

config      : For syntax of configuration files

integration : For a list of options primarily used when ovftool is exec'ed

               from another tool or shellscript.

So executing it ovftool --help examples the following example shown is applicable:

   ovftool /vms/my_vm.vmx /ovfs/my_vapp.ovf

   (.vmx file to .ovf file. Result is put in /ovfs/my_vapp.[ovf|vmdk])

So as you can see you need to point to the .vmx configuration file not the .vmwarevm Virtual Machine Package.

FusionH3 wrote: XP.vmwarevm is a single file VM (the vmdk is built-in)

By default the .vmwarevm extension is hidden and is a Virtual Machine Package which is really nothing more then a folder, not an individual file, and because it's registered with OS X Launch Services it's treated differently then a folder without the extension.

Have a look at Work with Virtual Machine Packages and then use the FQPN (Fully Qualified Path Name) to the .vmx configuration file for the <source>.

As an example here is the FQCL (Fully Qualified Command Line) on my system to create an .ovf file and the resulting output.

Computer:~ WKZ$ /Applications/VMware\ Fusion.app/Contents/Library/VMware\ OVF\ Tool/ovftool /Users/WKZ/Documents/Virtual\ Machines.localized/Windows\ XP\ Professional.vmwarevm/Windows\ XP\ Professional.vmx /Users/WKZ/Documents/Virtual\ Machines.localized/WinXP\ OVF/WinXP.ovf

Opening VMX source: /Users/WKZ/Documents/Virtual Machines.localized/Windows XP Professional.vmwarevm/Windows XP Professional.vmx

Opening OVF target: /Users/WKZ/Documents/Virtual Machines.localized/WinXP OVF/WinXP.ovf

Writing OVF package: /Users/WKZ/Documents/Virtual Machines.localized/WinXP OVF/WinXP.ovf

Transfer Completed                   

Completed successfully

Computer:~ WKZ$

Looking in the "WinXP OVF" folder there are now three files, WinXP-disk1.vmdk, WinXP.mf and WinXP.ovf.

That about covers it! Smiley Wink

View solution in original post

0 Kudos
4 Replies
WoodyZ
Immortal
Immortal

If I execute the ovftool by itself it replies:

Error: No source or target specified. Try 'ovftool --help' for more options.

Completed with errors

So executing ovftool --help the top part of the output states:

Usage: ovftool [options] <source> [<target>]

where

<source>: Source URL locator to an OVF package, VMX file, or virtual machine in

          vCenter or on ESX Server.

<target>: Destination URL locator which specifies either a file location, or a

          location in the vCenter inventory or on an ESX Server.

If <target> is not specified, information about the source is displayed to the

console.

The bottom part of the output states:

For more help, type: --help <topic>, where topics are:

locators    : For detailed source and destination locator syntax

examples    : For examples of use

config      : For syntax of configuration files

integration : For a list of options primarily used when ovftool is exec'ed

               from another tool or shellscript.

So executing it ovftool --help examples the following example shown is applicable:

   ovftool /vms/my_vm.vmx /ovfs/my_vapp.ovf

   (.vmx file to .ovf file. Result is put in /ovfs/my_vapp.[ovf|vmdk])

So as you can see you need to point to the .vmx configuration file not the .vmwarevm Virtual Machine Package.

FusionH3 wrote: XP.vmwarevm is a single file VM (the vmdk is built-in)

By default the .vmwarevm extension is hidden and is a Virtual Machine Package which is really nothing more then a folder, not an individual file, and because it's registered with OS X Launch Services it's treated differently then a folder without the extension.

Have a look at Work with Virtual Machine Packages and then use the FQPN (Fully Qualified Path Name) to the .vmx configuration file for the <source>.

As an example here is the FQCL (Fully Qualified Command Line) on my system to create an .ovf file and the resulting output.

Computer:~ WKZ$ /Applications/VMware\ Fusion.app/Contents/Library/VMware\ OVF\ Tool/ovftool /Users/WKZ/Documents/Virtual\ Machines.localized/Windows\ XP\ Professional.vmwarevm/Windows\ XP\ Professional.vmx /Users/WKZ/Documents/Virtual\ Machines.localized/WinXP\ OVF/WinXP.ovf

Opening VMX source: /Users/WKZ/Documents/Virtual Machines.localized/Windows XP Professional.vmwarevm/Windows XP Professional.vmx

Opening OVF target: /Users/WKZ/Documents/Virtual Machines.localized/WinXP OVF/WinXP.ovf

Writing OVF package: /Users/WKZ/Documents/Virtual Machines.localized/WinXP OVF/WinXP.ovf

Transfer Completed                   

Completed successfully

Computer:~ WKZ$

Looking in the "WinXP OVF" folder there are now three files, WinXP-disk1.vmdk, WinXP.mf and WinXP.ovf.

That about covers it! Smiley Wink

View solution in original post

0 Kudos
FusionH3
Contributor
Contributor

WoodyZ nailed it!  Thank you...

Just in case this helps others, I was not aware of the machine.vmx file.  Further adding to my confusion, was using finder to view the files that were there.  With machine.vmwarevm appearing in finder as a non-descript flat file (and being perplex about where the .vmdk file disappeared to), I assumed .vmx in the reference was a type used for ESX or another VMware product.  Now that I know, I know!

It is also interesting that the find command (IE find / -name "*.vmx" - print) reports the contents of .vmwarevm "directories".

(It's always the smallest points that derail us.)

0 Kudos
vdumon
Contributor
Contributor

I'm on vacation. I'll be back on May 27.

Please contact Pascal Robin (probin@opentext.com) or Dorel Berger (dberger@opentext.com) for any urgent matter.

Regards,

Vincent

0 Kudos
davidb2
Enthusiast
Enthusiast

Dear VMware,

Should I be concerned that I received this message (and a similar one for another message in the same thread) but I have not posted in this thread? In fact, I have not posted on vmware.com<http://vmware.com> for months.

Thank you,

David

0 Kudos