Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Virtualization / VMWare / How to access VMFS Datastore from Linux, Windows and ESXi

April 3, 2018 VMWare

How to access VMFS Datastore from Linux, Windows and ESXi

Today we’ll discuss three simple ways to access the data stored on VMFS datastore of the ESXi host (these are configuration files, data files and snapshots of virtual machines) from Linux, Windows and ESXi. Actually, this article is based on a real case of our customer when the only productive server with VMware ESXi hypervisor has suddenly stopped working.

If your ESXi host crashes, but the local disk (disks) of the server are still functional, you can always copy the virtual machine files (both data drives and configuration files) from VMFS datastore and run VM on a different server (even on VMware Workstation or Hyper-V). The main problem is that the common operating systems (Windows and Linux) by default do not recognize the partition with the VMFS file system, because they do not have a VMFS driver. In this article we’ll look at how to access virtual machine files on a disk with a VMFS file system.

The issue was that backup of VMware virtual machines hadn’t been configured as well as there was no time to diagnose and solve ESXi host boot problems. Therefore, it was decided to manually copy the files of critical virtual machine from VMFS storage and run it on another host with an urgently installed ESXi.

Let’s examine three scenarios of accessing data on the VMFS datastore.

Contents:
  • How to Mount VMFS file system on Linux (Ubuntu)
  • Access VMFS Volume from Windows
  • Mounting an existing VMFS Datastore on a new ESXi host

How to Mount VMFS file system on Linux (Ubuntu)

You can mount a partition with the VMFS file system on a computer with Ubuntu installed (Ubuntu Live CD won’t suit us in this case).

Firstly, you have to connect a physical disk with VMFS file system to the computer (server) with Ubuntu. To access the data on the VMFS volume, you have to install a special third-party vmfs-tools package. This package allows you to access VMFS from non-ESXi hosts. You can access data on this partition in read-only mode. The second important limitation: the developers of vmfs-tools officially announced support for versions of the VMFS file system up to VMFS 5.0. The possibility to connect a partition with VMFS 6 (vSphere 6.0 and 6.5.) is not guaranteed.

Install the package with the following command:

apt-get install vmfs-tools
Note. In Ubuntu repository, only vmfs-tools 0.2.1 is available, and its main drawback is that it can work only with VMFS v3. If you need to mount a VMFS 5 datastore, you will have to download and install vmfs-tools 0.2.5 or higher, for instance, here:

  1. http://mirrors.kernel.org/ubuntu/pool/universe/v/vmfs-tools/vmfs-tools_0.2.5-1_amd64.deb – a package for a 32-bit system.
  2. http://mirrors.kernel.org/ubuntu/pool/universe/v/vmfs-tools/vmfs-tools_0.2.5-1_i386.deb – a package for a 64-bit system.

Download the corresponding package version as follows:

#wget http://mirrors.kernel.org/ubuntu/pool/universe/v/vmfs-tools/vmfs-tools_0.2.5-1_amd64.deb

And install it:

#dpkg -i vmfs-tools_0.2.5-1_amd64.deb

To install package dependencies, use this command:

#apt-get install vmfs-tools

After the package is installed, you need to create a mount point in which the VMFS partition will be mounted:

#mkdir /mnt/vmfs

The next step is to look into the partitions on the disks. creates a number of service partitions when installed in addition to the partition for virtual machine files (VMFS partition).

If the ESXi version is 4 or earlier, or a VMFS storage has been updated from VMFS 3 to VMFS 5, and its size doesn’t exceed 2TB, display the list of disks and partitions like this:

#fdisk -l

fdisk show esxi partitions in ubuntu

As you can see, the VMFS partition is /dev/sdb3 (label VMware VMFS).

Important. In ESXi 5 and later, VMFS v5 is used with the GPT partition table. GUID Partition Table allows to create larger storages (larger than 2TB), as well as connect RDM-drives in the physical compatibility mode. So to view the partition table you have to use the parted command instead of fdisk.

So, display the partition information as follows:

#parted -l

Now you only have to mount a partition with the VMFS storage:

#vmfs-fuse /dev/sdb3 /mnt/vmfs

List the contents of the mounted partition:

#ls -all /mnt/vmfs

Now you see all the virtual machine files on the VMFS storage that is available in read-only mode. That means that you can copy the directories and/or individual files of the necessary virtual machines to a separate drive and run them on another ESXi host.

Access VMFS Volume from Windows

To connect the VMFS volume and access virtual machine files from Windows, you’ll need a special Java driver – Open Source VMFS Driver. This driver requires Java version 6 or later and allows to mount VMFS volumes in read-only mode.

You can download Open Source VMFS Driver here: https://code.google.com/archive/p/vmfs/. At the current moment this project has not been updated since 2010 and the latest version of the driver that is available on the site is VMFS Driver r95, which supports only VMFS 3 (< ESXi 5).

Note. If you try to connect to a newer version of VMFS, you will receive an error message: No VMware File System detected.
    • Download Open Source VMFS Driver (fvmfs_r95_dist.zip and unpack it to any directory (e.g., C:\vmfs).
    • You can check the operation of the java-application fvmfs.jar as follows:
      cd \vmfs
      java -jar fvmfs.jar
    • Next, you need to determine the number of the HDDs containing VMFS storage that is connected to your Windows computer. You can find the disk number in the Disk Management Console or using diskpart (in our example, the connected disk has the index 1 – Disk1. For fvmfs driver, this disk has the following name: \\.\PhysicalDrive1).
    • Try to get information about this disk:
      java -jar fvmfs.jar  \\.\PhysicalDrive1 info

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

    • Share this disk with WebDAV:
      java -jar fvmfs.jar \\.\PhysicalDrive1 webdav
    • Make sure that service WebClient is started. If service disabled, run it.start webdav service
    • Mount the shared disk:
      net use * http://localhost:50080/vmfs
    • A new disk that contains VMFS datastore available for reading should appear in the system; vmware esxi vmfs partition show in windows
    • A new disk that contains VMFS datastore available for reading should appear in the system;
    • Do not close the console window while working with files on the VMFS storage.

Mounting an existing VMFS Datastore on a new ESXi host

As you can see, in both of the above cases, third-party VMFS drivers for Linux and Windows do not allow working with VMFS 6.0. Therefore, the most universal way to access data on a VMFS partition of a failed server is to connect its disks to a new ESXi server (you can install ESXi on a new host in less than an hour). This is the easiest way. In this way, you can reconnect both the physical hard disk and the LUN from the storage device (via FC or iSCSI).

The new ESXi host must correctly identify the attached VMFS datastore and you will be able to access the files on it.

Follow the steps below to connect an existing VMFS storage to a new ESXi host without formatting it:

  1. Connect to the new ESXi server using the vSphere Web Client;
  2. Connect the drive to the new server and run Storage rescan;
  3. Go to the Configure -> Datastores section and select Create a new datastore item;esxi add an existing vmfs datastore to a new host
  4. Select the storage type: Disk or LUN;
  5. In the list of available devices, select the connected drive (LUN) with the VMFS storage;
  6. Select the connection mode. Select Keep the existing signature item;connect vmfs Keep the existing signature
  7. Click the Finish button;
  8. Go to the host’s storage section. Select the connected storage. Its contents can be displayed by clicking on the Datastore browser button;vmfs datastore browser
  9. Now you can find the necessary vmx files, register them on host and immediately start the critical virtual machines.

14 comments
4
Facebook Twitter Google + Pinterest
previous post
Securing Administrative (Priveleged) Accounts in Active Directory
next post
How to Clear Pagefile.sys at Shutdown in Windows 10 / 8 / 7

Related Reading

Updating VMware ESXi Host from the Command Line

May 11, 2022

How to Change or Disable Session Timeout in...

April 13, 2022

How to Upgrade VM Hardware Version in VMware...

March 4, 2022

VMware PowerCLI: How to Install and Manage vSphere...

February 28, 2022

VMWare ESXi: Errno 28 — No space left...

February 1, 2022

14 comments

Censor September 23, 2015 - 8:11 am

Hi.
 
I cant mount the vmfs drive with  net use * http://localhost:50080/vmfs
Get error
System error 67 has occurred.
The network name cannot be found.
I can open the webaddress in IE and see the drive
Running Windows 2012 R2, java 8

Reply
Max September 24, 2015 - 11:13 am

Hy! Try to install Desktop Experience feature and check that Web Client service is running.

Reply
RERobbins November 5, 2015 - 6:30 pm

Is there a way to gain write access to a vmfs version 5 file system from a linux or windows machine?
The most recent version of vmfs tools that I’ve found only provide read access to vmfs version 5 file systems.

Reply
Max November 6, 2015 - 10:44 am

vmfs-tools provide read-only access to vmfs datastore
However, you can copy the virtual machine files to a different (working) vmfs datastore

Reply
RERobbins November 6, 2015 - 2:04 pm

My goal was to gain access to the VMFS to repair some broken things and not just pull data from it.  In the end, since my setup is rather small, I just bit the bullet and created new datastores and pulled what I needed from the old ones into the new ones then wiped out the old datastores which eliminated the problem.  It seems like something more surgical would have been better but in the end, I needed to get the job done.

Reply
Necronn99 March 29, 2017 - 8:46 pm

Always wonder why these examples are not on a REAL os like Red-hat or Cent. Ubuntu for kids.

Reply
Rafael October 17, 2017 - 7:26 pm

Hi, my problem is that I received the exception:
“Exception in thread “main” java.io.IOException: This file has no allocation table (RDM)”

What can I do?

Reply
Bill November 14, 2018 - 11:38 pm

This was an outstanding article that helped me get past a hurdle I was having cloning a bunch of new machines. FYI to others, keep in mind you should “sysprep” your windows OS after you start it up. Thanks for posting this!

Reply
Phil December 5, 2018 - 5:59 am

I don’t see “keep existing signature” as an option. I am using vmware esxi 6.7 – is this an older version in your screenshots?

Reply
admin December 6, 2018 - 4:30 am

This screenshot is from ESXi 6.0. What VMFS mount options are available in your ESXi 6.7?

Reply
Phil December 6, 2018 - 12:03 pm

Mount options aren’t available at all, so there’s 4 options instead of 5. Can only add a new datastore and it doesn’t show this device as available because it’s already formatted. It does show the drive under Storage Devices. And I’ve successfully found the partition with a windows tool.

Reply
James May 1, 2019 - 7:21 pm

PHIL, did you ever figure out a solution? I am running into the same issue, trying to use 6.7 and mount old VMFS

Reply
Mark May 30, 2019 - 8:26 pm

One option is to use qemu-img to convert to a raw or a qcow2 partition. Obviously this is painful if you need to boot up in VMware again but if you just need to grab files it is probably easiest to just convert to raw.

Reply
Andrew September 16, 2020 - 4:58 am

I got a need to restore data from failed RAID10. ESXi 6.5 was able to boot, but completely hangs on trying to do something like “ls /vmfs/volumes/”.
This article was a great start for data recovering operation! Everything worked fine. As I had to work with VMFS6 – there is another tool available: vmfs6-tools. The rest – worked in the same way.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows 7
  • Windows Server 2019
  • Windows Server 2016
  • Windows Server 2012 R2
  • PowerShell
  • VMWare
  • Hyper-V
  • MS Office

Recent Posts

  • Create Organizational Units (OU) Structure in Active Directory with PowerShell

    May 17, 2022
  • Windows Security Won’t Open or Shows a Blank Screen on Windows 10/ 11

    May 17, 2022
  • How to Manually Install Windows Updates from CAB and MSU Files?

    May 16, 2022
  • RDS and RemoteApp Performance Issues on Windows Server 2019/2016

    May 16, 2022
  • Deploying Software (MSI Packages) Using Group Policy

    May 12, 2022
  • Updating VMware ESXi Host from the Command Line

    May 11, 2022
  • Enable or Disable MFA for Users in Azure/Microsoft 365

    April 27, 2022
  • Fix: You’ll Need a New App to Open This Windows Defender Link

    April 27, 2022
  • How to Reset an Active Directory User Password with PowerShell and ADUC?

    April 27, 2022
  • How to Completely Uninstall Previous Versions of Office with Removal Scripts?

    April 26, 2022

Follow us

woshub.com

ad

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Adding Third-Party Drivers into VMWare ESXi 6.7 ISO Image
  • Invalid State of a Virtual Machine on VMWare ESXi
  • Windows Server Licensing for Virtual Environments
  • ESXi: Slow Disk Performance on HPE Gen8
  • System Logs on ESXi Host are Stored On Non-Persistent Storage
  • VMware vSphere 6.5 Licensing Guide
  • Unable to Unmount/Delete VMFS Datastore: The Resource Is in Use
Footer Logo

@2014 - 2018 - Windows OS Hub. All about operating systems for sysadmins


Back To Top