Introduction
A .vmem file holds the RAM of a running VMware virtual
machine, or the RAM at the time a snapshot was taken (<name>.vmem or
<name>-Snapshot<##>.vmem, from VMware's article on the contents of a Fusion bundle).
It is the guest's physical memory as raw bytes.
Structure
The file has no header and no structure of its own. Where each run of it belongs in the guest's physical
address space is recorded in the .vmss or
.vmsn file with the same name. Volatility 3's stacker looks
for <name>.vmss and then <name>.vmsn beside the .vmem; with neither it
gives up on the file as a VMware layer (it warns that "a VMSS or VMSN file may be required"). With one,
each region i of the memory group maps guest physical address regionPPN[i] × 4096
onto offset regionPageNum[i] × 4096 of the .vmem, for regionSize[i] × 4096 bytes.
Volatility 3 refuses a .vmem whose state file has no regions ("not split into regions"). The reader fixes the page size at 4096, so the mapping is in whole pages. The state file's header, groups and tags that carry these numbers are described on the
.vmss page; Volatility 3 reads only the group named
memory and needs the tags regionsCount, regionPPN,
regionPageNum and regionSize.
Volatility 2 works differently: its VMware address space is given the .vmss or .vmsn file itself, whose
Memory tag holds the memory inside the state file. If regionsCount is absent or 0 it
takes the whole Memory tag as one run from physical address 0; otherwise run i maps
regionPPN[i] × 4096 onto Memory data offset + regionPageNum[i] × 4096,
for regionSize[i] × 4096 bytes. So the one-run case belongs to the memory stored inside the
state file, not to a separate .vmem. (An earlier version of this page said Volatility 2 read the missing-regions
.vmem as one run; that was not what its source does.)
Meaning and lifetime, from VMware's own pages: the Fusion bundle article says the .vmem stores "the RAM of a
running virtual machine, or the RAM at the time the snapshot was taken" and names it
<vmname>.vmem or <vmname>-Snapshot<##>.vmem; the vSphere administration
guide lists <vmname>.vmem as the "virtual machine paging backup file". The
mainMem.useNamedFile setting in the .vmx decides whether
the machine's memory is backed by a named file: a VMX parameter list (sanbarrow.com) says it silently defaults to
"true" and should be set to "false" if you do not want the memory file used for
swapping. Forum posts (not VMware documentation, so only reported behaviour) say that with the setting false no
.vmem file is made while the machine runs, and that a suspend and resume then needs a file of the machine's
memory size.
The viewer shows the size in pages and, when the state file was opened with it (a dropped folder), the memory runs it lists. It does not interpret the memory.
Not described
Unknown
- Viewer: the content of the memory (page tables, kernel structures) is not interpreted: that is memory forensics, and depends on the guest operating system.
- Reference: VMware has published no layout for the file: Broadcom's Fusion bundle article, the vSphere virtual machine files table and the Workstation documentation index give only its purpose. The mapping above is Volatility's (versions 2 and 3, two readers agreeing on the page arithmetic). Not known from any source read: the exact moments the file is created, grown or deleted (only forum reports), whether the file is always the guest's whole RAM or can be smaller than the guest's memory size, and how ESXi or other VMware products write it.
Links
Software
- VMware Workstation Pro – VMware's desktop virtual machine software (Windows, Linux)
- VMware Fusion – VMware's virtual machine software for the Mac (macOS)
- Volatility 3 – memory forensics framework that reads .vmem files with their state file (Python)
Reference
- layers/vmware.py – Volatility 3's reader for .vmem with its metadata file
- addrspaces/vmware.py – Volatility 2's reader for .vmss and .vmsn files
- Contents of the virtual machine bundle in Fusion – VMware's description of the .vmem
- Virtual machine files – the vSphere table that calls the .vmem the paging backup file
- Advanced VMX parameters – the mainMem.useNamedFile setting