Remote Mount a VMDK File Using vmware-mount

After years of using VMware products, be it VMware Server, VMware Workstation, VMware Infrastructure and VMware vSphere, I haven’t encounter failure on booting a Windows OS. But, one fine day this week itself, one of the Windows Server 2003 virtual machine (VM) can’t boot up because of missing boot.ini file.

Without any delay, I download the Virtual Disk Development Kit 1.2.1 from http://www.vmware.com/support/developer/vddk/ and I copy out the virtual disk from the shared storage which is virtual_machine_name-flat.vmdk (file name is an example only) with the filesize of 20GB. I tried mounting the VMDK file locally but failed. After several tries, I decided to copy the rest of the files in the VM folder from the share storage. Woot woot, I am able to mount the VMDK file using the command below: 

# vmware-mount X: "C:\VM\virtual_machine_name.vmdk"

Now, the VMDK file is mounted as X: drive letter locally so I begin to copy a good copy of boot.ini file. Copying those files to the shared storage is a pain because I have to wait 30 mins. Once the copying is completed, I begin to power on the VM but it failed to boot up telling me that NTDETECT.com is missing. What the heck, I have to copy thoses file again from shared :(


After, copying a good copy of NTDETECT.com and a successfully boot up of the VM then I was relief. Its time for me to hack the remote mount a VMDK file. Indeed, I successfully mount the VMDK remotely. Yatta. Please use the command below: -

# vmware-mount X: "[Shared_Storage] virtual_machine_name/virtual_machine_name.vmdk" /i:"DataCenter/vm/Servers/virtual_machine_name" /h:VCenterName /u:"domain\user_name" /s:your_password

With the command above, the VMDK is mounted as X: drive letter. Please take note as below: -

[Shared_Storage] virtual_machine_name/virtual_machine_name.vmdk = you can get this path in vSphere Client, Edit Settings on the VM and select the virtual disk
/i:”DataCenter/vm/Servers/virtual_machine_name” = you can get this in the tree view of vShphere Client, the “vm” in this path is complusory

To list/view mounted volume(s), run the command below: -

# vmware-mount /L

To umount a mounted volume, run the command below: -

# vmware-mount X: /d

I hope the commands above will help you in your daily VMware job. Please feel free to give comments and suggestions to the commands I shared. Thank you.

0 comments:

Post a Comment