To join an instance to a domain and log in to Windows CVM with the domain account, you need to run Sysprep before creating a custom image to ensure the SID will be unique. Otherwise, the instance cannot be joined to the domain because the CVM created with the custom image and the original instance contains identical information, such as duplicate SIDs. Skip this operation if you have no need to join your Windows CVM to a domain.
This document describes how to run Sysprep on the Windows Server 2012 R2 64-bit operating system to ensure that the Windows CVMs in the domain have unique SIDs.
For more information about Sysprep, see
Assume that Cloudbase-init is installed under
C:\Program Files\Cloudbase Solutions\.
cd 'C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf'
/unattend:Unattend.xmlin the following command, otherwise your current username, password and other configurations of the CVM will be reset. If you choose Follow image for the login, you will need to manually reset the username and account after launch.
- After the following command is executed, CVM automatically shuts down. To ensure that the CVMs created from this image has unique SIDs, do not launch the CVM instance before creating a custom image, or this action will only be effective for the current CVM.
- After you execute the following command on the Windows Server 2012 or Windows Server 2012 R2 operating system, the account Administrator and its password of the CVM will be deleted. Reset your account and password after restarting the CVM as detailed in Reset Instance Password.
C:\Windows\System32\sysprep\sysprep.exe /generalize /oobe /unattend:Unattend.xml
To check CVM SID, execute the command