VMware: Mount a .vmdk virtual disk from command line

Hi,

sometimes you want to modify some offline Vmware virtual disks from command line. For example to copy or edit config files or set some parameters in the Windows sysprep.xml file.

The VMware Workstation does not provide  a command line utility for this procedure. But there is a way to do this. Download and install the Virtual Disk Development Kit.

After installation a vmware-mount.exe command exists in the bin Folder of the installation directory.

To mount a disk readonly, choose a drive letter (X: in this example), start a cmd.exe as Administrator type the command like this:

first, change to the VMware Virtual Disk Development Kit Program folder

cd "C:\Program Files\VMware Virtual Disk Development Kit"

or append the program bin folder to PATH variable

set PATH=%PATH%;C:\Program Files\VMware Virtual Disk Development Kit\bin;


vmware-mount.exe X: d:\temp\VirtualDisk.vmdk

to mount the disk writable append /m:w at the end of the command:

vmware-mount.exe X: d:\temp\VirtualDisk.vmdk /m:w

Unmounting is quite simple:

vmware-mount.exe X: /d /f

Have fun

Michael

Leave a Reply Cancel reply