Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this article, you learn how to create an Azure DevTest Labs virtual machine (VM) custom image by using a virtual hard disk (VHD) file. This article describes how to create a custom image in the Azure portal. You can also use PowerShell to create a custom image.
In Azure DevTest Labs, you can use custom images to:
- Create a VM from a VHD file that has all the software you need preinstalled.
- Create VMs quickly, because you don't have to install all the required software on the target machines.
- Clone a VM by creating a custom image from a VM, and then creating VMs based on that image.
Prerequisites
Owner or Contributor permissions in the lab where you want to create the custom image.
A VHD file uploaded to the Azure Storage account for the lab. To upload a VHD file:
- Go to your lab storage account in the Azure portal and select Upload.
- Browse to and select the VHD file, select the uploads container or create a new container named uploads, and then select Upload.
You can also upload a VHD file by following the instructions in any of these articles:
Create the custom image
To create a custom image for DevTest Labs from a VHD file, follow these steps:
In the Azure portal, go to the lab that has the uploaded VHD file.
On the lab Overview page, select Configuration and policies in the left navigation.
On the Configuration and policies page, select Custom images under Virtual machine bases in the left navigation.
On the Custom images page, select Add.
Fill out the Custom image page as follows:
- Name: Enter a name for the custom image to display in the list of base images for creating a VM.
- Description: Enter an optional description to display in the base image list.
- OS type: Select whether the OS for the VHD and custom image is Windows or Linux.
- If you choose Windows, select the checkbox if you ran sysprep on the machine when you created the VHD file.
- If you choose Linux, select the checkbox if you ran deprovision on the machine when you created the VHD file.
- VHD Generation: Select whether you have a V1 (VHD) or V2 (VHDX) file.
- VHD: Select the uploaded VHD file for the custom image from the dropdown menu.
- Plan name, Plan offer, and Plan publisher: If the VHD isn't a licensed image published by Microsoft, optionally enter the name of the Marketplace image or SKU used to create the VHD, a product or offer name, and the plan publisher. If the image is a licensed image, these fields are prepopulated with the plan information.
Select OK.
After creation, the custom image is stored in the lab's storage account. The image appears on the lab Custom images page and on the list of VM base images for the lab. Lab users can create new VMs based on the custom image.