How to access VMFS datastore from Linux, Windows, or ESXi? , Ranjan.info

Let’s look at several ways to access data stored on the datastore with the ESXi host’s VMFS file system (these configuration files, data files, and snapshots of the virtual machine) from Linux, Windows, and the VMware hypervisor. In fact, this article is based on a real case of our client when a VMware ESXi host is suddenly crushed.

If your ESXi host crashes, but the local disks (or LUNs) are still functional, you can copy the virtual machine files and run the VMs on another host (even on VMware Workstation or Hyper-V) Huh. Common operating systems (Windows and Linux) will not see data on partitions containing the VMFS file system by default, because they do not have a VMFS driver.

Let us consider three scenarios of accessing data on VMFS datastore.

How to Mount VMFS File System on Linux (Ubuntu)?

Let’s see how to mount partition with VMFS file system on a computer with Ubuntu 20.04 LTS installed. Install the vmfstools package depending on the version of the VMFS file system:

  • vmfs-tools – Supports VMFS 3 (ESXi 3.x, 4x) and VMFS 5 (ESXi 5.x)
  • vmfs6-tools – VMFS 6 (used by default in modern versions of ESXi since vSphere 6.5)

In our example, the disk was connected to an ESXi 7.1 host, so you need to install vmfs6-tools to access the data on the VMFS6 file system:

# apt-get -y install vmfs6-tools

install vmfs6-tools on linux

Create a mount directory:

# mkdir /mnt/vmfs

Get disk name and partition type:

# fdisk -l

In our example, you can see that /dev/sdb drive has one sdb1 split with vmware vmfs file system.

check vmware vmfs partition on linux

Comment. To access the GPT partition table on a disk larger than 2 TB, use the parted command instead of fdisk:

# parted -l

To mount this VMFS partition on Linux, run the command:

# sudo vmfs6-fuse /dev/sdb1 /mnt/vmfs

The command returned that the specified partition has a VMFS6 file system and is mounted to the target directory.

Virtual machine files on VMFS disks are read-only available to you and you can copy them or play them quickly with VMware Player/Workstation.

accessing vmware vm files on vmfs from ubuntu linux

An error may occur while mounting the partition:

VMFS Unsupported version 5
Unable to openfilesystem

In this case, you need to install vmfs-tools which supports VMFS3 and VMFS5:

# apt-get install vmfs-tools

It remains to mount the disk partition with the VMFS 5 datastore:

#vmfs-fuse /dev/sdb1 /mnt/vmfs

Mounting a VMFS Partition on a New VMware ESXi Host

Above, we saw how to mount a VMFS partition using third party VMFS drivers. However, the most universal way to access data on a failed server’s VMFS data store is to connect its disks to a new ESXi server (you can have ESXi installed on a new host in less than an hour). I think this is the easiest way to mount a VMFS volume from a physical hard drive or LUN to a storage array device (connected via fiber channel or iSCSI).

To mount an existing VMFS datastore on a new ESXi host without formatting it, follow the steps below:

  1. Connect to the new ESXi server (ESXi 6.7 in this example) using the vSphere Web Client;
  2. Connect the disk to the new host and perform storage rescan (if your VMFS is located on an iSCSI LUN, you connect to it according to the guide);
  3. go to Device tab, and find your LUN in the list. Make sure ESXi sees VMFS there division; vmfs see partiton vs spare client

    If the VMFS datastore is deleted from the storage device, see “How to recover accidentally deleted VMFS datastore?” Check the post

  4. Connect to the ESXi host’s console via SSH and run the command: vmkfstools -V vmkfstools: mount vmfs partition esxi cli
  5. This command should find the available VMFS partitions on the disk and mount them;
  6. Open vSphere Client and make sure your VMFS storage is now available. click on it and select Mountain,mount vmfs datastore in vsphere client
  7. Open Datastore browser. Now you can access all files on VMFS datastore. You can find the required vmx files, register them on the current ESXi host, and run critical virtual machines right away.
In previous versions of ESXi (6.5, 6.0, 5.x), it was possible to mount an existing VMFS volume from the vSphere Client GUI. To do this, select keep existing signature Options when adding a new VMFS datastore.connect vmfs keep existing signature

Accessing VMFS Datastore from Windows

To mount a VMFS partition and access virtual machine files from Windows, you will need a special Java driver – Open Source VMFS Driver, This driver requires Java version 6 or later and allows mounting VMFS volumes in read-only mode.

You can download the open source VMFS driver here: https://code.google.com/archive/p/vmfs/, This project hasn’t been updated since 2010 and the latest version of the driver available on the site is VMFS driver r95, which only supports VMFS 3 (< VMware ESXi 5.x).

Comment, If you try to mount in a newer version of VMFS, you will receive an error message: No VMware file system found,

  1. Download the open source VMFS driver (fvmfs_r95_dist.zip) and extract it to any directory (eg, C:\vmfs);
  2. You can check the operation of java-application fvmfs.jar as follows:
    cd \vmfs
    java -jar fvmfs.jar
  3. Next, you need to determine the number of disks containing the VMFS datastore connected to your Windows computer. You can find the disk number in the Disk Management console or by using diskpart (in our example, the connected disk has index 1 – disk 1. For the fvmfs driver, this disk has the following name \\.\PhysicalDrive.1,
  4. Try to get information about this disk:
    java -jar fvmfs.jar  \\.\PhysicalDrive1 info

    java -jar fvmfs.jar \\.\PhysicalDrive1 info

  5. Share this disk with WebDAV:
    java -jar fvmfs.jar \\.\PhysicalDrive1 webdav
  6. Make sure the WebClient service is started. If the service is disabled, run it;start webdav service
  7. Mount shared disk:
    net use *
  8. A new disk with a read-only VMFS datastore will appear in Windows; vmware esxi vmfs partition show in windows
  9. Do not close the Command Prompt window when working with files on the VMFS datastore.

Leave a Comment