In this article, you learn how to enable and disable hibernation in Microsoft Dev Box. You control hibernation at the dev box image and dev box definition level.
Hibernating dev boxes at the end of the workday can help you save a substantial portion of your virtual machine (VM) costs. It eliminates the need for developers to shut down their dev box and lose their open windows and applications.
With the introduction of Dev Box Hibernation (Preview), you can enable this capability on new dev boxes and hibernate and resume them. This feature provides a convenient way to manage your dev boxes while maintaining your work environment.
There are three steps to enable hibernation:
Enable hibernation on your dev box image
Enable hibernation on your dev box definition
Automate hibernation of pools of dev boxes using auto-stop schedules, or stop on RDP disconnect.
Important
Dev Box Hibernation is currently in PREVIEW.
For more information about the preview status, see the Supplemental Terms of Use for Microsoft Azure Previews. The document defines legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
Considerations for hibernation-enabled images
Before you enable hibernation on your dev box, review the following considerations for hibernation-enabled images.
Currently, two SKUs support hibernation: 8 and 16 vCPU SKUs. Currently, 32 vCPU SKUs don't support hibernation.
You can enable hibernation only on new dev boxes created with hibernation-enabled dev box definitions. You can't enable hibernation on existing dev boxes.
You can hibernate a dev box only by using the Microsoft developer portal, the Azure CLI, PowerShell, SDKs, and the REST API. Hibernating from within the dev box in Windows isn't supported.
If you're working with an Azure Marketplace image, we recommend using the Visual Studio for dev box images.
The Windows 11 Enterprise CloudPC + OS Optimizations image contains optimized power settings, and they can't be used with hibernation.
After you enable hibernation, you can't disable the feature on that dev box. However, you can disable hibernation support on the dev box definition so dev boxes created in the future don't have hibernation.
To enable hibernation, you need to enable nested virtualization in your Windows OS. If the "Virtual Machine Platform" feature isn't enabled in your DevBox image, DevBox automatically enables nested virtualization for you if you choose to enable hibernation.
Hibernation doesn't support hypervisor-protected code integrity (HVCI)/ Memory Integrity features. Dev box disables this feature automatically.
Auto-stop schedules will hibernate Dev Boxes that were created after you enabled hibernation on the associated Dev Box definition. Dev Boxes that were created before you enabled hibernation on the Dev Box definition will continue to shut down.
The following settings are known to be incompatible with hibernation, and aren't supported for hibernation scenarios:
Memory Integrity/Hypervisor Code Integrity
To disable Memory Integrity/Hypervisor Code Integrity:
In the Windows Start menu, find and open Windows Security.
Go to Device Security.
Under Core Isolation, select Core Isolation details
Under Memory integrity, set the toggle to Off.
After you change this setting, you need to restart the machine.
Guest Virtual Secure Mode based features without Nested Virtualization enabled
To enable Nested Virtualization:
In the Start menu, search for Turn Windows features on or off.
In the dialog, select the Virtual Machine Platform checkbox.
Select OK to save your setting changes.
Enable hibernation on your dev box image
If you plan to use a custom image from an Azure compute gallery, you need to enable hibernation capabilities when you create the new image. You can't enable hibernation for existing images.
Note
The Visual Studio and Microsoft 365 images that Microsoft Dev Box provides in Azure Marketplace are already configured to support hibernation. You don't need to enable hibernation on these images, they're ready to use.
To enable hibernation capabilities, set the IsHibernateSupported flag to true when you create the image:
az sig image-definition create
--resource-group <resourceGroupName> --gallery-name <galleryName> --gallery-image-definition <imageName> --location <location>
--publisher <publisherName> --offer <offerName> --sku <skuName> --os-type windows --os-state Generalized
--features "IsHibernateSupported=true SecurityType=TrustedLaunch" --hyper-v-generation V2
If you're using sysprep and a generalized VM to create a custom image, capture your image by using the Azure CLI:
az sig image-version create
--resource-group <resourceGroupName> --gallery-name <galleryName> --gallery-image-definition <imageName>
--gallery-image-version <versionNumber> --virtual-machine <VMResourceId>
In Microsoft Dev Box, you can enable hibernation for a new dev box definition when the definition uses a hibernation-enabled custom or Azure Marketplace image. You can also update an existing dev box definition that uses a hibernation-enabled custom or Azure Marketplace image.
All new dev boxes created in dev box pools that use a dev box definition with hibernation enabled can both hibernate and shut down. If a pool has dev boxes that were created before hibernation was enabled, those dev boxes continue to support shutdown only.
Microsoft Dev Box validates your image for hibernate support. Your dev box definition might fail validation if hibernation can't be successfully enabled by using your image.
You can enable hibernation on a dev box definition by using the Azure portal or the Azure CLI.
If you enable hibernation on a Dev Box definition, but the definition reports that hibernation couldn't be enabled:
We recommend using the Visual Studio for Dev Box marketplace images, either directly, or as base images for generating your custom image.
The Windows + OS optimizations image contains optimized power settings, and they can't be used with hibernation.
If you're using a custom Azure Compute Gallery image, enable hibernation on your Azure Compute Gallery image before enabling hibernation on your Dev Box definition.
If hibernation can't be enabled on the definition even after you enable it on your gallery image, your custom image likely has a Windows configuration that prevents hibernation.
If you have issues provisioning new VMs after you enable hibernation on a pool, you can disable hibernation on the dev box definition. You can also disable hibernation when you want to revert the setting to only shutdown dev boxes.
You can disable hibernation on a dev box definition by using the Azure portal or the CLI.
Azure HPC is a purpose-built cloud capability for HPC & AI workload, using leading-edge processors and HPC-class InfiniBand interconnect, to deliver the best application performance, scalability, and value. Azure HPC enables users to unlock innovation, productivity, and business agility, through a highly available range of HPC & AI technologies that can be dynamically allocated as your business and technical needs change. This learning path is a series of modules that help you get started on Azure HPC - you