Do DMG and VHD Disk Images Have Metadata?

📄 7 min readUpdated November 16, 2026

Yes, in two layers. The image file has its own header: a VHD records the second it was created, a creator code and a unique ID, and an overlay disk stores the full path to its parent, user folder included. Then there's the file system inside, with a volume name, serial number, dates, owner IDs and, in our tests, every byte of a file we had deleted.

Which disk image formats store what?

We built images on Debian 12 with qemu-img 7.2.22, mkfs.fat 4.2, mtools 4.0.32 and e2fsprogs 1.47.0, then parsed the bytes. For other tools we read 7 sample images from the QEMU project's test suite, meant to come from each format's native tool, per its README. ISO images are in our gzip, bzip2 and ISO guide.

FormatCreatorDateUnique IDPaths and names
VHDCode, version, host OSCreation second, UTCYes, randomParent name and path in differencing disks (spec, not tested)
VHDXProgram name and versionNone foundThreeParent paths in differencing disks (spec, not tested)
VMDKTwo version numbersNone found8-digit content IDIts first file name. Parent path in an overlay
QCOW2None foundOnly on snapshotsNoneParent path in an overlay. Snapshot names
VDIProgram name as textNone foundTwoNone in ours
Raw .imgNo headerNoneNoneOnly what the file system holds
DMG (one sample)None in the trailerNone in the trailerAll zerosPartition names in the maker's language

QCOW2 was the quiet one: two conversions of the same disk came out byte for byte identical. Two VHDs made a second apart differed in timestamp and ID.

What does a VHD or VHDX say about the machine that made it?

A VHD ends with a 512-byte footer. Microsoft's spec gives it a creation time in seconds since January 1, 2000 UTC, a creator code, a version, a host OS code and an ID.

ImageCreator codeVersionCreated (UTC)
Ours, qemu-img on Linuxqemu5.3The second we ran it
Virtual PC samplevpc1.02016-02-17 09:28:36
Hyper-V 2012 R2 samplewin6.32016-02-19 08:29:43
Disk2vhd sampled2v1.02016-02-25 16:51:27

All four said Wi2k, the Windows code, in the host OS field. Ours was made on Linux, so don't trust it.

VHDX says more about software. Ours began with "QEMU v7.2.22". A Hyper-V sample said "Microsoft Windows 6.2.9200.16384", a full build number, and a Disk2vhd sample said "d2v". We found no date in the VHDX structures we parsed, but 3 random IDs.

Can a differencing disk reveal your username?

Yes. An overlay (differencing) disk holds changes and points at a parent image. We made QCOW2 and VMDK overlays over a parent in a test account's folder. Each stored the path as typed, in plain text, ending home/jsmith/VMs/win11-base.qcow2.

qemu-img refused to create a differencing VHD or VHDX, so this part is read, not measured. Microsoft's VHD spec stores the parent's file name plus locators, with c:\directory\parent.vhd as its absolute-path example. The VHDX spec lists relative_path, volume_path and absolute_win32_path entries.

Names travel too. We copied c.vmdk to renamed-holiday.vmdk and the text inside still said c.vmdk. A QCOW2 snapshot named before-tax-upload was stored with that name and the second we took it.

What does the file system inside the image give away?

We formatted two 16 MB raw images and copied files in.

FieldFAT image (mkfs.fat)ext4 image (mke2fs)
Formatting program"mkfs.fat" in the boot sectorOS type: Linux
Volume nameNO NAME unless you set oneBlank unless you set one
Serial or UUID8 hex digits, new on each imageRandom UUID, plus a second as a hash seed
Format timeOn the label entry, local clockCreated, written and checked times
File datesLocal clock time, no zoneUTC seconds, plus created and last-read times
OwnerNoneUser 1000, group 1000 on every file

FAT dates follow the maker's clock, which can expose a time zone. Our FAT label entry read 11 hours ahead of the UTC second in the VHD footer around it, and our machine runs at UTC+11.

Do deleted files stay inside a disk image?

In every test. We copied a 3,400-byte file, one marker line repeated 100 times, into the FAT and ext4 images, then deleted it with mdel and debugfs's rm. A byte search still found all 100 lines in each image.

The FAT directory entry survived too, minus its first letter, with size and date intact. The ext4 record kept the size and gained a deletion time.

Converting cleaned nothing. We turned the FAT image into VHD, VHDX, VMDK, QCOW2 and VDI, and found 100 lines in each. A compressed QCOW2 hid them from a plain search, but all 100 came back on converting to raw.

What about DMG files?

We couldn't build one: that takes a Mac. So nothing here was created on our machine. It rests on one published sample from 2019, which we parsed, and Apple's documentation.

The 512-byte "koly" trailer was nearly empty: no date, no program name, and an ID of all zeros. The XML list after the data named its 8 sections with full-width brackets, the kind used in Chinese and Japanese text, which hints at the maker's language.

The HFS+ volume inside said more. Apple's Technical Note TN1150 says the volume creation date is stored in local time and other dates in GMT. The sample's read 15:45:38 and 07:45:38, exactly 28,800 seconds apart, so the Mac's clock was at UTC+8. The one file inside carried owner 501, group 20 and a last-opened time.

How do you share a cleaner disk image?

Start a new image; don't tidy an old one.

What we didWhat we saw after
Made a fresh image and copied in only the files to share0 copies of the deleted file
mkfs.fat -i 00000000 -n SHARESerial 0000-0000, label SHARE
qemu-img convert on an overlayParent path gone. The parent's data, deleted file included, merged in
qemu-img snapshot -dSnapshot name no longer in the file
mke2fs -U and -E root_owner=0:0UUID fixed, top folder owned by 0. Files still said user 1000

An image doesn't change the files in it. A photo with GPS tags went into a FAT image, through all 5 container formats and back out with the same SHA-256. So clean files before you copy them in. Our Image Metadata Remover takes JPEG and PNG, the Document Metadata Remover takes Word, Excel, PowerPoint and PDF, the PDF Metadata Editor edits PDF fields and the EXIF Viewer shows what a photo holds. None of them open a disk image. Archives have their own fields: see our ZIP guide and 7z, RAR and tar guide.

What didn't we test?

Windows Disk Management, Hyper-V and Disk2vhd beyond those old samples, VirtualBox, VMware's own apps, macOS Disk Utility and hdiutil, APFS, NTFS, exFAT, encrypted images, and tools that wipe free space inside an existing image. Other programs may fill these fields differently.

Frequently Asked Questions

Does a VHD file store when it was created?

Yes. The 512-byte footer holds a creation time in UTC seconds, next to a creator code, a version and a random ID.

Can a virtual disk file contain my username?

It can if it is an overlay or differencing disk. Our QCOW2 and VMDK overlays stored the full path to the parent image, user folder included.

Are deleted files still inside a disk image?

In our tests, yes. A 3,400-byte file deleted from FAT and ext4 images was still there in full, and it survived conversion to five other formats.

Does a DMG file show who made it?

The one sample we read had no name, date or ID in its trailer. The HFS+ volume inside held user ID 501, a last-opened time and dates that gave away a UTC+8 clock.

Does converting a disk image remove its metadata?

It swaps the outer header and leaves the inside alone. Converting an overlay dropped the parent path, but deleted data carried over.

Related Tools