Some snippet
CloudBase init is installed using
$serialPortName = @(Get-WmiObject Win32_SerialPort)[0].DeviceId
$p = Start-Process -Wait -PassThru -FilePath msiexec -ArgumentList "/i PATHTOMSI /qn /l*v PATHTOMSILOG LOGGINGSERIALPORTNAME=$serialPortName"
Next, I run
C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\bin\SetSetupComplete.cmd
Then I run sysprep
& "$ENV:SystemRoot\System32\Sysprep\Sysprep.exe" /generalize
/oobe /shutdown
/unattend:"$LocalUnattendFile"
I am not able to attach the $LocalUnattendFile
Its a standard autounattend.xml with oobe and specialize pass
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-PnpSysprep" processorarchitecture="amd64" publickeytoken="31bf3856ad364e35" language="neutral" versionscope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<persistalldeviceinstalls>true</persistalldeviceinstalls>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorarchitecture="amd64" publickeytoken="31bf3856ad364e35" language="neutral" versionscope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<oobe>
<hideeulapage>true</hideeulapage>
<networklocation>Work</networklocation>
<protectyourpc>1</protectyourpc>
<skipmachineoobe>true</skipmachineoobe>
<skipuseroobe>true</skipuseroobe>
</oobe>
<useraccounts>
<administratorpassword>
<value>Pa55word$</value>
<plaintext>true</plaintext>
</administratorpassword>
</useraccounts>
<autologon>
<password>
<value>Pa55word$</value>
<plaintext>true</plaintext>
</password>
<enabled>true</enabled>
<logoncount>1</logoncount>
<username>Administrator</username>
</autologon>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment" processorarchitecture="amd64" publickeytoken="31bf3856ad364e35" language="neutral" versionscope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<runsynchronous>
<runsynchronouscommand wcm:action="add">
<order>1</order>
<path>powershell -NoLogo -Command "Set-ExecutionPolicy Unrestricted -force"</path>
<description>Set-ExecutionPolicy to unrestricted</description>
</runsynchronouscommand>
<runsynchronouscommand wcm:action="add">
<order>2</order>
<path>"C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\Scripts\cloudbase-init.exe" --config-file "C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init-unattend.conf"</path>
<description>Run Cloudbase-Init to set the hostname</description>
<willreboot>Always</willreboot>
</runsynchronouscommand>
</runsynchronous>
</component>
</settings>
</unattend>
After syspreping, I copy the image to openstack and then try to create an instance. The oobe pass should set the administrator password.
All this works with Cloud base init build of 15 Sep 2014. With the latest cloud-base msi, the machine boots up coreectly, but the Administrator doesn't get autologged on. Also, I see a message on colsole saying Administrator must change password. Once I change the password, everything works.
The gotcha is I want Administrator account to autologon.
Hello, When you have installed cloudbase-init, have you checked the sysprep option? It might be the case that your AnswerFile(Unattend.xml) was replaced by the cloudbase-init one.
Hi, we reverted the commit that caused this behaviour, so now you should have no issues in your scenario. Can you please test the latest installer?
Thanks a ton! It all works as it is meant to be :)