Thin Provision VMs on Workstation Pro using the vmrun Command

Continuing my series on provisioning VMs on workstation pro outside of the GUI, I’ve got a functional script that will create a linked clone using the vmrun command.

It allows you to specify the following options on the command line:

  1. Username in the provisioned VM
  2. Password in the provisioned VM
  3. Source Template
  4. Snapshot used for linked clone
  5. Name of new VM

It completes the following tasks

  1. Clones virtual machine
  2. Modifies the new VM’s VMX file to show the correct name
  3. Powers on the new VM (which also registers it to Workstation)
  4. Copies a script from the host to the VM as soon as VMware tools is available
  5. Copies output from the script from the VM to the host machine and prints output to the screen
  6. Prints the IP of the VM as soon as it’s available

The output looks like this:

You can find the script source code below and on github:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright VirtJunkie.com © 2020