Two years ago, I had written a blog post on how to access data present on vmdk files using the Virtual Disk Development Kit (VDDK). This development kit is available on the VMware developer portal and is offered to developers for using in tools that are involved in accessing the VMDK files offline for backup and other purposes. The link for the blog post can be found here. In the blog post I had just shown the steps to mount and access the data. Recently, I ran into a situation where I had to test this functionality and make sure it still worked fine with the VMs built with latest hardware version ( vSphere 6 and HW version 11) and though I will share the rest of the steps with everyone.
In this blog post I will be covering just the bit of what happens after installation of the VDDK and not the “How to install VDDK” part. Please refer to the blog post link given above for the installation steps of VDDK. I will take the example of a windows 8 VM which will be built on ESXi 6.0 and mount it’s disk to my local desktop to access some files offline.
One important thing to note is that VDDK has a whole set of functionality and I will be making use of vmware-mount tool in the VDDK to get this task done. The last version of VDDK that offered the vmware-mount option was 5.1. This option has been discontinued from 5.5 onwards but the file offered in 5.1 does the magic even for 6.0.
I’m going to take a VM that has Windows 8 running on it with two disks. The OS disk and a data disk with a few files which I will be accessing from the offline vmdk file.
The files in the data disk are shown below
Now, I will power off this VM and export it as OVF to my desktop so that I can access the VMDK offline.
I will now open a command prompt and move to the directory where the VDDK is installed. The standard path is “C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin” unless you have changed it during the installation.
Another option is to browse to the directory in the explorer and then open a command window in there by holding shift and right click. Now run the command :
In our case, I will mount the disk on to drive P and i will be use the second VMDK to mount the data drive.
The command will be : vmware-mount P: /m:n “D:\Windows 8\Windows_8-disk2.vmdk”
The /m:n switch mounts the disk in read-write mode. To check all the options /? has to be typed after vmware-mount.
Now a drive called Data (P:) should appear in my local desktop. Which automatically does:
Both the contents from the VM’s disk and the contents here are exactly the same. They have to be as it’s the same disk.
Thus I can copy data from the drive and access it locally without making changes to the disk. This is a very good use case if you have some VMs stored on a hard disk and you realize you need some data out of it. You don’t have to go through the whole process of importing it on to an ESXi host, bringing it up, taking an RDP session and then copying the data to the local system. VDDK and the vmware-mount tool does that for you by letting you mount the vmdk on your local machine.
Let me know what you think about this tool by dropping in a comment below. The link for the download of VDDK is attached below.
Abhilash Basavarajaiah is a Cloud Solutions Architect and an Ambassador for the Office of the CTO @ VMware.
He is a dynamic IT professional and an ambitious, highly-motivated individual with experience in pre-sales, business development, and
strategic alliances. He experienced in designing and architecting
hybrid cloud infrastructure with a focus on Software-Defined Datacenter.
He is passionate about technology and all things virtual and VMware has recognized him as a VMware vExpert and a vExpert Pro under the Evangelist path for his contribution to the virtualization and cloud computing communities through knowledge sharing and content creation.
Abhilash holds numerous technical certifications from VMware, EMC, Cisco, CNCF, Microsoft, and Rackspace