github.com/tonnydourado/packer@v0.6.1-0.20140701134019-5d0cd9676a37/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 Professional](http://www.vmware.com/products/fusion-professional/) 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 Professional 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 * `floppy_files` (array of strings) - A list of files to place onto a floppy 55 disk that is attached when the VM is booted. This is most useful 56 for unattended Windows installs, which look for an `Autounattend.xml` file 57 on removable media. By default, no floppy will be attached. All files 58 listed in this setting get placed into the root directory of the floppy 59 and the floppy is attached as the first floppy device. Currently, no 60 support exists for creating sub-directories on the floppy. Wildcard 61 characters (*, ?, and []) are allowed. Directory names are also allowed, 62 which will add all the files found in the directory to the floppy. 63 64 * `fusion_app_path` (string) - Path to "VMware Fusion.app". By default this 65 is "/Applications/VMware Fusion.app" but this setting allows you to 66 customize this. 67 68 * `headless` (boolean) - Packer defaults to building VMware 69 virtual machines by launching a GUI that shows the console of the 70 machine being built. When this value is set to true, the machine will 71 start without a console. For VMware machines, Packer will output VNC 72 connection information in case you need to connect to the console to 73 debug the build process. 74 75 * `output_directory` (string) - This is the path to the directory where the 76 resulting virtual machine will be created. This may be relative or absolute. 77 If relative, the path is relative to the working directory when `packer` 78 is executed. This directory must not exist or be empty prior to running the builder. 79 By default this is "output-BUILDNAME" where "BUILDNAME" is the name 80 of the build. 81 82 * `shutdown_command` (string) - The command to use to gracefully shut down 83 the machine once all the provisioning is done. By default this is an empty 84 string, which tells Packer to just forcefully shut down the machine. 85 86 * `shutdown_timeout` (string) - The amount of time to wait after executing 87 the `shutdown_command` for the virtual machine to actually shut down. 88 If it doesn't shut down in this time, it is an error. By default, the timeout 89 is "5m", or five minutes. 90 91 * `skip_compaction` (boolean) - VMware-created disks are defragmented 92 and compacted at the end of the build process using `vmware-vdiskmanager`. 93 In certain rare cases, this might actually end up making the resulting disks 94 slightly larger. If you find this to be the case, you can disable compaction 95 using this configuration value. 96 97 * `ssh_key_path` (string) - Path to a private key to use for authenticating 98 with SSH. By default this is not set (key-based auth won't be used). 99 The associated public key is expected to already be configured on the 100 VM being prepared by some other process (kickstart, etc.). 101 102 * `ssh_password` (string) - The password for `ssh_username` to use to 103 authenticate with SSH. By default this is the empty string. 104 105 * `ssh_port` (integer) - The port that SSH will listen on within the virtual 106 machine. By default this is 22. 107 108 * `ssh_skip_request_pty` (boolean) - If true, a pty will not be requested as 109 part of the SSH connection. By default, this is "false", so a pty 110 _will_ be requested. 111 112 * `ssh_wait_timeout` (string) - The duration to wait for SSH to become 113 available. By default this is "20m", or 20 minutes. Note that this should 114 be quite long since the timer begins as soon as the virtual machine is booted. 115 116 * `vm_name` (string) - This is the name of the VMX file for the new virtual 117 machine, without the file extension. By default this is "packer-BUILDNAME", 118 where "BUILDNAME" is the name of the build. 119 120 * `vmx_data` (object of key/value strings) - Arbitrary key/values 121 to enter into the virtual machine VMX file. This is for advanced users 122 who want to set properties such as memory, CPU, etc. 123 124 * `vmx_data_post` (object of key/value strings) - Identical to `vmx_data`, 125 except that it is run after the virtual machine is shutdown, and before the 126 virtual machine is exported.