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.
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:
- Upload using the AzCopy command-line utility
- Upload using the Microsoft Azure Storage Explorer
- Upload using the PowerShell console
The following steps walk you through creating a custom image from a VHD file using the Azure portal:
Sign in to the Azure portal.
Select All services, and then select DevTest Labs from the list.
From the list of labs, select the desired lab.
On the lab's main pane, select Configuration and policies.
On the Configuration and policies pane, select Custom images.
On the Custom images pane, select +Add.
Enter the name of the custom image. This name is displayed in the list of base images when creating a VM.
Enter the description of the custom image. This description is displayed in the list of base images when creating a VM.
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.
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.
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
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.
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.
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.