Virtual Disk Development Kit

 View Only
  • 1.  How does vmware-mount actually work?

    Posted Mar 25, 2009 05:35 PM

    Hi

    I installed VMware Server 2.0 on my Linux x86-64 box in order to get access to the vmware-mount utility, and I have no problems at all mounting virtual disk files with vmware-mount. I am curious as to how vmware-mount actually goes about making virtual disk files look like hard drives. If anyone knows the answer to this (and has a couple minutes of free time), could you please provide me with a brief description? I am especially interested in knowing how FUSE is used by vmware-mount.

    Thanks

    Ashok



  • 2.  RE: How does vmware-mount actually work?

    Posted Mar 25, 2009 06:00 PM

    Hi Ashok,

    Here it is in brief:

    • vmware-mount uses FUSE to present a flatfile (sort of like what you get when you do dd)

    • (optionally) vmware-mount then mounts the above flat file onto a loopback device

    • vmware-mount parses the virtual disk MBR for partitions and can mount each partition using losetup and mount - just like you can mount any raw disk image.

    Hope that helps - you can see some of this in action at http://communities.vmware.com/blogs/sudarsan/2009/02/05/sample-script-to-mount-lvm-volumes

    Sudarsan



  • 3.  RE: How does vmware-mount actually work?

    Posted Mar 25, 2009 10:48 PM

    Thank you very much Sudarsan, your examples were quite helpful. I'm still not 100% clear why FUSE is needed in this process. Does it allow for easy access to the MBR?



  • 4.  RE: How does vmware-mount actually work?

    Posted Mar 25, 2009 11:45 PM

    One more question: my understanding from reading the documentation is that vmware-mount will not let me view a Linux vmdk file on a Windows machine: vmware-mount for windows can only mount windows vmdk files, while vmware-mount for linux can only mount linux vmdk files.

    I am looking into possible ways to view linux vmdk files from my windows machine. I did some searching on the web and found a link to a site that says youcan mount Linux vmdk files on Windows using a couple of tools called 'ext2ifs'and 'vdk':

    http://gotitsolutions.org/2007/03/06/mounting-vmdk-files-in-windows.html

    Has anyone tried this?

    Thanks

    Ashok



  • 5.  RE: How does vmware-mount actually work?

    Posted Mar 26, 2009 03:26 PM

    vmware-mount uses fuse to present a flat file for the VMDK - I am not seeing how you can do without it, can you explain?

    Thanks

    Sudarsan



  • 6.  RE: How does vmware-mount actually work?

    Posted Mar 27, 2009 01:59 AM

    Sudarsan

    Please disregard my last question, it makes sense to me now why FUSE is involved.

    I have one more question for you, as well as anyone else who may have used the Windows version of vmware-mount. I am trying to get the windows vmware-mount to mount a Windows vmdk file. This is what I did to get a Windows vmdk file:

    1) Set up a Vista VM on an ESX server, then powered it down.

    2) Using the datastore browser, I copied the directory containing the vmdk, vmx, vmxf, etc. files over to my laptop.

    I installed VMware Disk Mount for Windows on my laptop, and I'm having problems connecting to the vmdk file on my hard-drive. This is what I get:

    C:\Program Files\VMware\VMware DiskMount Utility>vmware-mount G: "C:\Documents and Settings\Ashok\Desktop\ashok_vista_vm\ashok_vista_vm.vmdk"

    Unable to mount the virtual disk. The disk may be in use by a virtual machine or mounted under another drive letter. If not, verify that the disk is a virtual disk file, and that the disk file has not been corrupted.

    I get the same error if I try mounting the "*flat.vmdk" file:

    C:\Program Files\VMware\VMware DiskMount Utility>vmware-mount G: "C:\Documents and Settings\Ashok\Desktop\ashok_vista_vm\ashok_vista_vm-flat.vmdk"

    Unable to mount the virtual disk. The disk may be in use by a virtual machine or mounted under another drive letter. If not, verify that the disk is a virtual disk file, and that the disk file has not been corrupted.

    I cannot even get the "/p" option to work:

    C:\Program Files\VMware\VMware DiskMount Utility>vmware-mount /p "C:\Documents and Settings\Ashok\Desktop\ashok_vista_vm\ashok_vista_vm.vmdk"

    Unable to mount the virtual disk. The disk may be in use by a virtual machine or mounted under another drive letter. If not, verify that the disk is a virtual disk file, and that the disk file has not been corrupted.

    Has anyone experienced this problem before and solved it? Am I doing the wrong thing by copying over the vmdk files over to my laptop and trying to mount them there?

    Thanks

    Ashok



  • 7.  RE: How does vmware-mount actually work?

    Posted Mar 27, 2009 07:50 AM

    I am pretty certain that the error message I'm getting is due to the copying over of the virtual disk directory . To verify, I installed VMware Workstation on my Windows XP laptop, and installed a Vista VM within Workstation. I tried mounting the vmdk file, but got the error message:

    "C:\Program Files\VMware\VMware DiskMount Utility>vmware-mount G: "C:\Documents and Settings\Ashok\My Documents\My Virtual Machines\ashok_vista_vm\ashok_vista_vm.vmdk"

    An unexpected error has occurred. Details have been saved in the Application event log.

    So I checked out the Application Event Log and found the following:

    "Command "vmware-mount G: "C:\Documents and Settings\Ashok\My Documents\My Virtual Machines\ashok_vista_vm\ashok_vista_vm.vmdk"" failed with COM error: 0x80004005 (last partition extends past end of disk (2088:2087))"

    Apparently, this is a common problem when attempting to mount Vista virtual disks as described in http://www.neowin.net/forum/index.php?s=5af5901362fc4254aeb8c15637013704&showtopic=459355&pid=589228909&st=0&#entry589228909. fortunately, this web-site also provides a workaround -- expand the size of the vista vmdk file using the vmware-vdiskmanager utility.

    I am in the process of trying this out.



  • 8.  RE: How does vmware-mount actually work?

    Posted Mar 27, 2009 10:08 PM

    Which version of vmware-mount are you using / where did you download this version from?

    Thanks

    Sudarsan



  • 9.  RE: How does vmware-mount actually work?

    Posted Mar 27, 2009 10:28 PM

    I'm using Version 5.5, I got it from the following site:

    http://www.vmware.com/download/eula/diskmount_ws_v55.html

    I still could not mount the Vista vmdk file. So as a further experiment, I installed an XP Virtual Machine on Workstation, and I was able to mount it.