Starting with Windows 10 insider build 16179 and later, the Hyper-V Team introduced a new feature targeting Windows 10 (desktop only) to use automatic checkpoint by default when you create a new VM.
When you start a virtual machine that doesn’t have any checkpoints, Hyper-V will create one for you so that you can easily roll back to it if something goes wrong, then Hyper-V will clean it up once the virtual machine shuts down cleanly.
New virtual machines will be created with “Use automatic checkpoints” enabled by default, but you will have to enable it yourself to use it for existing VMs. Please note that this option is Off by default on Windows Server. This option can be found under Settings -> Checkpoints -> Use automatic checkpoints.
The checkpoint will only be taken automatically when the VM starts on Windows 10 if it doesn’t have other existing checkpoints. You can deactivate this option for every VM using Hyper-V Manager as shown in the screenshot above. At the time of writing this article, you cannot use Windows Admin Center to disable automatic checkpoints.
You can also use the following PowerShell command to disable Automatic Checkpoints:
Set-VM -Name <VMNAME> -AutomaticCheckpointsEnabled $false
This feature is VM specific, in other words, you need to disable it for every new VM you create on Windows 10 Hyper-V host. There is no central option to deactivate this feature globally.
In this post, I will share with you a workaround that you can use to disable Automatic Checkpoints on Windows 10.
This workaround was tested based on Windows 10, version 1809 and 1903. At the time of writing this article, there is a bug on Windows 10, version 1909 where the event IDs 18304 and 13002 are not created under Hyper-V-VMMS event logs as described below. Please add your vote here to track this bug.
Disable the use of automatic checkpoints
To disable this feature globally on Windows 10 Hyper-V host, I will use a PowerShell script and Task Scheduler to automate this process.
When you create a new VM on Windows 10 Hyper-V or on Windows Server Hyper-V, Windows writes two events 18304 and 13002 to Hyper-V-VMMS event logs.
Event ID 18304, Hyper-V-VMMS
Event ID 13002, Hyper-V-VMMS
I will use one of those event logs to attach a task scheduler that will trigger a PowerShell script and disable the automatic checkpoint when a new VM is created.
The PowerShell script that I will use in this example is the following:
param( [string]$VmId ) Set-VM -Name (Get-VM -Id $VmId).name -AutomaticCheckpointsEnabled $false
Save the script locally on your Windows 10 machine or on a shared system in your environment with the appropriate permissions. Please note the path since we need to use it later to reference the script in the following step.
I want to mention here that I am using the VmId instead of VMName, the reason is to have the script works with Virtual Machines that have spaces in their names.
In this step, I need to create a task scheduler.
Create a new VM and open Event Viewer and look for Event ID 13002 under Microsoft-Windows-Hyper-V-VMMS/Admin.
Right-click this event and choose Attach Task To This Event… follow the wizard as shown in the below clip, make sure to enter the path of the PowerShell script under Add arguments with the -VmId $(VmId) parameter, then export the task locally and finally delete the task. Please note that the VmId between (brackets) is case-sensitive.
Open the exported XML file in Notepad++ and modify the file to add/pass the value of the VmId under </Subscription> as shown below. In this example, I am inserting the following in line 13 to line 15.
Save the XML file and then import it back to Task Scheduler as shown in the below video, please make sure to set the following 2 options, in this way the task will run in the background every time you create a new VM:
- Run whether the user is logged on or not.
- Do not store password. The task will only have access to local resources.
Test automatic checkpoints
To test that automatic checkpoints are disabled now, create a new VM on Windows 10 Hyper-V host and then open its settings to see that the Use automatic checkpoints are disabled!!!
Now, whenever you create a new VM, PowerShell will fire up and set the automatic checkpoints to disable.
Hope this helps!!!
Learn more 📕
Thank you for reading my blog.
If you have any questions or feedback, please leave a comment.