16 KiB
layout | sidebar_current | page_title | description |
---|---|---|---|
docs | docs-builders-parallels-iso | Parallels ISO - Builders | The Parallels Packer builder is able to create Parallels Desktop for Mac virtual machines and export them in the PVM format, starting from an ISO image. |
Parallels Builder (from an ISO)
Type: parallels-iso
The Parallels Packer builder is able to create Parallels Desktop for Mac virtual machines and export them in the PVM format, starting from an ISO image.
The builder builds a virtual machine by creating a new virtual machine from scratch, booting it, installing an OS, provisioning software within the OS, then shutting it down. The result of the Parallels builder is a directory containing all the files necessary to run the virtual machine portably.
Basic Example
Here is a basic example. This example is not functional. It will start the OS installer but then fail because we don't provide the preseed file for Ubuntu to self-install. Still, the example serves to show the basic configuration:
{
"type": "parallels-iso",
"guest_os_type": "ubuntu",
"iso_url": "http://releases.ubuntu.com/12.04/ubuntu-12.04.3-server-amd64.iso",
"iso_checksum": "2cbe868812a871242cdcdd8f2fd6feb9",
"iso_checksum_type": "md5",
"parallels_tools_flavor": "lin",
"ssh_username": "packer",
"ssh_password": "packer",
"ssh_wait_timeout": "30s",
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now"
}
It is important to add a shutdown_command
. By default Packer halts the virtual
machine and the file system may not be sync'd. Thus, changes made in a
provisioner might not be saved.
Configuration Reference
There are many configuration options available for the Parallels 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 can be configured for this builder.
Required:
-
iso_checksum
(string) - The checksum for the OS ISO file. Because ISO files are so large, this is required and Packer will verify it prior to booting a virtual machine with the ISO attached. The type of the checksum is specified withiso_checksum_type
, documented below. At least one ofiso_checksum
andiso_checksum_url
must be defined. This has precedence overiso_checksum_url
type. -
iso_checksum_type
(string) - The type of the checksum specified iniso_checksum
. Valid values are "none", "md5", "sha1", "sha256", or "sha512" currently. While "none" will skip checksumming, this is not recommended since ISO files are generally large and corruption does happen from time to time. -
iso_checksum_url
(string) - A URL to a GNU or BSD style checksum file containing a checksum for the OS ISO file. At least one ofiso_checksum
andiso_checksum_url
must be defined. This will be ignored ifiso_checksum
is non empty. -
iso_url
(string) - A URL to the ISO containing the installation image. This URL can be either an HTTP URL or a file URL (or path to a file). If this is an HTTP URL, Packer will download it and cache it between runs. -
parallels_tools_flavor
(string) - The flavor of the Parallels Tools ISO to install into the VM. Valid values are "win", "lin", "mac", "os2" and "other". This can be omitted only ifparallels_tools_mode
is "disable". -
ssh_username
(string) - The username to use to SSH into the machine once the OS is installed.
Optional:
-
boot_command
(array of strings) - This is an array of commands to type when the virtual machine is first booted. The goal of these commands should be to type just enough to initialize the operating system installer. Special keys can be typed as well, and are covered in the section below on the boot command. If this is not specified, it is assumed the installer will start itself. -
boot_wait
(string) - The time to wait after booting the initial virtual machine before typing theboot_command
. The value of this should be a duration. Examples are "5s" and "1m30s" which will cause Packer to wait five seconds and one minute 30 seconds, respectively. If this isn't specified, the default is 10 seconds. -
disk_size
(integer) - The size, in megabytes, of the hard disk to create for the VM. By default, this is 40000 (about 40 GB). -
disk_type
(string) - The type for image file based virtual disk drives, defaults toexpand
. Valid options areexpand
(expanding disk) that the image file is small initially and grows in size as you add data to it, andplain
(plain disk) that the image file has a fixed size from the moment it is created (i.e the space is allocated for the full drive). Plain disks perform faster than expanding disks.skip_compaction
will be set to true automatically for plain disks. -
floppy_files
(array of strings) - A list of files to place onto a floppy disk that is attached when the VM is booted. This is most useful for unattended Windows installs, which look for anAutounattend.xml
file on removable media. By default, no floppy will be attached. All files listed in this setting get placed into the root directory of the floppy and the floppy is attached as the first floppy device. Currently, no support exists for creating sub-directories on the floppy. Wildcard characters (*, ?, and []) are allowed. Directory names are also allowed, which will add all the files found in the directory to the floppy. -
floppy_dirs
(array of strings) - A list of directories to plac