Page 1 of 1

VMDK to flat image code snippet for VMware based testing.

Posted: Wed Dec 02, 2020 9:01 am
by technix
Here is my whole "Virtual Disk.vmdk" file:

Code: Select all

# Disk DescriptorFile
version=1
CID=fffffffe
parentCID=ffffffff
createType="monolithicFlat"
# Extent description
RW 16777216 FLAT "Virtual Disk.img" 0
# The Disk Data Base
#DDB
ddb.adapterType = "lsilogic"
ddb.geometry.sectors = "63"
ddb.geometry.heads = "255"
ddb.geometry.cylinders = "1044"
And I have a 8GiB "Virtual Disk.img" file along with this vmdk file. This code snippet tells VMware to use that flat disk image as the virtual hard disk for the VM.

This is useful for modern OS'es that does not support floppy or optical media (ugh who still use those IRL anyway...) as it gives your VM a proper virtualized HDD to work with. This code snippet allows you to use a single flat disk image for the development process, by alternating it between host OS and the VM.

Another useful command for those with macOS is "hdiutil attach Virtual\ Disk.img -mount suppressed" which force attaches the flat image, priming it for initialization using "diskutil eraseDisk". (And yes my debug hypervisor is VMware Fusion...)