VMDK to flat image code snippet for VMware based testing.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
technix
Member
Member
Posts: 28
Joined: Sun Jun 16, 2013 10:13 am

VMDK to flat image code snippet for VMware based testing.

Post 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...)
Post Reply