---
modeline: |
  vim: set ft=pandoc:
description: |
  This VMware Packer builder is able to create VMware virtual machines from an
  existing VMware virtual machine (a VMX file). It currently supports building
  virtual machines on hosts running VMware Fusion Professional for OS X, VMware
  Workstation for Linux and Windows, and VMware Player on Linux.
layout: docs
page_title: VMware VMX - Builders
sidebar_title: VMWare VMX
---

# VMware Builder (from VMX)

Type: `vmware-vmx`

This VMware Packer builder is able to create VMware virtual machines from an
existing VMware virtual machine (a VMX file). It currently supports building
virtual machines on hosts running [VMware Fusion
Professional](https://www.vmware.com/products/fusion-professional/) for OS X,
[VMware Workstation](https://www.vmware.com/products/workstation/overview.html)
for Linux and Windows, and [VMware
Player](https://www.vmware.com/products/player/) on Linux.

The builder builds a virtual machine by cloning the VMX file using the clone
capabilities introduced in VMware Fusion Professional 6, Workstation 10, and
Player 6. After cloning the VM, it provisions software within the new machine,
shuts it down, and compacts the disks. The resulting folder contains a new
VMware virtual machine.

## Basic Example

Here is an example. This example is fully functional as long as the source path
points to a real VMX file with the proper settings:

```json
{
  "type": "vmware-vmx",
  "source_path": "/path/to/a/vm.vmx",
  "ssh_username": "root",
  "ssh_password": "root",
  "shutdown_command": "shutdown -P now"
}
```

## Configuration Reference

There are many configuration options available for the VMware builder. They are
organized below into two categories: required and optional. Within each
category, the available options are alphabetized and described.

In addition to the options listed here, a
[communicator](/docs/templates/communicator) can be configured for this
builder.

## Configuration Reference

There are many configuration options available for the builder. In addition to
the items listed here, you will want to look at the general configuration
references for
[HTTP](#http-directory-configuration),
[Floppy](#floppy-configuration),
[Boot](#boot-configuration),
[Driver](#driver-configuration),
[Output](#output-configuration),
[Run](#run-configuration),
[Shutdown](#shutdown-configuration),
[Communicator](#communicator-configuration),
[Tools](#tools-configuration),
[vmx](#vmx-configuration),
[Export](#export-configuration),
configuration references, which are
necessary for this build to succeed and can be found further down the page.

### Required:

@include 'builder/vmware/vmx/Config-required.mdx'

#### Optional:

@include 'builder/vmware/vmx/Config-not-required.mdx'

### Http directory configuration

@include 'common/HTTPConfig.mdx'

#### Optional:

@include 'common/HTTPConfig-not-required.mdx'

### Floppy configuration

@include 'common/FloppyConfig.mdx'

#### Optional:

@include 'common/FloppyConfig-not-required.mdx'

### Export configuration

#### Optional:

@include 'builder/vmware/common/ExportConfig-not-required.mdx'

### Output configuration

#### Optional:

@include 'builder/vmware/common/OutputConfig-not-required.mdx'

### Run configuration

#### Optional:

@include 'builder/vmware/common/RunConfig-not-required.mdx'

### Driver configuration

#### Optional:

@include 'builder/vmware/common/DriverConfig-not-required.mdx'

### Tools configuration

#### Optional:

@include 'builder/vmware/common/ToolsConfig-not-required.mdx'

### VMX configuration

#### Optional:

@include 'builder/vmware/common/VMXConfig-not-required.mdx'

### Communicator configuration

#### Optional common fields:

@include 'helper/communicator/Config-not-required.mdx'

#### Optional SSH fields:

@include 'helper/communicator/SSH-not-required.mdx'

#### Optional WinRM fields:

@include 'helper/communicator/WinRM-not-required.mdx'

## Shutdown Configuration

@include 'common/shutdowncommand/ShutdownConfig-not-required.mdx'

## Boot Configuration

@include 'common/bootcommand/BootConfig.mdx'

@include 'common/bootcommand/VNCConfig.mdx'

-> **Note**: for the `HTTPIP` to be resolved correctly, your VM's network
configuration has to include a `hostonly` or `nat` type network interface.
If you are using this feature, it is recommended to leave the default network
configuration while you are building the VM, and use the `vmx_data_post` hook
to modify the network configuration after the VM is done building.

#### Optional:

@include 'common/bootcommand/VNCConfig-not-required.mdx'
@include 'common/bootcommand/BootConfig-not-required.mdx'

For more examples of various boot commands, see the sample projects from our
[community templates page](/community-tools#templates).

```json
{
  "builders": [
    {
      "type": "vmware-vmx",
      "boot_key_interval": "10ms"
      ...
    }
  ]
}
```

Example boot command. This is actually a working boot command used to start an
Ubuntu 12.04 installer:

```text
[
  "<esc><esc><enter><wait>",
  "/install/vmlinuz noapic ",
  "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
  "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
  "hostname={{ .Name }} ",
  "fb=false debconf/frontend=noninteractive ",
  "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
  "keyboard-configuration/variant=USA console-setup/ask_detect=false ",
  "initrd=/install/initrd.gz -- <enter>"
]
```

For more examples of various boot commands, see the sample projects from our
[community templates page](/community-tools#templates).

@include 'builders/building_on_remote_vsphere_hypervisor.mdx'
