Where is the VMRS file written, is it in ssd or in ram?

fitra rahim 0 Reputation points
2023-07-17T02:03:21.94+00:00

I'm running Linux on top of virtualization using Hyper-V Manager. I have notice that when starting the VM, it's also makes a big file (4 GB) something like :

91224D9F-298B-4809-A997-9792S03B0A36.vmrs

If i stop the VM, the file size decrease to become 48 KB. If i start again, it also becomes 4 GB again. and so on.

I'm doing some observation when starting the VM and look at the task manager and find out that my SSD isn't writing some big file, instead my RAM usage become higher, but task manager can't inspect Hyper-V process usage (Need RAMMap to do that). I also check the total amount of TBW on my ssd (SMART) before vs after i started the VM, it didn't change.

So, my question is where the VMRS file is written, is it in ssd or in ram?

Note : I specified my VM RAM 4096 MB (4GB).

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,809 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 44,506 Reputation points
    2023-07-17T13:25:48.95+00:00

    Hello,

    In the case of Hyper-V Manager, the VMRS file you mentioned is used for saving the runtime state of the virtual machine (similar to a hibernation file). This file is responsible for quickly starting or resuming the virtual machine.

    The VMRS file is initially created with a larger size (4 GB in your case) to accommodate the entire state of the virtual machine, including its memory contents. When you stop the virtual machine, the contents of the memory are saved in this file, resulting in a large size. However, when the virtual machine is stopped, the file size decreases significantly (48 KB) because it only needs to retain essential information for resuming the virtual machine.

    Regarding the location of the VMRS file, it is typically stored on the host machine's disk, specifically in the same directory as the virtual machine's configuration files. By default, this is usually on the system drive where Hyper-V is installed. So, it is likely that the VMRS file is written to your SSD.

    Although the RAM usage of your host machine increases when you start the virtual machine, the VMRS file itself is stored on disk. The increased RAM usage is because the memory allocated to the virtual machine is reserved in the host's RAM, allowing the virtual machine to run efficiently.

    It's worth noting that you can change the location of the VMRS file by modifying the virtual machine's settings in Hyper-V Manager. However, it's generally recommended to leave it in its default location for optimal performance.

    If you have concerns about the impact on your SSD, it's important to ensure that your SSD is of good quality and properly configured for virtualization workloads. SSDs are designed to handle a significant number of read and write operations, including temporary files like the VMRS file used for virtual machine state. Monitoring your SSD's health using tools like SMART is a good practice to keep track of its condition.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments

  2. Dan Olsen 0 Reputation points
    2025-02-03T15:10:41.05+00:00

    The behavior you observe is due to it using a memory-mapped file feature of the OS.

    When a file is memory-mapped, Windows reserves the necessary disk space for the file, but it doesn't immediately load the file's contents into memory or write changes back to disk. Instead, it uses a 'lazy loading and writing' approach, which means that memory usage only changes as parts of the file are accessed and loaded into memory on demand, and file contents are written back to disk only as needed. This allows efficient access to the file's data and deferred disk writes, reducing both memory usage and I/O operations.

    So, the answer to your question "Where is the VMRS file written, is it in SSD or in ram?" is YES! :-)

    As you observed it is written and to RAM at first, but it is backed by a file to be used if the OS is under memory usage pressure or is asked to persist the memory-mapped to disk. But until it needs to go to disk the RAM is many times faster.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.