Windows VM OSProvisioningClientError and sysprep issues/questions...

Chris Lovett 35 Reputation points Microsoft Employee
2024-12-17T00:20:24.0433333+00:00

When I start my Windows vm using "az vm start" I get these errors:

(OSProvisioningClientError) OS Provisioning for VM 'sr-games-07' did not finish in the allotted time. However, the VM guest agent was detected running. This suggests the guest OS has not been properly prepared to be used as a VM image (with CreateOption=FromImage). To resolve this issue, either use the VHD as is with CreateOption=Attach or prepare it properly for use as an image:

But these Windows instructions talk about using "sysprep" which I tried, I created a new image, then created a new VM from that image, but this VM would not start and I couldn't find any logs explain what went wrong. Also, sysprep talks about some things that I do not want, like removing device drivers, and possibly my local user account that I want all my VM's to have setup with git cloned repos and stuff already on them ready to go. I have a special device driver to enable XBox games on a T4 GPU that I cannot lose, etc.

So what do you recommend, will sysprep solve this startup problem? How do I configure sysprep to leave the T4 driver alone, and the local user account and all the "user" installed apps that I've installed on there?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,266 questions
{count} votes

Accepted answer
  1. anashetty 1,725 Reputation points Microsoft Vendor
    2024-12-17T05:18:56.1566667+00:00

    Hi Chris Lovett,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    Try adding the PersistAllDeviceInstalls setting which ensures that Sysprep does not remove device drivers during the generalization process. You need to configure this in the unattend.xml file.

    The CopyProfile feature allows user installed apps that you have installed into the default user profile. You need to add the CopyProfile feature in the unattend.xml file. Create the file and place it in a location where sysprep can read it. You need to give the path in the command prompt as Administrator and run the command sysprep /generalize /oobe /shutdown /unattend:C:\unattend.xml

    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="generalize">
            <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
                <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
            </component>
        </settings>
    
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
                <CopyProfile>true</CopyProfile>
            </component>
        </settings>
    </unattend>
    

    If you have any further queries, please do let us know.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.