Skip to content

Latest commit

 

History

History
59 lines (38 loc) · 3.54 KB

File metadata and controls

59 lines (38 loc) · 3.54 KB
title Create a custom image from a lab VM
description Learn how to create a custom image from an Azure DevTest Labs virtual machine (VM) by using the Azure portal.
ms.topic how-to
ms.author rosemalcolm
author RoseHJM
ms.date 04/02/2025
ms.custom
UpdateFrequency2
sfi-image-nochange

Create a custom image from a VM in DevTest Labs

In this article, you learn how to create a custom image from a provisioned Azure DevTest Labs virtual machine (VM). The custom image includes the OS disk, attached data disks, and any artifacts associated with the VM. Lab users can use the custom image to create identical provisioned lab VMs.

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

Prerequisites

  • Owner or Contributor role in a lab that has an existing VM.

Create the custom image

To create a custom image from a lab VM, take the following steps:

  1. On your lab's Overview page in the Azure portal, select All resources from the left navigation menu.

  2. On the All resources page, select the VM to use for the image from the All virtual machines list.

    :::image type="content" source="./media/devtest-lab-create-custom-image-vm/overview-page.png" alt-text="Screenshot that shows a VM selected on a lab's All resources page.":::

  3. On the VM's Overview page, select Create custom image under Operations in the left navigation.

  4. On the Create custom image page, enter a Name and optional Description for the custom image.

  5. Under Image preparation, select one of the following options:

    • I have not generalized this virtual machine
    • I have already generalized this virtual machine
    • Generalize this virtual machine (for Windows: (Run sysprep) or for Linux: (Run deprovision))

    Sysprep for Windows or deprovision for Linux create generalized images that have user profiles and other VM-specific settings removed. If you don't run sysprep or deprovision, the custom image creates exact copies of the machine that can run in isolated networks. For more information, see Generalize a VM.

    If you want sysprep or deprovision to be run on the VM when creating the custom image, choose Generalize this virtual machine. Running sysprep or deprovision when you create the custom image makes the existing VM unusable.

  6. Select OK.

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

The custom image is created and stored in the lab's storage account. The image now appears on the Custom images list for the lab and is available in the list of base images for creating a new lab VM.

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

Related content