The Windows virtual machine deployed from a template fails to join the domain
search cancel

The Windows virtual machine deployed from a template fails to join the domain

book

Article ID: 308806

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
When deploying a Windows virtual machine from a template using Sysprep, you experience these symptoms:
  • The virtual machine fails to join the domain
  • After Sysprep completes and the virtual machine reboots, you are able to join the virtual machine to the domain without issues
  • In the %systemroot%\TEMP\vmware-imc\guestcust.log file within the virtual machine, you see the error:

    Joining domain domain.com using account administrator and password '*****'
    The network location cannot be reached. For information about network troubleshooting, see Windows Help.
    Retrying join operation with user = [email protected]
    The network location cannot be reached. For information about network troubleshooting, see Windows Help.


Environment

VMware vCenter Server 5.0.x
VMware vCenter Server 4.0.x
VMware vCenter Server 4.1.x

Cause

This issue occurs in some network environments when the virtual machine network adapters take a longer time than expected to acquire a DHCP lease. In this case, the network is not accessible when Sysprep tries to join the virtual machine to the domain.

Resolution

To resolve this issue, modify the default script used by Sysprep to join the virtual machine to the domain and add a delay before it attempts to add the virtual machine to the domain.
To add this delay:
  1. Log in directly to your vCenter Server as an administrator.
  2. Browse to C:\Program Files\VMware\Infrastructure\Virtual Center Server\imgcust or search for imgcust in Start> Search.
  3. Right-click the finalizationsetup.bat file and click Properties.
  4. Deselect the Read Only attribute and click OK.
  5. Open finalizationsetup.bat using a text editor.
  6. At the top of this file, add these entries:
    • ping 127.0.0.1 -n 10
    • nonsysprepdomainjoin.bat

  7. Save and close the file.
  8. Try deploying virtual machine from the template.
  9. If the issue persists, try increasing the number of pings in the finalizationsetup.bat file to increase the delay.