Windows BCC Instance Achieve SID Uniqueness After Joining Domain
Using Windows Server 2012 R2 as an example, this document explains how to execute Sysprep on a Windows system to ensure a unique system SID.
Operation scenarios
For Windows Baidu Cloud Compute instances requiring domain joining, the SID must be unique to prevent domain joining failures.
Therefore, Sysprep must be run before creating a custom image from an existing instance to ensure a unique SID.
Prerequisites
Windows Baidu Cloud Compute must be running a genuine, activated system.
Use the version of Sysprep included with the image, located in %WINDIR%\System32\Sysprep.
The remaining Windows reset count must be greater than 1.
Run "slmgr.vbs /dlv" to check the remaining reset count.
Make sure cloudbase-init is installed. Refer to the cloudbase installation guide if needed.
Log in to Baidu Cloud Compute using the Administrator account.
Operation steps
- Navigate to the "conf" directory of cloudbase-init, copy the file "Unattend.xml," and rename it to "Unattend_sysprep.xml." The default path is C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf.
- Edit the contents of the "Unattend_sysprep.xml" file as needed.
1**Sysprep answer file**
2<?xml version="1.0" encoding="utf-8"?>
3<unattend xmlns="urn:schemas-microsoft-com:unattend">
4 <settings pass="oobeSystem">
5 <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
6 <OOBE>
7 <HideEULAPage>true</HideEULAPage>
8 <NetworkLocation>Work</NetworkLocation>
9 <ProtectYourPC>1</ProtectYourPC>
10 <SkipMachineOOBE>true</SkipMachineOOBE>
11 <SkipUserOOBE>true</SkipUserOOBE>
12 </OOBE>
13 </component>
14 </settings>
15</unattend>
- Open the Command Line interface.
- cd "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf"。
- Execute the command: C:\Windows\System32\Sysprep\sysprep.exe /quiet /generalize /oobe /shutdown /unattend:Unattend_sysprep.xml
- Wait for Sysprep to finish execution and automatically shut down. Be patient until the process completes.
- For creation of custom images, refer to: Create Custom Images.
Note
To ensure the created image has a unique SID, never restart this cloud server instance before creating the custom image.
After running Sysprep, the password for the cloud server instance will be reset. You need to set a new password after the instance restarts.
Run "whoami /user" to check the instance SID.
For further information about Sysprep, visit the official Sysprep website.
