Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • 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 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, or ESXi

June 8, 2023 LinuxUbuntuVMWareWindows Server 2022

How to Access VMFS Datastore from Linux, Windows, or ESXi

Let’s look at several ways to access data stored on the datastore with the VMFS file system of the ESXi host (these are configuration files, data files, and snapshots of virtual machines) from Linux, Windows, and VMware hypervisor. Actually, this article is based on a real case of our client when a single VMware ESXi host has 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 (on VMware Workstation or even on Hyper-V). Common operating systems (Windows and Linux) by default won’t see data on a partition with a VMFS file system, because they don’t have a VMFS driver

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

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

Let’s look at how to mount a partition with the VMFS file system on a computer running 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) andVMFS 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 data on a VMFS6 file system:

# apt-get -y install vmfs6-tools

install vmfs6-tools on linux

Create a mount directory:

# mkdir /mnt/vmfs

Get the disk name and partition type:

# fdisk -l

In our example, you can see that the /dev/sdb drive has an sdb1 partition with the VMware VMFS file system.

check vmware vmfs partiion on linux

Note. To access the GPT partition table on disks 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 contained a VMFS6 file system and mounted it to the target directory.

Virtual machine files on a VMFS disk are available for you in read-only mode and you can copy them or quickly run them with VMware Player/Workstation.

accessing vmware vm files on vmfs from ubuntu linux

An error may occur while mounting a 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 VMFS 5 datastore:

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

Mounting VMFS Partition on a New VMware ESXi host

Above, we looked at how to mount VMFS partition using third-party VMFS drivers. However, the most universal way to access data on a VMFS data store 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). I think this is the easiest way to mount a VMFS volume from a physical hard drive or LUN on a storage array device (connected via Fiber Channel or iSCSI).

Follow the steps below to mount an existing VMFS datastore on a new ESXi host without formatting it:

  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 it according to the guide);
  3. Go to the Devices tab, and find your LUN in the list. Make sure ESXi sees the VMFS partition there; view vmfs partiton vsphere client
    If the VMFS datastore has been removed from the storage device, check the post “How to recover an accidentally deleted VMFS datastore?”
  4. Connect to the console of the ESXi host via SSH and run the command: vmkfstools -V vmkfstools: mount vmfs partition esxi cli
  5. This command should find available VMFS partitions on disks and mount them;
  6. Open vSphere Client and make sure your VMFS storage is now available. Click on it and select Mount;mount vmfs datastore in vsphere client
  7. Open the Datastore Browser. Now you can access all files on VMFS datastore. You can find the necessary vmx files, register them on the current ESXi host, and immediately run critical virtual machines.
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 the Keep the existing signature option when adding a new VMFS datastore.connect vmfs Keep the existing signature

Accessing VMFS Datastore from Windows

In order to mount the VMFS partition 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 a read-only mode.

You can download Open Source VMFS Driver here: https://code.google.com/archive/p/vmfs/. 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 (< VMware ESXi 5.x).

Note. If you try to mount to a newer version of VMFS, you will receive an error message: No VMware File System detected.
  1. Download Open Source VMFS Driver (fvmfs_r95_dist.zip) and extract it to any directory (e.g., C:\vmfs);
  2. You can check the operation of the java-application fvmfs.jar as follows:
    cd \vmfs
    java -jar fvmfs.jar
  3. Next, you need to determine the number of the disk containing the VMFS datastore 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);
  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 that the WebClient service is started. If the service is disabled, run it;start webdav service
  7. Mount the shared disk:
    net use * http://localhost:50080/vmfs
  8. A new disk containing read-only VMFS datastore will appear in Windows; vmware esxi vmfs partition show in windows
  9. Do not close the command prompt window while working with files on the VMFS datastore.

14 comments
4
Facebook Twitter Google + Pinterest
previous post
How to Deploy Windows 10 (11) with PXE Network Boot
next post
Using PowerShell Behind a Proxy Server

Related Reading

Removing Azure Arc Setup Feature on Windows Server...

November 9, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

Reset Root Password in VMware ESXi

October 12, 2023

How to Increase Size of Disk Partition in...

October 5, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

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 Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows
  • Recovering Files from BitLocker Encrypted Drive
  • Using iPerf to Test Network Speed and Bandwidth
  • Installing an Open Source KMS Server (Vlmcsd) on Linux
  • Monitoring Domain Name Expiration Date with Zabbix
  • How to Enable Two-Factor Authentication (2FA) for SSH on Linux
  • Install and Configure SNMP on RHEL/CentOS/Fedor
Footer Logo

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


Back To Top