Create a custom image from a VM

In this article, you learn how to create a custom image from a provisioned Azure DevTest Labs virtual machine (VM).

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.

The custom image includes the OS disk and all the data disks attached to the VM. Lab users can use the custom image to create identical provisioned lab VMs.

Step-by-step instructions

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

  1. In the Azure portal, on your lab's Overview page, select the VM to use for the image from the My virtual machines list.

    Screenshot that shows a V M selected on a lab's Overview page.

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

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

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

    • I have not generalized this virtual machine if you haven't run sysprep and don't want to run sysprep on the VM when creating the custom image.
    • I have already generalized this virtual machine if you already ran sysprep on the VM.
    • Generalize this virtual machine (Run sysprep) if you haven't run sysprep and you want sysprep to be run on the VM when creating the custom image.
  5. Select OK.

    Screenshot that shows the Create custom image selection on a V M's Overview page.

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

Screenshot that shows custom images available in the list of VM base images.

Next steps