How to reset a vm completely.

Alex Advent 0 Reputation points
2024-02-29T14:57:41.05+00:00

Someone just injected malware into my VM. I need to reset it to a clean, new state completely. I tried redeploying and reapplying the VM, but my data remains. I want a fresh start.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,129 questions
Azure VMware Solution
Azure VMware Solution
An Azure service that runs native VMware workloads on Azure.
317 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jackson Martins 9,646 Reputation points MVP
    2024-02-29T15:07:35.7566667+00:00

    Hi @Alex Advent

    There is no way to wipe the virtual machine with just the machine's native resources, if the machine is powering on you can try using an antivirus or Microsoft Defender, but the easiest process to get the machine back on is Restoring your VM from a backup or snapshot taken before infection is one of the most effective ways to return to a clean state

    Get in touch if you need more help with this issue.

    --please don't forget to "[Accept the answer]" if the reply is helpful--


  2. kobulloc-MSFT 23,416 Reputation points Microsoft Employee
    2024-02-29T21:07:46.75+00:00

    Hello, @Alex Advent !

    How do I redeploy my VM with a clean slate?

    I'd like to second what @Jackson Martins has recommended as VM restore points were designed with this scenario in mind.

    If you are unable to use restore points and simply want a recreation of your VM when it was first deployed, you can leverage Automation > Export template. This offers the option to Deploy using original values or with changes to the configuration. While there are some limitations to using Deploy, the information from the template or even the JSON from the resource overview will give you information you can use for a clean deployment.

    https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/export-template-portal

    Export template from the resource group with the Deploy option

    User's image

    JSON view from the resource Overview

    User's image


    I hope this has been helpful! Your feedback is important so please take a moment to accept answers. If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A! User's image

    0 comments No comments