Configure hibernation in Microsoft Dev Box
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 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 two steps to enable hibernation:
- Enable hibernation on your dev box image
- Enable hibernation on your dev box definition
Important
Dev Box Hibernation is currently in PREVIEW. See the Supplemental Terms of Use for Microsoft Azure Previews for 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
The following SKUs support hibernation: 8, 16 vCPU SKUs. 32 vCPU SKUs do not 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 using the dev Portal, CLI, PowerShell, SDKs, and API. Hibernating from within the dev box in Windows isn't supported.
If you use a 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.
Once enabled, you can't disable hibernation on a dev box. However, you can disable hibernation support on the dev box definition so that future dev boxes 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 still shutdown the dev boxes. If you want to hibernate your dev box, you can do it through the developer portal or using the CLI.
Note
The functionality to schedule dev boxes to hibernate automatically is available in preview. You can sign up for the preview here: Microsoft Dev Box - Auto-Hibernation Schedules Preview.
Settings not compatible with hibernation
These 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 start menu, search for memory integrity
- Select Core Isolation
- Under Memory integrity, ensure that memory integrity is set to Off.
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 Turn Windows features on or off, select Virtual Machine Platform, and then select OK
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 the 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 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>
For more information about creating a custom image, see Configure a dev box by using Azure VM Image Builder.
Enable hibernation on a dev box definition
In Microsoft Dev Box, you enable hibernation for a dev box definition, providing that the dev box definition uses a hibernation-enabled custom or marketplace image. You can also update an existing dev box definition that uses a hibernation-enabled custom or marketplace image.
All new dev boxes created in dev box pools that use a dev box definition with hibernation enabled can hibernate in addition to shutting down. If a pool has dev boxes that were created before hibernation was enabled, they continue to only support shutdown.
Microsoft Dev Box validates your image for hibernate support. Your dev box definition might fail validation if hibernation couldn't be successfully enabled using your image.
You can enable hibernation on a dev box definition by using the Azure portal or the CLI.
Enable hibernation for a dev box definition by using the Azure portal
Sign in to the Azure portal.
In the search box, enter dev center. In the list of results, select Dev centers.
Open the dev center that contains the dev box definition that you want to update, and then select Dev box definitions.
Select the dev box definition that you want to update, and then select the edit button.
On the Editing <dev box definition> page, select Enable hibernation.
Select Save.
Enable hibernation for a dev box definition by using the Azure CLI
az devcenter admin devbox-definition update
--dev-box-definition-name <DevBoxDefinitionName> -–dev-center-name <devcentername> --resource-group <resourcegroupname> –-hibernateSupport enabled
Disable hibernation on a dev box definition
If you have issues provisioning new VMs after enabling hibernation on a pool or you want to revert to shut down only dev boxes, you can disable hibernation on the dev box definition.
You can disable hibernation on a dev box definition by using the Azure portal or the CLI.
Disable hibernation for a dev box definition by using the Azure portal
Sign in to the Azure portal.
In the search box, enter dev center. In the list of results, select Dev centers.
Open the dev center that contains the dev box definition that you want to update, and then select Dev box definitions.
Select the dev box definition that you want to update, and then select the edit button.
On the Editing <dev box definition> page, clear Enable hibernation.
Select Save.
Disable hibernation for a dev box definition by using the CLI
az devcenter admin devbox-definition update
--dev-box-definition-name <DevBoxDefinitionName> -–dev-center-name <devcentername> --resource-group <resourcegroupname> –-hibernateSupport disabled
Related content
Feedback
Submit and view feedback for