Archives

Tag Archive for: ‘vmware’
Mount VMFS on Centos 7 or another Linux distro

Why VMFS on CentOS 7?
I was running a VMware ESXi server since 4 years. In VMware ESXi the options for local storage are limited, especially when you like redundant storage. The option is to buy a Raid adapter. I decided to move to CentOS with ZFS storage.
Moving the VM’s to a Linux disk can be done by moving all the files to a NFS share, but an another option is to mount the VMFS filesystem. This is not natively available in Linux, but with fuse and vmfs-tools you can make it available. In this article I will describe how I did the installation and movement of the VM’s.

My baseline tools
I did a plain CentOS 7 installation, after the installation finished succesfully I connected my harddrive with the VMFS file system to the Linux box.
The VMFS driver is not natively available, so you need to compile it yourself. Glandium programmed a userspace VMFS driver for linux, more about this can be found here: http://glandium.org/blog/?p=2539

Howto compile VMFS for CentOS 7?
Enable the EPEL repository for additional packages

wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-1.noarch.rpm
sudo rpm -Uvh epel-release-7*.rpm

Install the following packages for userspace filesystems

yum install libuuid-devel
yum install fuse fuse-devel 

Download the VMFS sourcecode

wget http://glandium.org/projects/vmfs-tools/vmfs-tools-0.2.5.tar.gz
tar -xvzf vmfs-tools*

Unpack and compile

cd vmfs-tools-0.2.5
./configure
make
make install

The programs will be installed in /usr/local/sbin

To mount a VMFS file system:

./vmfs-fuse /dev/sdb1 /mount

*When you recognize that vmfs-fuse command is not available on you’re system make sure that fuse, fuse-devel and libuuid-devel is installed before compiling.

Files can now be accessed from /mount

Thin-provisioned VMDK’s are copied as Pre-Allocated VMDK’s
I copied all the vm’s to my local Linux file system, but had some issues with the thin-provisoned vmdk’s. The become pre-allocated vmdk’s which uses a lot of space. With the following command you can convert them back to growing disks:

vmware-vdiskmanager -r sourceDisk.vmdk -t 0 targetDisk.vmdk

Conclusion
Installing the VMFS drives on Linux / CentOS can be usefull in case of migrations, but also in case of an emergency. It is realative easy to browse you’re VMFS filesystem from a non-VMware host.

Detect BIOS or UEFI / EFI from Windows PE

To detect whether you’re computer is running with a BIOS or UEFI, type the following command:

reg query HKLM\System\CurrentControlSet\Control /v PEFirmwareType 

The following results codes are available:

  • 0x1 = BIOS
  • 0x2 = (U)EFI

Depending on the BIOS or EFI the hard disk partitioning will use MBR (with BIOS) or GPT (with UEFI) when installing Windows 7 /8.

More information about the difference between GPT and MBR can be found on the Wiki pages:

GPT = GUID Partition Table (http://en.wikipedia.org/wiki/GUID_Partition_Table)
MBR = Master Boot Record (https://en.wikipedia.org/wiki/Master_boot_record)

VMware Workstation  and UEFI

Virtual UEFI firmware can be enabled on VMware Workstation 8.x or 9.x, but it is not officially supported.

To do so add the following line to your .vmx file of the virtual machine.

firmware = "efi"

Next time you start the Virtual Machine you will see this screen:


Instead of the BIOS screen of VMware. Starting installing Windows 8 in UEFI mode is now possible. Unfortunately it is not possible to enable Secure Boot in VMware yet.

Changing from BIOS to UEFI also changes the hardware of the Virtual Machine. Normally a VM identifies it as VMware Virtual Platform, with UEFI this is changed to ‘VMware 7.1’ (in my case). So be care full with this.

12