VM did not get added to Host pool when created from a Generalized gallery Image.

Dharmendar Parmar 0 Reputation points

Created a Host pool with a VM in it and then created a Generalized image of that VM when I tried to create a new VM with that generalized image the VM got created but did not get added to the Host pool session host.

Steps followed to create a generalized image:

  1. Installed all available updates.
  2. Run Disk Cleanup.
  3. Leave the Azure AD
  4. Removed the VM from the Host Pool
  5. Run Sysprep to Generalize the VM
  6. Captured an Image in the Compute Gallery.
Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,178 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Muhammad Umair 80 Reputation points

    Creating a VM from a generalized image and adding it to an Azure Virtual Desktop (formerly Windows Virtual Desktop) host pool involves a few steps, and there are some common issues that might cause the VM not to appear in the host pool. Here are some troubleshooting steps to follow:

    Image Generalization: Ensure that the VM image was successfully generalized before creating the new VM. Generalization is a process that prepares the VM for duplication. You can generalize a VM using Sysprep (Windows) or waagent (Linux).

    Custom Script Extension: If you're using a custom image, make sure that it includes the necessary configurations and extensions to join the Azure Virtual Desktop host pool. You might need to run custom scripts during VM provisioning to ensure it's correctly configured.

    Agent Registration: Check if the Azure Virtual Desktop agent is installed and correctly registered on the new VM. The agent is responsible for connecting the VM to the host pool. You can review the agent's status and logs for any errors.

    Network Configuration: Ensure that the VM has the necessary network connectivity to reach the Azure Virtual Desktop service. Check for any network issues or firewall rules that might be blocking communication.

    Registration Token: Verify that you've configured the host pool correctly and used the correct registration token when creating the new VM. The registration token is necessary for the VM to associate with the host pool.

    VM Pool Assignment: Make sure that the new VM is assigned to the correct VM pool within the host pool configuration. VMs are associated with specific pools.

    Diagnostic Logs: Check the Azure Virtual Desktop diagnostic logs and events in the Azure portal for any errors or issues related to VM registration and pool assignment.

    Update Configuration: If you've made changes to your VM image or host pool configuration, ensure that these changes are correctly reflected in the new VM.

    If you've gone through these steps and are still experiencing issues, it might be helpful to review the Azure Virtual Desktop documentation and consider reaching out to Azure support for more specific assistance with your setup. Troubleshooting Azure Virtual Desktop configurations can sometimes be complex, and support can provide tailored guidance based on your specific environment and setup.

  2. kobulloc-MSFT 17,196 Reputation points Microsoft Employee

    Hello, @Dharmendar Parmar ! What you've described closely aligns with how you would create a golden image however I want to make sure that no steps have been overlooked.

    How do I create a golden image for Azure Virtual Desktop?

    This is based on the following guide that walks you through how to use the Azure portal to create a custom image to use for your Azure Virtual Desktop session hosts:


    The order of operations are as follows:

    1. Make sure the OS you choose is supported (see recommendations).
    2. Make sure the VM used for taking the image does not have the "Login with Azure AD" flag.
      (You noted this in step 3).
    3. Create a base VM for your chosen image and take your first snapshot.
    4. Update the OS and cleanup as needed (temporary files, etc.). Disable antivirus before running sysprep and note that Unified Write Filter (UWF) is not supported.
      (You completed this as step 1 and 2).
    5. Do not join your golden image VM to a host pool. The image will conflict with the existing VM's configuration, and the new VM won't work.
      (You completed this as step 4).
    6. Reboot the VM.
    7. Clean up temp files in system storage, optimize drivers/defrag, and remove any user profiles.
    8. Generalize the VM by running sysprep.
      (You completed this in step 5).
    9. Capture the VM (either in shared image gallery or as a managed image).
      (You completed this in step 6).


    • Don't capture a VM that already exists in your host pools. The image will conflict with the existing VM's configuration, and the new VM won't work.
    • Make sure to remove the VM from the domain before running sysprep.
    • Delete the base VM once you've captured the image from it.
    • After you've captured your image, don't use the same VM you captured again. Instead, create a new base VM from the last snapshot you created. You'll need to periodically update and patch this new VM on a regular basis.
    • Don't create a new base VM from an existing custom image. It is better to start with a brand-new source VM.

    If you are still having issues, let us know in the comments and we can continue to troubleshoot this.

    I hope this has been helpful! Your feedback is important so please take a moment to accept answers. Thank you for helping to improve Microsoft Q&A!

    User's image

    0 comments No comments