Envirounment variables after capturing image and availbiltity in the new VM

sns 9,226 Reputation points
2023-12-04T16:36:45.1966667+00:00

I have VM, I have modifed system variable with 2 values

and now if I capture VM and then if i take new custom image out of it and if I create a new VM , and that will have environment variable I have created will it be available?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,544 questions
{count} votes

2 answers

Sort by: Most helpful
  1. TP 83,711 Reputation points
    2023-12-04T20:40:05.48+00:00

    Hi,

    Yes, if you set system environment variables in the source VM for the image they will be available in new VMs created from that image.

    Please click Accept Answer and upvote if the above was useful.

    Thanks.

    -TP

    0 comments No comments

  2. v-vvellanki-MSFT 4,915 Reputation points Microsoft Vendor
    2023-12-11T04:56:15.0466667+00:00

    Hi @sns ,

    Thanks for contacting Microsoft Q&A platform.

    System variables typically affect the entire operating system and all users. If you've modified a system variable, those changes should be captured when you create a new image from the VM. When you create a new VM from the custom image, it should inherit the state of the original VM at the time of capture, including the modifications made to system variables.
    Environment variables are often specific to a user session or a particular process. If you have modified environment variables, they might not be captured at the system level in the same way as system variables.

    Hope this helps.

    0 comments No comments