How To Deploy Windows 10 with CloudBolt CMP

Overview

Windows 10 is one of the many operating systems that can be deployed and run in virtual environments, however, there are some pre requisites that need to be fulfilled before you can successfully deploy a Windows 10 VM with CloudBolt CMP

By default, Windows 10 disables the local Administrator account and this causes issues for any post provisioning scripts to run.

We will work through what is one of the simpler solutions to achieve success with deploying a Windows 10 workstation


Considerations

  • Are using the appropriate version of Windows 10 (Windows 10 home is not supported)

  • Have a template created for Windows 10 that has been converted back to a VM

  • Know how to create a Server Action in CloudBolt CMP

  • Know how to add an action to a blueprint


Procedure

Adding the SetupComplete.cmd file to you Windows 10 template

In this section, we will create a part of the sys prep file and store it on the Windows 10 Template. This is required in order to enable the Local Administrator account and have it ready for scripts to run.

  1. In your Windows 10 VM, create the folder path c:\windows\Setup\Scripts

  2. Create a file called SetupComplete.cmd and edit this file

  3. Add the following lines to this file and then save the file

    :Enable Admin Account
    net user Administrator /ACTIVE:YES
    
    :Reboot System
    shutdown /r

  4. Shutdown the VM and convert it back to a template

Adding a Sleep action before

We will add a sleep action to your blueprint in order to provide time for your Windows 10 deployment to reboot. The reason for the reboot is to allow you to utilize the Administrator account as part of your deployment ie; Domain Join, run scripts etc.

  1. Create a Server Action, in this example we will name it Windows 10 Sleep

  2. In the file location place a check in Enter code later

  3. Click on Create

  4. Locate your server action, click the arrow to drop down then paste in the following code snippet and click on Save


    """
    This is a working sample CloudBolt plug-in for you to start with. The run method is required,
    but you can change all the code within it. See the "CloudBolt Plug-ins" section of the docs for
    more info and the CloudBolt forge for more examples:
    https://github.com/CloudBoltSoftware/cloudbolt-forge/tree/master/actions/cloudbolt_plugins
    """
    import time 
    from common.methods import set_progress
    
    def run(**kwargs): 
        seconds_to_sleep = "60" 
        seconds_to_sleep = int(seconds_to_sleep) 
        set_progress("Sleeping for {} seconds".format(seconds_to_sleep)) 
        time.sleep(seconds_to_sleep) 
        return "", "", ""

  5. Click on the Plugin name

  6. Click on the button that says Not Shared and change it to say Shared

  7. Go to your Windows 10 blueprint and add the Action you created to your blueprint. In this example you will see it is just after the Windows10 Server build but before the Join OU in AD Domain

  8. You can set this item to not show on order form if require by dropping down the Windows 10 Sleep Action and clicking to If Needed under Show on order form.

  9. Now you can deploy your Windows 10 Blueprint and the local admin account will be enabled and scripts after deployment will run as required with the local admin account.

  10. An example deployment for me was to do a Join OU in AD Domain after build. Which works without fault now.

Additional information

CloudBolt Blueprint Actions : https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/blueprint-actions
CloudBolt Actions : https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/actions
Microsoft how to enable local admin on Windows 10 : https://www.onmsft.com/how-to/how-to-enable-the-default-administrator-account-in-windows-10
Microsoft Add a custom script to Windows Setup : https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-a-custom-script-to-windows-setup

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.