How to Mount VMFS in Windows, Linux, and ESXi

Sometimes you may need to mount a VMFS datastore in Linux, Windows, or another ESXi host. VMFS is a file system created by VMware that doesn’t have native support in other operating systems (supported only on ESXi operating systems). This blog post explains how to mount VMFS in different scenarios and the limitations of the different methods.

NAKIVO for VMware vSphere Backup

NAKIVO for VMware vSphere Backup

Complete data protection for VMware vSphere VMs and instant recovery options. Secure backup targets onsite, offsite and in the cloud. Anti-ransomware features.

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

If a hardware failure occurs, you have several options. You may need to be able to mount disks with VMFS datastores to another ESXi server during disaster recovery. You may also need to mount a VMware VMFS file system on a Linux machine to copy VM data for recovery. You can mount VMFS on Windows too, but this is limited to only VMFS 3, which is outdated and not used in modern vSphere environments.  Examples of hardware failures are a broken motherboard on an ESXi server or a damaged storage controller such as a RAID controller, among others.

If you use separate SCSI or SAS (Serial Attached SCSI) disks or RAID 1 as directly attached storage, you can attach disks to another machine that has a SAS controller installed without additional steps. If you use RAID 10, RAID 0, or other array types, you need to use an identical RAID controller and install drivers on a Linux machine to detect the RAID volume with the attached disks.

Note: RAID 1 and RAID 10 are the most reliable RAID options, but RAID 1 is the easiest to recover. Using RAID 5 and RAID 6 has many disadvantages, including low reliability. Using non-raid disks in production environments is not recommended.

Before we start

In our example, we have an ESXi host with three datastores, each located on a separate disk for demonstration purposes.

  • Datastore000 is empty. The disk on which this datastore is located is a system disk that contains ESXi system partitions. ESXi is installed on this disk.
  • Datastore10a is located on a VMFS 6 volume and contains a Windows VM.
  • Datastore11 is located on a VMFS 5 volume and contains a copy of the Windows VM that is called Win-VM.

Three VM datastores are located on the ESXi server

Ubuntu 20.04.3 is a Linux machine on which we are going to mount VMFS file systems. We attach the two disks with datastore11 and datastore 10a to a Linux machine. Linux distributions don’t include the driver required to work with VMFS. For this reason, you need to install vmfs-tools, which is a free package and, after that, VMFS can be mounted in read-only mode.

How to mount VMFS 5 in Ubuntu

  1. Run commands as root. Use sudo -i to get the root privileges that are required to install VMFS tools.
  2. Install vmfs-tools from Ubuntu package repositories:

apt-get install vmfs-tools

The installed version of vmfs-tools is 0.2.5-1build1 in our case.

Installing VMFS tools on Ubuntu Linux

  1. Create a directory that will be used as a mount point:

mkdir /mnt/vmfs

  1. Check the names of disks and partitions with VMFS:

fdisk -l

Our disk with the VMFS 5 partition is /dev/sdb and the needed partition is /dev/sdb1

The VMFS 6 partition is /dev/sdc1

As you can see on the screenshot, the partition type is VMware VMFS. The unique disk identifier is displayed.

Checking VMFS partitions used for VM datastores

Note: You can use parted to view GPT partitions that are bigger than 2 TB:

parted -l

  1. Let’s mount our VMFS 5 partition to the /mnt/vmfs/ directory:

vmfs-fuse /dev/sdb1 /mnt/vmfs
How to mount VMFS in Linux - a VM datastore using VMFS is mounted in Ubuntu

How to mount VMFS 6 in Ubuntu

  1. Create a directory to be used as a mount point to mount VMFS 6 in Linux:

mkdir /mnt/vmfs6

Note: If you try to mount the VMFS 6 file system in Linux with vmfs-fuse, you get an error because vmfs-fuse supports VMFS 3 and VMFS 5 but doesn’t support VMFS 6. In this case, the following message appears:
 
VMFS: Unsupported version 6
>Unable to open filesystem

VMFS tools don’t support VMFS 6

You need to install VMFS6-tools which contains vmfs6-fuse that is used to mount VMFS 6 in Linux. You can find VMFS6-tools on a website with deb packages: https://packages.debian.org/sid/vmfs6-tools

  1. Download the current version of VMFS6-tools:

wget http://http.us.debian.org/debian/pool/main/v/vmfs6-tools/vmfs6-tools_0.1.0-3_amd64.deb

  1. Install the downloaded deb package:

dpkg -i vmfs6-tools_0.1.0-3_amd64.deb

Installing VMFS 6 tools to mount VMFS in Linux

Note: libc6 >= 2.28 is required to install VMFS6-tools. If you use Ubuntu 18, you may encounter errors during installation for this reason.

  1. Now you can mount VMFS in Ubuntu 20 to /mnt/vmfs6 with the command:

vmfs6-fuse /dev/sdc1 /mnt/vmfs6

Viewing contents of a VM datastore with VMFS in Linux

The VMFS 6 file system has been successfully mounted in Ubuntu 20 in read-only mode. Now you can copy VM files to the needed location. You can temporarily run copied VMs on Linux with VMware Workstation installed or on a Windows machine with VMware Workstation or Hyper-V until your ESXi server hardware is repaired or a new server is delivered (if you don’t have another ESXi host to run the VMs).

Remember that when you copy thin provisioned disks from a VMFS file system to ext4, NTFS, or other conventional file systems, the virtual disk files take up as much space as if they were thick provisioned. That’s why be ready to prepare enough disk space.

How to mount VMFS with multiple extents in Linux

Let’s look at a more complex example of mounting VMFS in Linux when a VMFS volume consists of two extents. We have two disks of the same size, which are combined into a single VMFS volume (datastore12).

A VM datastore that consists of two VMFS extents

  1. Check the names of partitions:

fdisk -l

or

parted -l

Our two VMFS extents are located on the /dev/sdd1 and /dev/sde1 partitions.

Checking VMFS partitions that are used as extents for a VM datastore in Ubuntu

  1. When mounting a VMFS file system that consists of multiple extents, use vmfs6-fuse with the command of the following format:

vmfs6-fuse exent_1 extent_2 extent_n mount_point

In our case the command is:

vmfs6-fuse /dev/sdd1 /dev/sde1 /mnt/vmfs6

As you can see on the screenshot below, the VMFS 6 file system, which consists of multiple extents, has been successfully mounted in Ubuntu.

A multi-extent VMFS datastore is mounted in Ubuntu with vmfs6-fuse

Now you know how to mount VMFS in Linux in different scenarios.

Mounting VMFS Partitions on a New VMware ESXi Host

You can mount VMFS datastores on different ESXi hosts. This option is useful when one of the ESXi hosts has failed and you need to copy data from a VMFS partition or run VMs stored on that partition. You can even perform the new ESXi installation on a server to mount existing VMFS datastores. The ESXi installation process is fast and straightforward and it usually takes a few minutes to install this hypervisor.

The advantage of this approach to mount existing VMFS datastores is that you use native software and the newest VMFS versions are supported in the read/write mode. Let’s look at how to mount VMFS datastores that already exist on another ESXi host.

  1. Connect physical disks with VMFS partitions to the physical server on which ESXi is installed.
  2. Log in to VMware Host Client in your web browser by entering the IP address of the ESXi host to which you have mounted a disk or disk array with a VMFS partition (partitions). We use ESXi 7.0 in our example.
  3. Go to Storage > Devices and check whether the needed disks are displayed. Click Rescan if the disks are not displayed automatically.

Mount VMFS datastore ESXi – rescan disks

  1. Go to Storage > Datastores and check whether your existing VMFS datastore is mounted. If you see a successful result, open the Datastore browser and copy the needed files. You can also find VMX files, register virtual machines, and run them on this ESXi host. If you right-click the VMFS datastore, you can see the Mount/Unmount options in the context menu.

ESXi mount VMFS partition

How to Mount VMFS in Windows

The ability to mount VMFS in Windows is limited because you can use existing tools to mount only VMFS 3, which is outdated and not used in modern vSphere environments. VMFS 3 was supported in ESXi versions older than 5.0. VMware vSphere 7.0 doesn’t support VMFS 3.

At the time of writing of this post, VMFS 5 and VMFS 6 are widely used.

However, if you need to mount VMFS in Windows and the file system is VMFS 3, you can use the Open Source VMFS driver written on Java. This driver was last updated in 2010 and requires Java installed in Windows.

  1. Connect a disk (disks) with a VMFS datastore to your Windows computer.
  2. Download the Open Source VMFS driver by using the link: https://code.google.com/archive/p/vmfs/
  3. Extract the files from the downloaded fvmfs_r95_dist.zip archive to a custom directory, for example, C:\VMFS
  4. In Windows Command Prompt (CMD), go to the directory where you have extracted the Open Source VMFS Driver and run fvmfs.jar which is a Java application.

cd C:\VMFS

java -jar fvmfs.jar

  1. Open Computer Management in Windows (right-click My Computer > Manage) and go to Disk Management. Determine which number is assigned to your disk with the VMFS datastore, for example, index 1 – Disk1. This number is interpreted for the VMFS driver as \\.\PhysicalDrive1
  2. Get information about this disk in the console:

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

  1. Share this disk by using the WebDAV protocol. The WebClient Service must be started in Windows for this purpose.

java -jar fvmfs.jar \\.\PhysicalDrive1 webdav

  1. Mount the shared disk with VMFS in Windows by using the command:

net use * http://localhost:50080/vmfs

  1. Check disks in Computer Management. After a disk letter is assigned, you can open this disk in My Computer (Windows Explorer) in read-only mode to view and copy files from the VMFS disk volume.
  2. Don’t close the CMD window until you finish working with the VMFS volume mounted in Windows.

Conclusion

We have explained how to mount VMFS in Linux, Windows, and ESXi. The easiest way to mount existing VMFS datastores is attaching the disks to another ESXi host. However, you can mount VMFS in Linux in the read-only mode, including the latest VMFS 5 and VMFS file systems. VMFS tools and VMFS 6 tools are used for this purpose. As for Windows, VMFS support is quite limited for existing tools and doesn’t allow you to mount the latest VMFS versions in Windows.

Manual VM recovery by copying files from a VMFS file system mounted to a healthy computer after an ESXi host failure can be time-consuming. You can protect data in a more efficient way if you use a professional backup solution such as NAKIVO Backup & Replication that supports VM backup on the host level, thin provisioned disks, instant VM recovery, and instant granular recovery. Restoring VM data from a backup can be more effective than manual VMFS recovery.

1 Year of Free Data Protection: NAKIVO Backup & Replication

1 Year of Free Data Protection: NAKIVO Backup & Replication

Deploy in 2 minutes and protect virtual, cloud, physical and SaaS data. Backup, replication, instant recovery options.

People also read