Create a custom image from a VHD file

In Azure DevTest Labs, custom images enable you to create VMs quickly without waiting for all the required software to be installed on the target machine. Custom images allow you to pre-install all the software that you need in a VHD file, and then use the VHD file to create a VM. Because the software is already installed, the VM creation time is much quicker. In addition, custom images can be used to clone VMs by creating a custom image from a VM, and then creating VMs based on that custom image.

Prerequisites

To complete this tutorial, you must have a VHD file uploaded to the storage account associated with the lab in which you are creating the custom image. Select any of the following links to upload a VHD file:

Step-by-step instructions

The following steps walk you through creating a custom image from a VHD file using the Azure portal:

  1. Sign in to the Azure portal.

  2. Select All services, and then select DevTest Labs from the list.

  3. From the list of labs, select the desired lab.

  4. On the lab's main pane, select Configuration and policies.

  5. On the Configuration and policies pane, select Custom images.

  6. On the Custom images pane, select +Add.

    Add Custom image

  7. Enter the name of the custom image. This name is displayed in the list of base images when creating a VM.

  8. Enter the description of the custom image. This description is displayed in the list of base images when creating a VM.

  9. For OS type, select either Windows or Linux.

    • If you select Windows, specify via the checkbox whether sysprep has been run on the machine.
    • If you select Linux, specify via the checkbox whether deprovision has been run on the machine.
  10. Select a VHD from the drop-down menu. This is the VHD that will be used to create the new custom image. If necessary, select to Upload a VHD using PowerShell.

  11. You can also enter a plan name, plan offer, and plan publisher if the image used to create the custom image is not a licensed image (published by Microsoft).

    • Plan name: Enter the name of the Marketplace image (SKU) from which this custom image is created
    • Plan offer: Enter the product (offer) of the Marketplace image from which this custom image is created
    • Plan publisher: Enter the publisher of the Marketplace image from which this custom image is created

    Note

    If the image you are using to create a custom image is not a licensed image, then these fields are empty and can be filled in if you choose. If the image is a licensed image, then the fields are auto populated with the plan information. If you try to change them in this case, a warning message is displayed.

  12. Select OK to create the custom image.

After a few minutes, the custom image is created and is stored inside the lab’s storage account. When a lab user wants to create a new VM, the image is available in the list of base images.

Custom image available in list of base images

Get started with Azure DevTest Labs

New to Azure? Create a free Azure account.

Already on Azure? Get started with your first lab in DevTest Labs.

Get started with Azure DevTest Labs in minutes

Next steps