github.com/kaixiang/packer@v0.5.2-0.20140114230416-1f5786b0d7f1/website/source/docs/builders/vmware-vmx.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "VMware Builder from VMX"
     4  ---
     5  
     6  # VMware Builder (from VMX)
     7  
     8  Type: `vmware-vmx`
     9  
    10  This VMware builder is able to create VMware virtual machines from an
    11  existing VMware virtual machine (a VMX file). It currently
    12  supports building virtual machines on hosts running
    13  [VMware Fusion](http://www.vmware.com/products/fusion/overview.html) for OS X,
    14  [VMware Workstation](http://www.vmware.com/products/workstation/overview.html)
    15  for Linux and Windows, and
    16  [VMware Player](http://www.vmware.com/products/player/) on Linux.
    17  
    18  The builder builds a virtual machine by cloning the VMX file using
    19  the clone capabilities introduced in VMware Fusion 6, Workstation 10,
    20  and Player 6. After cloning the VM, it provisions software within the
    21  new machine, shuts it down, and compacts the disks. The resulting folder
    22  contains a new VMware virtual machine.
    23  
    24  ## Basic Example
    25  
    26  Here is an example. This example is fully functional as long as the source
    27  path points to a real VMX file with the proper settings:
    28  
    29  <pre class="prettyprint">
    30  {
    31    "type": "vmware-vmx",
    32    "source_path": "/path/to/a/vm.vmx",
    33    "ssh_username": "root",
    34    "ssh_password": "root",
    35    "shutdown_command": "shutdown -P now"
    36  }
    37  </pre>
    38  
    39  ## Configuration Reference
    40  
    41  There are many configuration options available for the VMware builder.
    42  They are organized below into two categories: required and optional. Within
    43  each category, the available options are alphabetized and described.
    44  
    45  Required:
    46  
    47  * `source_path` (string) - Path to the source VMX file to clone.
    48  
    49  * `ssh_username` (string) - The username to use to SSH into the machine
    50    once the OS is installed.
    51  
    52  Optional:
    53  
    54  * `boot_wait` (string) - The time to wait after booting the initial virtual
    55    machine before typing the `boot_command`. The value of this should be
    56    a duration. Examples are "5s" and "1m30s" which will cause Packer to wait
    57    five seconds and one minute 30 seconds, respectively. If this isn't specified,
    58    the default is 10 seconds.
    59  
    60  * `floppy_files` (array of strings) - A list of files to put onto a floppy
    61    disk that is attached when the VM is booted for the first time. This is
    62    most useful for unattended Windows installs, which look for an
    63    `Autounattend.xml` file on removable media. By default no floppy will
    64    be attached. The files listed in this configuration will all be put
    65    into the root directory of the floppy disk; sub-directories are not supported.
    66  
    67  * `fusion_app_path` (string) - Path to "VMware Fusion.app". By default this
    68    is "/Applications/VMware Fusion.app" but this setting allows you to
    69    customize this.
    70  
    71  * `headless` (bool) - Packer defaults to building VMware
    72    virtual machines by launching a GUI that shows the console of the
    73    machine being built. When this value is set to true, the machine will
    74    start without a console. For VMware machines, Packer will output VNC
    75    connection information in case you need to connect to the console to
    76    debug the build process.
    77  
    78  * `output_directory` (string) - This is the path to the directory where the
    79    resulting virtual machine will be created. This may be relative or absolute.
    80    If relative, the path is relative to the working directory when `packer`
    81    is executed. This directory must not exist or be empty prior to running the builder.
    82    By default this is "output-BUILDNAME" where "BUILDNAME" is the name
    83    of the build.
    84  
    85  * `skip_compaction` (bool) -  VMware-created disks are defragmented
    86    and compacted at the end of the build process using `vmware-vdiskmanager`.
    87    In certain rare cases, this might actually end up making the resulting disks
    88    slightly larger. If you find this to be the case, you can disable compaction
    89    using this configuration value.
    90  
    91  * `shutdown_command` (string) - The command to use to gracefully shut down
    92    the machine once all the provisioning is done. By default this is an empty
    93    string, which tells Packer to just forcefully shut down the machine.
    94  
    95  * `shutdown_timeout` (string) - The amount of time to wait after executing
    96    the `shutdown_command` for the virtual machine to actually shut down.
    97    If it doesn't shut down in this time, it is an error. By default, the timeout
    98    is "5m", or five minutes.
    99  
   100  * `ssh_key_path` (string) - Path to a private key to use for authenticating
   101    with SSH. By default this is not set (key-based auth won't be used).
   102    The associated public key is expected to already be configured on the
   103    VM being prepared by some other process (kickstart, etc.).
   104  
   105  * `ssh_password` (string) - The password for `ssh_username` to use to
   106    authenticate with SSH. By default this is the empty string.
   107  
   108  * `ssh_port` (int) - The port that SSH will listen on within the virtual
   109    machine. By default this is 22.
   110  
   111  * `ssh_skip_request_pty` (bool) - If true, a pty will not be requested as
   112    part of the SSH connection. By default, this is "false", so a pty
   113    _will_ be requested.
   114  
   115  * `ssh_wait_timeout` (string) - The duration to wait for SSH to become
   116    available. By default this is "20m", or 20 minutes. Note that this should
   117    be quite long since the timer begins as soon as the virtual machine is booted.
   118  
   119  * `vm_name` (string) - This is the name of the VMX file for the new virtual
   120    machine, without the file extension. By default this is "packer-BUILDNAME",
   121    where "BUILDNAME" is the name of the build.
   122  
   123  * `vmx_data` (object, string keys and string values) - Arbitrary key/values
   124    to enter into the virtual machine VMX file. This is for advanced users
   125    who want to set properties such as memory, CPU, etc.