Hasleo Software Forums

Full Version: How do I set up a working paging file for Windows 11 Portable (VHDX on USB)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I’m running Portable Windows 11 at work by booting from a VHDX file offa a USB-C NVME enclosure (so not a raw USB install—this is using the VHDX method). The host PC only has 16GB RAM, and once my usual programs and dev tools are running, I run out of memory pretty quickly.

I’ve tried configuring a paging file (via System Properties > Advanced > Performance > Virtual Memory) with custom sizes, system managed, and letting Windows pick the defaults. But every time I restart, I get this popup:

Windows created a temporary paging file on your computer because of a problem that occurred 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 that you specified.

There’s never a persistent pagefile.sys in the VHDX’s root—just this error and a temporary paging file every session, which is only ~300MB.

I saw advice about changing the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PagefileOnOsVolume, but this key does not exist at all on my system.

Please advise.
Update: Even after creating the registry key PagefileOnOsVolume still getting same issue.
When booting Windows on a VHD(X) in Native Boot Mode (where Windows To Go belongs) instead of Virtual Machine Boot Mode, page files cannot be created in the VHD(X), which is a Microsoft limitation. Please refer to:
https://learn.microsoft.com/en-us/window...quirements
Here, Microsoft mentioned "The local disk partition that contains the VHDX file needs enough free disk space to expand a dynamic VHDX to its maximum size and to create the page file during the VHD boot process. The page file is created outside the VHDX file, unlike with a virtual machine where the page file is contained inside the VHD."

So to create page files for VHD(X)-based WTGs, you should ensure that the physical partition where the VHD(X) files are stored has enough free space and set the page files to be created in that physical partition.
(07-21-2025, 01:17 PM)admin Wrote: [ -> ]When booting Windows on a VHD(X) in Native Boot Mode (where Windows To Go belongs) instead of Virtual Machine Boot Mode, page files cannot be created in the VHD(X), which is a Microsoft limitation. Please refer to:
https://learn.microsoft.com/en-us/window...quirements
Here, Microsoft mentioned "The local disk partition that contains the VHDX file needs enough free disk space to expand a dynamic VHDX to its maximum size and to create the page file during the VHD boot process. The page file is created outside the VHDX file, unlike with a virtual machine where the page file is contained inside the VHD."

So to create page files for VHD(X)-based WTGs, you should ensure that the physical partition where the VHD(X) files are stored has enough free space and set the page files to be created in that physical partition.

That helped me resolve the persistent paging file issue with my Portable Windows 11 setup (booting via VHDX on a USB-C NVMe enclosure). Initially, I had set the VHDX file almost to the same size as the drive, essentially filling up all available space on the physical SSD. By shrinking the internal partition and the VHDX itself, I freed up enough space on the host drive. With this change, I was able to set the paging file on the physical SSD (outside the VHDX), which fixed the error about temporary paging files appearing on every reboot. Thank you for highlighting the Microsoft limitation and clearly explaining that, when booting natively from a VHD(X) file, the paging file must reside on the underlying physical disk.
(07-22-2025, 06:29 PM)bacevs Wrote: [ -> ]
(07-21-2025, 01:17 PM)admin Wrote: [ -> ]When booting Windows on a VHD(X) in Native Boot Mode (where Windows To Go belongs) instead of Virtual Machine Boot Mode, page files cannot be created in the VHD(X), which is a Microsoft limitation. Please refer to:
https://learn.microsoft.com/en-us/window...quirements
Here, Microsoft mentioned "The local disk partition that contains the VHDX file needs enough free disk space to expand a dynamic VHDX to its maximum size and to create the page file during the VHD boot process. The page file is created outside the VHDX file, unlike with a virtual machine where the page file is contained inside the VHD."

So to create page files for VHD(X)-based WTGs, you should ensure that the physical partition where the VHD(X) files are stored has enough free space and set the page files to be created in that physical partition.

That helped me resolve the persistent paging file issue with my Portable Windows 11 setup (booting via VHDX on a USB-C NVMe enclosure). Initially, I had set the VHDX file almost to the same size as the drive, essentially filling up all available space on the physical SSD. By shrinking the internal partition and the VHDX itself, I freed up enough space on the host drive. With this change, I was able to set the paging file on the physical SSD (outside the VHDX), which fixed the error about temporary paging files appearing on every reboot. Thank you for highlighting the Microsoft limitation and clearly explaining that, when booting natively from a VHD(X) file, the paging file must reside on the underlying physical disk.

Glad to hear that. Have a nice day!