How to Recover Data From VMWare Virtual Machines In Linux Without Backup

Read this article to find out how to recover VMWare virtual machine data in Linux, and what to do when your virtual machine encounters a failure, or when it refuses to boot. How to recover a VMware virtual machine and restore its operability.

How to Recover Data From VMWare Virtual Machines In Linux Without Backup

In modern IT infrastructure, virtual machines have become an integral component in the operation of servers, test environments, and workstations. Most popular virtualization solutions include VMware Workstation or VMware Player which are used actively in Linux-based systems. But what shall we do if a virtual machine can’t start anymore or was deleted accidentally, and there is no backup?

Losing access to virtual environment data can have grave consequences, especially if some important information was stored on a virtual disk. Fortunately, even without a backup file, there are a few ways to restore the contents of a virtual machine disk as long as its main files are preserved — for example, .vmdk.

In this article, we’ll cover the following points:

  • what files are essential for recovering a VMWare virtual machine in Linux;
  • how to mount a .vmdk disk and gain access to data;
  • what utilities and methods are used to recover files;
  • what to do if a virtual disk is damaged or partially lost.

This tutorial will come in handy for administrators, testers and all users looking for a recovery solution without backup which relies only on the files available in the system.

Go to view
How to Recover Data After Compacting a Virtual Hard Disk on VMware, Hyper-V, VirtualBox

How to Recover Data After Compacting a Virtual Hard Disk on VMware, Hyper-V, VirtualBox

Files of VMWare virtual machine in Linux

In the Linux environment, VMware virtual machines (such as VMware Workstation or VMware Player) are stored as a set of files that contain all components of a virtual machine: its disk, settings, snapshots, logs etc.

By default, virtual machine files are located in the user’s home directory:

/home/user/vmware/vm_name/

VMWare virtual machine files in Linux

Or sometimes in this folder:

~/VMs/

Main types of VMWare files:

No. File extension Name Purpose
1 .vmx VMware Virtual Machine Configuration Main configuration file of the the virtual machine
2 .vmdk Virtual Machine Disk VM hard disk image (may consist of several parts)
3 .nvram Non-volatile RAM Stores the state of VM BIOS/UEFI
4 .vmxf VM Team Configuration Additional configuration data (for VM team)
5 .vmsd Snapshot Metadata VM snapshots metadata
6 .vmsn Snapshot State The state of system memory and devices at the time of such snapshot
7 .log Log Files VM startup and activity logs (vmware.log)
8 .lck Lock Files Lock files (to protect against simultaneous access)

All the mentioned files are stored in the directory of each virtual machine.

If a VM gets damaged, you need to have backups of .vmdk and .vmx files for recovery operations.

That is why you should store copies of essential files (.vmx, .vmdk, .nvram, .vmsd) in a safe place so that you can restore your virtual machine if any failures occur.

The virtual machine is damaged or can’t boot: how to recover its data

What shall we do if a VMWare virtual machine gets damaged, can’t boot, or displays various errors? That is, when you have no access to the data inside such virtual machine, and its files can’t be read or copied elsewhere.

VMWare virtual machine error in Linux

To access the data of such virtual machine, let’s use a data recovery tool – Hetman Partition Recovery. It’s got two indisputable advantages over other software products of this type:

  1. The first advantage – it can mount disks created by most virtual machines.
  2. The second advantage – it works on all versions of Linux.
The tool recovers data from any devices, regardless of the cause of data loss.
Hetman Partition Recovery: virtual machine disk mount

So now,

  • We have a VMware virtual machine which can’t boot, for some reason. It contains the files that we need to access.

    Files in a VMWare virtual machine
  • To access the files of such virtual machine, let’s run Hetman Partition Recovery.

  • The app identifies the disks connected to this computer. To access the virtual machine, let’s mount its hard disk in the recovery app. To do it, click Mount Disk.

    Hetman Partition Recovery
    Mount disk" ]
  • And select VMware Workstation.

    If you have a virtual machine of different type, select it from the list.

    Hetman Partition Recovery
    Mount .vmdk disk" ]
  • In the app window, choose the folder containing the virtual machine and click Open.

    Hetman Partition Recovery: open .vmdk disk
  • Hetman Partition Recovery identifies automatically the disk of the selected virtual machine. Click Next.

    Hetman Partition Recovery: mount .vmdk disk
  • After that, the VMWare hard disk will appear among other disks as a mounted disk. To access its data, right-click on it and select Open.

    Hetman Partition Recovery: open mounted virtual machine disk
  • For starters, a Fast scan will be enough.

    Hetman Partition Recovery: chose disk scan type
  • Here is the data stored in our virtual machine. Navigate to the required folder and save the required folder. As you can see, their contents can be seen in the preview window.

    Hetman Partition Recovery: VMware files identified

    Warning! The recovery app can identify even the files which were removed from the virtual machine while it was still working properly. Such files will be marked with a red cross.

  • To have a file or folder recovered, select them and hit the Recovery button.

    Hetman Partition Recovery: recover VMware files
  • Choose the folder where to save the recovered data.

    Hetman Partition Recovery: recover VMware files to folder
  • The files are recovered.

    Hetman Partition Recovery: recovered VMware files

How to recover a deleted VMWare virtual machine in Linux

What shall we do if a VMware virtual machine is deleted in Linux? Can it be recovered?

Suppose we have a disk containing a virtual machine. It works properly, and it contains some data.

VMware virtual machine disk

WARNING! Depending on the virtual machine settings, its virtual hard disk can be split into several files, or it can be created as a single file. In my case, it’s a group of several files. In any case, though, to achieve the best file recovery results it’s recommended to recover all virtual disk files, as well as the main configuration file of the virtual machine, VMX.

Let’s delete it as if accidentally. By the way, a virtual machine can be deleted both from its interface and from the file manager of your operating system.

Deleting VMware virtual machine

To recover it:

  • Run Hetman Partition Recovery. The app identifies the disks connected to this computer.

  • Our virtual machine was stored on disk sdа2. Let’s scan it. Right-click on it and select Open.

    Hetman Partition Recovery: recovering deleted VMWare virtual machine
  • For starters, a Fast scan will be enough.

    Warning! Depending on why the virtual machine was deleted and other factors, the recovery app may not find it after a Fast scan. If this is your case, right-click on the disk where the virtual machine was stored, and choose Analyze again. Select Full analysis and specify the file system of your disk.

    Hetman Partition Recovery: Full analysis of VMWare virtual machine disk
  • Here is the data on the scanned disk. The virtual machine we are looking for was stored in this folder.

    Hetman Partition Recovery: identified VMware virtual machine
  • Open the folder and you can see the virtual machine disk. This is the file we need to recover.

    Hetman Partition Recovery: files of deleted VMware virtual machine
  • To recover it, select the disk of the required virtual machine, and hit the Recovery button.

    PLEASE REMEMBER! You MUST recover the VMX file and all files making up the disk of your virtual machine. Otherwise, you won’t be able to mount such disk in VMWare.

  • Choose the folder where to save the recovered data.

  • The selected virtual machine is recovered.

    The recovered folder of VMWare virtual machine

How to mount a freshly recovered VMWare virtual machine in Linux

As you can see, the disk of the required virtual machine is recovered.

Warning! You should recover the entire folder of the virtual machine, with all of its contents. If you do otherwise, the virtual machine will not work again.

To run a freshly recovered virtual machine:

  • Start VMware and select – File – Open to open a virtual machine.

    VMware Workstation: open a virtual machine
  • Give the path to the vmx file of the virtual machine. And click Open.

    VMware Workstation: path to the .vmx file of the virtual machine
  • The virtual machine should appear in the VMWare Library.

    VMware Workstation: virtual machine library
  • All right, now the virtual machine starts easily from the freshly recovered vmdk disk.

  • Let’s go to the folder where its files were stored. They are all here, and none is damaged.

    VMware Workstation: running the recovered virtual machine

If a virtual machine refuses to boot from a freshly recovered disk, the disk might have been damaged. In this case, you can recover its data in the same way as we do it with a damaged virtual machine. That is, by importing the machine’s hard disk file into the data recovery tool – Hetman Partition Recovery.

I’d like to remind you once more – you MUST recover all files making up the disk of your virtual machine. Otherwise, you won’t be able to mount such disk in VMWare, and files will only be recovered partially.

Data recovery from a thin disk of a VMWare virtual machine in Linux

In VMWare, a VM disk can be created in one of the two main formats:

Disk type Name Description
Thin disk Thin Provisioning Only the space which is actually used is allocated on a physical disk. Initially, the size of the .vmdk file is pretty small, but it grows bigger as more data is written there.
Thick disk Thick Provisioning The entire disk space is allocated immediately, even if it is not used by the virtual machine yet. The .vmdk file occupies all of the assigned space (for example, 40 GB).

In terms of recovery, you’re not going to feel any difference between using Thin Provisioning or Thick Provisioning. The data recovery app will mount the virtual machine disk in both cases with equal effectiveness. The only crucial requirement is to have all virtual machine disk files recovered before you start.

Conclusions

As you have just seen, Hetman Partition Recovery is not only a data recovery app to restore deleted files in Linux, but also a powerful tool to work with virtual machines of all kinds.

The tool recovers data from any devices, regardless of the cause of data loss.

Losing data from a VMware virtual machine while there is no backup file is a difficult situation, but in no way a catastrophe. For Linux, there are effective tools and approaches to let you restore access to files, even if the virtual machine itself is damaged or even deleted.

The essential requirement for the recovery process is to save the .vmdk disk file, since it contains all virtual environment data. Thanks to such utilities as Hetman Partition Recovery you can mount a disk, view its contents, and restore important data.

To avoid such situations in the future, it’s important to:

  • back up regularly not only the .vmdk file, but also .vmx configuration files;
  • store virtual machines in well-protected directories with restricted access;
  • make sure you have backup files ready before you delete or change anything.
Vladimir Artiukh

Author: , Technical Writer

Vladimir Artiukh is a technical writer for Hetman Software, as well as the voice and face of their English-speaking YouTube channel, Hetman Software: Data Recovery for Windows. He handles tutorials, how-tos, and detailed reviews on how the company’s tools work with all kinds of data storage devices.

Oleg Afonin

Editor: , Technical Writer

Oleg Afonin is an expert in mobile forensics, data recovery and computer systems. He often attends large data security conferences, and writes several blogs for such resources as xaker.ru, Elcomsoft and Habr. In addition to his online activities, Oleg’s articles are also published in professional magazines. Also, Oleg Afonin is the co-author of a well-known book, Mobile Forensics - Advanced Investigative Strategies.

Recommended For You

Hello! This is AI-based Hetman Software virtual assistant, and it will answer any of your questions right away.
Start Chat