5.5

Table Of Contents
Upload a Customization Script
You can upload a customization script to a virtual machine. The script runs before and after guest
customization when you deploy a virtual machine based on a vApp template.
When you add a customization script to a virtual machine, the script is called:
n
Only on initial customization and force recustomization.
n
With the "precustomization" command line parameter before guest customization begins.
n
With the "postcustomization" command line parameter after guest customization finishes.
The customization script cannot exceed 1500 characters.
Procedure
1 Click My Cloud.
2 In the left pane, click VMs.
3 In the right pane, select a virtual machine, right-click, and select Properties.
4 On the Guest OS Customization tab, in the Customization Script panel, click Browse.
5 Navigate to your script file and click Open.
The file must be a batch file for Windows virtual machines and a shell script for Unix virtual machines.
6 Click OK.
Example: Customization Script Examples
A sample Windows batch file:
@echo off
if "%1%" == "precustomization" (
echo Do precustomization tasks
) else if "%1%" == "postcustomization" (
echo Do postcustomization tasks
)
A sample Unix shell script:
#!/bin/sh
if [ x$1 == x"precustomization" ]; then
echo Do Precustomization tasks
elif [ x$1 == x"postcustomization" ]; then
echo Do Postcustomization tasks
fi
Reset Your Virtual Machine's Password
You can reset your virtual machine's password.
Prerequisites
The virtual machine's guest OS is personalized, and your virtual machine is powered off.
Procedure
1 Click My Cloud.
2 In the left pane, click VMs.
3 Right-click a virtual machine and select Properties.
vCloud Director User's Guide
118 VMware, Inc.