Backup and Restore a Parallels VM Programmatically

Parallels comes with a nifty command line tool called prlctl installed at /usr/local/bin/prlctl when the package is installed. Use the prlctl with the backup verb in order to run a backup of a virtual machine, followed by an option of a name or ID of a registered virtual machine. For example, if the name of the VM was Krypted Server then you could run the following:

prlctl backup ‘Krypted Server'

Or if the unique ID of the VM was 12345678-1234-1234-112233456789

prlctl backup {12345678-1234-1234-112233456789}

To list existing backups of a given VM, the backup-list verb along with the name or unique ID would be used, as follows:

code>prlctl backup-list {12345678-1234-1234-112233456789}

And then to restore, you can either just use the ID of the VM to restore the latest backup:

prlctl restore {12345678-1234-1234-112233456789}

Or to choose a specific backup to restore, supply that serial following the -t flag:

prlctl restore {12345678-1234-1234-112233456789} -t {11223344-1122-1122-112233445566}

And viola, you’ve backed up and restored with the CLI, so you can script away as needed.