Skip to content

Latest commit

 

History

History
70 lines (47 loc) · 4.57 KB

File metadata and controls

70 lines (47 loc) · 4.57 KB
title Create custom images for lab VMs from VHD files
description Use the Azure portal to create an Azure DevTest Labs virtual machine (VM) custom image from a virtual hard disk (VHD) file.
ms.topic how-to
ms.author rosemalcolm
author RoseHJM
ms.date 03/31/2025
ms.custom UpdateFrequency2

Create a custom image for an Azure DevTest Labs virtual machine from a VHD file

[!INCLUDE devtest-lab-create-custom-image-from-vhd-selector]

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.

[!INCLUDE devtest-lab-custom-image-definition]

Prerequisites

Create the custom image

To create a custom image for DevTest Labs from a VHD file, follow these steps:

  1. In the Azure portal, go to the lab that has the uploaded VHD file.

  2. On the lab Overview page, select Configuration and policies in the left navigation.

  3. On the Configuration and policies page, select Custom images under Virtual machine bases in the left navigation.

  4. On the Custom images page, select Add.

    :::image type="content" source="media/devtest-lab-create-template/add-custom-image.png" alt-text="Screenshot that shows the Custom image page with the Add button.":::

  5. 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.
  6. Select OK.

    :::image type="content" source="media/devtest-lab-create-template/create-custom-image.png" alt-text="Screenshot that shows the Custom image page.":::

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.

:::image type="content" source="media/devtest-lab-create-template/custom-image-available-as-base.png" alt-text="Screenshot that shows the Custom images available in the list of base images.":::

Related content