If you’re working with VMware ESX/ESXi servers disks or VMDK files regularly, there may come a time when you need to mount them. A problem might appear where you can’t access or read the VMDK file, requiring you to mount the disk on Windows or Linux so you can access the content.
If you’re already facing this issue and want to know how to do it, then you have come to the right place. In this blog post, we are going to provide some methods to mount VMDK files and extract content from them.
Let’s get started.
In case you have a VMDK file or ESXi server disk having partitions and you want to mount it on Windows or Linux, below are some of the methods you can use.
Windows system supports VMDK files and you can mount them in Windows. One of the ways to do so is to use Windows Explorer. For systems installed on Windows above Windows 7. you may be able to map the image file through Windows Explorer.
It is an easy way to mount a VMDK file. In case this method doesn’t work, you can try one of the alternative methods given below.
You can also use VMware Workstation to mount a VMDK file. It’s used for virtualization on the desktop. VMware Workstation comes with a built-in “Map Virtual Disks” feature you can use to open a VMDK file in wider format. In case you tried mounting the VMDK file using Windows Explorer and it didn’t work, VMware Workstation is the next one in the line to try.
If the VMware Workstation method didn’t work out, you can mount the VMDK file using the vShpere Disk Development Kit which comes with The “VMware-mount” command line feature. You can use this tool to mount the VMDK file.
You need to download the vSphere Disk Development Kit and install it on your system to use this tool.
First of all, you need to mount a VMDK file (saved at the location) in read-only mode. To do so, write the below command:
vmware-mount.exe X: “C:\Temp\TestVM.vmdk”
In case you have a VMDK file with multiple partitions, use the parameter /v:x to mount the desired volumes:
vmware-mount.exe /v:2 X: “C:\Temp\TestVM.vmdk”
If you need writeable access, just use the parameter “/m:w“. In case you have a broken system file, using this parameter, you can take great help.
vmware-mount.exe /m:w X: “C:\Temp\TestVM.vmdk”
If you want to list all the mounted virtual drives use /L:
You can just follow the above method and use the commands given to mount the VMDK file. It’s an easy and powerful way but installing the Development Kit on your computer might be a challenge. If you are able to install it easily, using the command line shouldn’t be an issue.
One of the easy ways to mount a VMDK file is to use 7-Zip archiver. It is one of the easiest and fastest methods compared to others. All you need to do is right-click on the VMDK file and select “Open Archive”.
VMware Workstation is another great solution for mounting ESX/ESXi server disk or VMDK files on an OS. It is easily the most stable and feature-rich option for creating, managing, and extracting VMDK files.
To mount the VMDK file on a Mac OS using VMware Workstation, follow the process explained below.
Mounting files on a virtual machine is relatively simple. If you have not already done so, download and install VMware Workstation on your host. Next, start up the ESXi host and log into the Administration area. From here, you can access the itemized list of applications installed on the host. Expand the Applications list and you will see a sub-menu titled “Filesystems”. Click on “Local Disk” and you will see a list of files stored on the disk. Click on one of the listed files and it will be displayed in the action pane along with any other information including a descriptive file name when available.
When using Linux, you have Loop devices that work as pseudo-devices in Linux. These devices can be used to make files accessible as block devices. Later on, these block devices are used to mount disk images that contain file systems.
In Linux, you’ll find these devices named as /dev/loopX. X represents the number of the loop device. This method is good to mount -flat.vmdk files even without a virtual disk descriptor.
Let’s find out how you can use the Loop devices to mount a VMDK file in Linux.
fdisk -l | grep /dev/loop
df -h | grep /dev/loop
losetup /dev/loop30 /vms/Win-test2-flat.vmdk
losetup -o 32256 /dev/loop31 /dev/loop30
You can retrieve information about the sector size, and the first sector used for the boot start with the command:
fdisk -l /dev/loop30 /vms/Win-test2-flat.vmdk
As an alternative, for virtual disks that contains multiple partitions, you can use parted to determine the start and the end of each partition:
In the parted console, enter the following commands.
mount /dev/loop31 /mnt/vmdk-image
ls -al /mnt/vmdk-image
losetup -d /dev/loop31
In this blog post, we talked about different methods of mounting VMDK files and extracting content from them. You can open these files with or without powering on a Virtual Machine. Besides, you can also mount VMDK files in Linux and Windows. We hope that these methods will help you mount a VMDK file or extract content.
It’s important to be aware of how to open VMDK files and extract content from them if something goes wrong with a virtual machine. Knowing multiple methods of doing these tasks gives you peace of mind and the power of choice.
You can mount Datastores on hosts using vShpere Web Client.
If you are using Windows, you can access a VMDK file using Windows Explorer. Remember that you can only access the VMDK virtual disk from your Windows Explorer if you have VMware Workstation installed on your system.
A VMDK file can be moved or migrated to another VM using vSphere Web Client. You need to right-click the VM and select Migrate. You’ll be asked to select the destination storage where you want to move your VMDK file.