How to mount a VMDK disk image on linux.


I’ve found two main ways to do this. The first requires you to have the vmware-mount command installed. I expect that this is a tool that would be installed with the vmware-player or vmware-workstation packages.

Using vmware-mount:

sudo mount some-disk-image.vmdk /tmp/mountpoint -o ro,loop=/dev/loop1,offset=32768 -t ntfs

Note: This requires you to know the offset of each of the partitions in the disk. Also, the above example is assuming the partition to be mounted is an NTFS partition..

The second method requires you to have the kpartx and vgchange tools installed. My Ubuntu VM at work has these installed but not the vmware-mount tool used in the first example so this is the method that I’ve tested:

# kpartx creates loop devices under /dev/mapper for each partition
kpartx -av some-disk-image.vmdk
mount -o /dev/mapper/loop0p1 /tmp/foo

kpartx -dv some-disk-image.vmdk
" "