How to open VMDK files? Let's see the options
This article is dedicated to how to open VMDK files. Read it to find out all that you need!
What is a VMDK file?
The VMDK file can be described as a virtual disk (disk file format) that contains all the stored information of the hard disk of a VMware virtual machine. This file can be found under the name "[name] .vmdk". Along with the VMDK file, there is now a VHD file with the same functions, however, these files do not support each other. There are special third-party converters for this. The VMDK file is often a fixed size or it can grow as data accumulates using VMware Virtual Disk Manager.
There are situations when you need an open .vmdk file and the VM is not turned on. In such a case, you need to know the most efficient VMDK file opening methods. This article aims to address this issue.
How is your data stored in VMDK files
VMDK, as mentioned above, is an open source virtual disk file format developed by VMware. The extension of this file is .vmdk and it is applicable to VirtualBox and VMware virtual machines.
If we are talking about VMs on ESXi servers, then the VMDK virtual disk format is the virtual disk descriptor (diskname.vmdk) and the virtual disk extent (diskname-flat.vmdk, where raw files are stored).
For VMware Workstation virtual machines, the virtual disk format is an extended data file (diskname.vmdk, monolithic sparse). This file contains an embedded virtual disk descriptor that defines the structure, geometry of the virtual disk, virtual hardware version, and identifiers.
Two ways to open VMDK files
In general, there are two methods to open a VMDK file (with the virtual machine turned on and turned off).
Methods that need powering on a VM
These are methods for opening VM images using existing virtual machines. This will also require an installed hypervisor (VMware ESXi, VMware Player, Oracle VirtualBox, or VMware Workstation).
Legacy method: using a Live DVD even if OS on a VM is dead.
As a DVD, you can use an ISO image and insert it into the virtual DVD drive of the virtual machine. Once you boot from the DVD, you can mount the virtual disk partitions and then copy the files from the virtual disk to your USB hard drive. The latter must be connected to the virtual machine via a network. This method can be used on virtual machines running on VMware ESXi and VMware Player / Workstation.
You can parse this method using an example of a Windows Server 2016 virtual machine on an ESXi host. Let's download the Ubuntu 18 ISO installation image. Next, open the VMware vSphere client, and in the "Hosts and Clusters" section, find and select your virtual machine. Now select the “Change Settings” tab and in the CD/DVD drive options, click on “Data Warehouse ISO File”.
Next, go to CD/DVD Media, click “Browse”, and select the desired ISO file in the datastore. Now boot from the ISO and select the “Try Ubuntu Without Install” option. After booting Ubuntu from the Live DVD, open Terminal.
Next, you will need to enter the following:
To gain root privilege:
To determine the list of available hard drives:
ls -al / dev / sd *
Next, make the directories to be used as mount points for each partition.
mkdir / mnt / win-disk1
mkdir / mnt / win-disk2
mount / dev / sda1 / mnt / win-disk1 /
mount / dev / sda2 / mnt / win-disk2 /
List files and directories of mounted partitions:
ls -al / mnt / win-disk2 /
ls -al / mnt / win-disk1 /
Now plug the USB hard drive into the USB port of the ESXi host and connect this hard drive to the virtual machine using USB pass-through to copy the required files, stored in the VMDK file.
ESXi / Workstation / Player: how to mount a VMDK file as a virtual disk to a healthy VM.
In this case, the VMDK virtual disk must be connected to an existing virtual machine with a running operating system. The VMDK file can be attached to an existing virtual machine as an additional virtual disk. To open the VMDK file of an ESXi virtual machine on VMware Workstation or Player, you must copy the virtual disk and its descriptor to the physical disk where VMware Workstation or Player is installed.
As an example, consider opening a VMDK virtual disk of one VM with another VM on an ESXi host. n the VMware vSphere client, open the Storage section and select the datastore with the VMDK file. Next, click on the VMDK file and select “Copy to”. Then choose a location to copy; for example to the root directory of the same datastore. Then connect the VMDK virtual disk to another healthy virtual machine, such as Windows Server 2016, on the same ESXi host. In the vSphere Client, go to “Hosts and Clusters”, and right-click the healthy virtual machine and click “Edit Settings”.
Then select “Add New Device” and click on “Existing Hard Drive”. Select a recently made copy of the VMDK file. You now have full access to the virtual disk files. To do this, you can open the mounted drive in Windows Explorer and then copy the contents of the VMDK file connected to the healthy virtual machine.
Methods that don't need a VM
These methods are simpler and more versatile, since a hypervisor is not required. Mounting the VMDK file in these ways does not take much time and effort.
Mounting VMDK files in a host OS with VMware Workstation.
With VMware Workstation, you can mount VMDK files on the host operating system. If snapshots of the virtual machine are available, delta virtual disks are created after each snapshot is taken. Therefore, if you want to open the state of the virtual disk at the time after creation, you must have a parent virtual disk and delta disks. Then it is necessary to mount the corresponding delta virtual disk in the host operating system. The parent virtual disk can be opened in read-only mode so as not to cause unnecessary problems.
As an example, consider mounting a VMDK virtual disk of a VMware Workstation virtual machine with snapshots on a Linux host. In VMware Workstation, click the “File” tab and select the Mount Virtual Disks option. Next, click “Browse” and select the VMDK file. Next, create a directory in the Linux file system to mount a virtual disk in VMDK format:
mkdir / mnt / vmdk /
chown -R user1: group1 / mnt / vmdk /
chown -R user1: group1 / mnt / vmdk /
Now select the target directory and check the “Mount read-only” checkbox. Open / mnt / vmdk / directory in Linux explorer and browse the files on the VMDK virtual disk. Then unmount the VMDK image file from the Linux file system when not in use.
To mount the VMDK on the Linux host, in the console, enter the command: vmware-mount /media/user1/vms/vm_name/vm_disk_name-000002.vmdk / mnt / vmdk. Then disconnect the virtual disk.
Here’s an example of how you can mount VMDK files in Windows. The principle is the same as in the previous example. You just need to right-click the VMDK file in Windows Explorer and select the “Map Virtual Disk” option. The drive opens automatically in Windows Explorer after mapping if the checkbox is checked. At the end, remember to unmount the drive, right-click on the VMDK file, and click “Unmount Virtual Drive”.
How to mount VMDK files with VMFS Recovery
Use VMFS Recovery to mount VMDK files. The software tool reads and recovers any information from the VMFS file system. An unobtrusive and patient Recovery Wizard will help you with the application if you have any questions. Any virtual disk can be mounted as local for easy viewing. When recovering data, all Windows restrictions are cleverly and unobtrusively bypassed; and, of course, there is support for Unicode.
This VMFS recovery guide is designed to get you started quickly. After installing the program on your computer or other device, open the Recovery Wizard and select an item to check. Then select the check mode:
- Fast recovery (shallow).
- Full recovery (recommended).
The program checks the current state of VMFS datastores, volumes and disks during a scan. After scanning, mount the VMDK file and purchase a license to export data.
Other methods to open VMDK files in Linux
Thanks to built-in tools, Linux allows you to perform the maximum number of operations in the console. As a result, the chances of mounting VMDK files and accessing their contents are increased.
How to mount VMDK files by using /dev/loop
This method makes files available as block devices. As a result, they can be used to mount disk images containing file systems. This loop is called /dev/ loopH, where H is the loop device number. Here it is possible to mount the -flat.vmdk files even without a virtual disk descriptor.
How to mount VMDK files with kpartx
This tool can mount partitions in image files to directories of a real Linux file system. It can be used to mount the -flat.vmdk images used on ESXi servers.