Configure the Page File Size on Windows 2008 Server Core

I recently ran into an issue where I couldn’t start any additional virtual machines on a Hyper-V server that was running Windows Server 2008 R2 Enterprise Edition - Core Installation (no GUI). After a little research, I determined that the operating system had created a pagefile of over 100 gigabytes in size which was using up the majority of the DAS in the server. The server has 96GB of RAM which is the reason why the operating system automatically configured such a large pagefile. The VM’s are located on a SAN, but by default Hyper-V places a file on local disk that is the size of the VM’s configured memory when the VM is started. I’ve also seen where a server will automatically move the pagefile from say “C” drive to “D” drive on boot if it wants more space than is available on “C” drive. I recommend manually configuring the pagefile to keep this from happening and possibly creating problems such as VM’s that have been running fine being unable to start after a host server restart.

To manually configure the pagefile settings, first turn off automatic management of the pagefile using the following command:


wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False

Then set the pagefile location and size using the following command. In the example below, a 10GB pagefile is created and placed in the root of the “C” drive.


wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=10240,MaximumSize=10240

There are plenty of best practice documents on paging file size and location available on the Internet so I won’t cover those topics.