Shrink the Windows Page File on VMs with a Group Policy Registry Preference

I run a lot of virtual machines on a tight budget with thin-provisioned storage, so wasted disk space bothers me. A large default page file on every Windows VM adds up quickly. To keep it in check, I set a fixed page file size with a registry preference in my “Server Optimization” GPO.

GPO Location

Computer Configuration
  Preferences
    Windows Settings
      Registry

Registry Item Settings

ActionUpdate
HiveHKEY_LOCAL_MACHINE
Key pathSYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
Value namePagingFiles
Value typeREG_MULTI_SZ
Value datac:\pagefile.sys 1000 1000

The value data sets the page file on C: to a fixed 1,000 MB (initial and maximum size). On the Common tab, I leave all options (stop processing on error, remove when no longer applied, apply once) set to No.

Slap that in your GPO, and the change takes effect after the next Group Policy refresh and reboot.