November 9, 2022
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.
- How to Mount VMFS in Linux
- Mounting VMFS 5 in Ubuntu
- Mounting VMFS 6 in Ubuntu
- Mounting VMFS with multiple extents
- Mounting VMFS Partitions on a New VMware ESXi host
- How to Mount VMFS in Windows
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.
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
- Run commands as root. Use sudo -i to get the root privileges that are required to install VMFS tools.
- 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.
- Create a directory that will be used as a mount point:
- Check the names of disks and partitions with VMFS:
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.
Note: You can use parted to view GPT partitions that are bigger than 2 TB:
- Let’s mount our VMFS 5 partition to the /mnt/vmfs/ directory:
How to mount VMFS 6 in Ubuntu
- Create a directory to be used as a mount point to mount VMFS 6 in Linux:
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:
Unable to open filesystem
- Download the current version of VMFS6-tools:
- Install the downloaded deb package:
dpkg -i vmfs6-tools_0.1.0-3_amd64.deb
Note: libc6 >= 2.28 is required to install VMFS6-tools. If you use Ubuntu 18, you may encounter errors during installation for this reason.
- Now you can mount VMFS in Ubuntu 20 to /mnt/vmfs6 with the command:
vmfs6-fuse /dev/sdc1 /mnt/vmfs6
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).
- Check the names of partitions:
Our two VMFS extents are located on the /dev/sdd1 and /dev/sde1 partitions.
- 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.
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.
- Connect physical disks with VMFS partitions to the physical server on which ESXi is installed.
- 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.
- Go to Storage > Devices and check whether the needed disks are displayed. Click Rescan if the disks are not displayed automatically.
- 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.
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.
- Connect a disk (disks) with a VMFS datastore to your Windows computer.
- Download the Open Source VMFS driver by using the link: https://code.google.com/archive/p/vmfs/
- Extract the files from the downloaded fvmfs_r95_dist.zip archive to a custom directory, for example, C:\VMFS
- 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.
java -jar fvmfs.jar
- 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
- Get information about this disk in the console:
java -jar fvmfs.jar \\.\PhysicalDrive1 info
- 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
- Mount the shared disk with VMFS in Windows by using the command:
net use * http://localhost:50080/vmfs
- 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.
- Don’t close the CMD window until you finish working with the VMFS volume mounted in Windows.
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.