Guest Operating System Customization

You can use the vSphere Web Services SDK to customize several attributes of the guest operating system. The CustomizationSpec data object allows you to specify network and identity settings in the guest operating system.

Use the CustomizationSpec data object to specify the settings that you choose to modify. You can specify the following areas:
  • IP addresses and gateway addresses for virtual NIC devices
  • DNS servers
  • Host name
  • Domain name
  • Time zone

You can customize a guest operating system while the virtual machine is stopped, by invoking the VirtualMachine.CustomizeVM_Task method. You can customize the guest operating system while the virtual machine is running, by invoking the VirtualMachineGuestCustomizationManager.CustomizeGuest_Task method. The instant clone feature requires that you customize the virtual machine while it is running.

The two ways to customize a virtual machine are compared in the following table.

Table 1. Comparing Guest Operating System Customization
Customization While Stopped Instant Clone Customization
vSphere Compatibility
  • vSphere 5 and later
  • Both vSphere and VMC
  • vSphere 7 and later
  • vSphere only (not VMC)
API Method VirtualMachine.CustomizeVM_Task()
  • VirtualMachineGuestCustomizationManager.CustomizeGuest_Task()
  • VirtualMachineGuestCustomizationManager.StartGuestNetwork_Task()
  • VirtualMachineGuestCustomizationManager.AbortCustomization_Task()
Creating CustomizationSpec Create customization specifications in vSphere Client or in API. Create customization specifications in API.
Virtual Machine State Must be powered off. Must be powered on.
vmtools Must be installed. Must be installed and running.
Customization Engine Not used. Required.
Supported Guests Both Linux and Windows. For supported versions, see https://partnerweb.vmware.com/programs/guestOS/guest-os-customization-matrix.pdf. Linux only. Supported distributions are listed in Customizing Guest Network Settings for Running Virtual Machines.
Network Adapter State CustomizeVM_Task() disconnects virtual adapters and prepares customization. The next time the virtual machine powers on, the customization will take effect and vmtools will restart virtual adapters. InstantClone_Task() disconnects virtual adapters before creating a clone. Use StartGuestNetwork() to restart virtual adapters after customization.
Rebooting the Guest vmtools reboots the guest operating system after reconnecting virtual network adapters. No reboot needed. StartGuestNetwork() restarts network services after customization