The VM’s Faulty Pagefile

Recently I was having an issue with one of my Virtual Machines, specifically the one I use for accounting purposes. Each time I booted the VM I would get an error stating that there was an error with the paging file. Me being me, I ignored it and continued on about my task, with a case of “its only my stuff I will deal with it later” and putting the issue out of my mind. However I then started to get errors in the software I was using, thinking, “oh great what now” I looked at a few things and then came back to this error, which as it turns out, was the cause of the symptoms I was seeing in the software package I was using.

Windows created a temporary paging file on your computer because of a problem that occured with your paging file configuration when you started your computer. The total paging file size for all disk drives may be somewhat larger than the size you specified

Now what does this mean, well it can mean one of several things. Most commonly, expecially on a VM it means that the disk is full to a point where Windows cannot create the paging file when it starts up.

Luckily this is a simple fix, which I am not going to take you through here as the way it is done is entirely dependent on your paticular hypervisor (most commonly Hyper-V, VMWare, Parallels or VirtualBox), this does however assume you have the space free to increase the size of the virtual disk, if you do not have space, you will need to clear some files off the VM to make space.

Ok, but what if you have plenty of space. Well their are two options off the top of my head that make work, one is removing and then recreating the paging file as it may have become corrupted, especially if the system had an unclean shutdown (powered off instantly such as a power failure) or you may need to run a system file check to clean up any errors.

Whilst neither are hard to do, both can take some time to complete. I would suggest starting with the system file scan as it is the easier of the two to do and the more comprehensive, but both options are outlined below

System File Scan

To do this you need to open an administrative command prompt

Open an Administrative Command Prompt
Open an Administrative Command Prompt

 

Once you are in the command prompt type;

sfc /scannow

Type sfc /scannow
Type sfc /scannow

 

This tool will now run (which may take some time), and verify the files Microsoft has put into the system to validate they are the correct files, if they are not and have been replaced or otherwise modified, it will replace them with the original file. This process may take some time depending on the hardware you are running it on

SFC Running - This may take a while
SFC Running – This may take a while

 

Once complete, you need to restart the PC, and the SFC tool tells you as much

SFC has completed it task, now it wants you to reboot your PC
SFC has completed it task, now it wants you to reboot your PC

 

Restart your PC and see if the issue has been resolved, if not you may try to manually delete and recreate the pagefile as outlined as below.

 

Manual Removal and Recreation of the Pagefile

 

Having logged into your system as an account with administrative rights (or otherwise authorised yourself for administrative access to the system panel) you need to open the system properties display on the system, or if the dialogue box with the warning pops up then click OK and the Pagefile controls will open, allowing you to skip the first section

 

    1. Firstly, if the Paging file settings display is not open we need to open it, do this by

      a) Right Clicking on
      If it’s not already open, open the virtual memory settings by rich-clicking on Computer, → Properties → Advanced System Settings → click the Advanced tab → Under Performance, click Settings, go to Advanced tab, finally under Virtual Memory section click the Change button.

 

    1. Uncheck the Automatically manage paging file size for all drives checkbox.

 

    1. Set a “Custom size” for the paging file on the C drive: 0MB initial, 0MB maximum.

 

    1. Click OK, close all dialog boxes, and restart your computer.

 

    1. After logging in again, delete the file C:\pagefile.sys
        1. To do this, you may need to change your folder settings so you can see it first. Open a window of your C: drive and click Organize at the top, then Folder and Search Options
        1. Click the View tab, and make sure Show hidden files, folders and drives is turned on, and that Hide protected system files is not checked.
      1. Click OK and go back to your C: drive, find pagefile.sys and delete it.

 

    1. Now go back to the virtual memory settings (see step 2 above) and set the paging file for the C: drive to System managed size, and then make sure the Automatically manage paging file size for all drives checkbox is checked.

 

    1. Click OK, close all dialog boxes, and restart your computer.

Written By Justin

Leave a Reply

Your email address will not be published. Required fields are marked *

17 − 2 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.