Installing VMWare Tools in Hyper-V and Citrix PVS

by DigitalExpl0it
·
Published September 21, 2018
· Updated September 21, 2018

How to install VMWare tools in a virtual machine on a Hyper-V hypervisor platform. Main purpose is to install VMWare tools on Citrix Provisioned VDisks (VHDX) without reverse imaging.

After searching the web for sometime I couldn’t find a method that worked for me. I was looking to install VMWare tools on a VHDX virtual hard drive that is used in a Citrix Provisioning (PVS) environment. The issue we face when installing VMWare tools is that it will try to update the network card (this is the main issue), while the VHDX file is being streamed from a PVS server. Once the network connection is broken the VDisk will freeze and lock up since it doesn’t know where to read/write to. I have found many sites and forums talking about reverse imaging which takes some time to do. If you have multiple gold images this can take some time, in my case 60 gold images. So I needed another solution that was faster.

As of right now, Hyper-V is the only virtual application that can mount VHDX files, VHD files is a different story. But the question still remains, how do we install vmware tools on another hypervisor? After searching the web again I found that there is a way to modify the MSI file for vmware tools. Before I begin I must note that I am running a VMWare 6.0 U2 environment. When you get the vmware tools ISO or zip file or how ever you want to receive them you will find two executable and no MSI files. At first this doesn’t help us since we need to modify a MSI package. Well VMWare did do something right here, you are able to extract these executable. Note one will be for 32 bit the other is for 64 bit windows.

Extracting VMWare tools:

The extracting command line arguments I have found online work but after the extraction is done it is missing folders and files. Certain cab files are unable to extract leaving with a broken extraction. Following the instructions from this forum post. VMWare has a KB article showing how to extract the executable found here KB2032184.

VMWare shows the command like this:

setup64.exe /A /P C:\Extract

The issue with the above command is like I mention before the extraction process has missing files. To over come this all you need to do is run the following command.

setup64.exe /x

This will extract the MSI file with two visual c++ distribution installers (32/64bit) into your temp folder (%TEMP%\folder) in my case it was “C:\Users\administrator\AppData\Local\Temp\1\{7595A850-FE4D-4273-84FA-9CC1068AFF7A}~setup”

Inside this folder are 3 files as mentioned above

– vcredist_x64.exe
– vcredist_x86.exe
– VMware Tools64.msi

Now we have the MSI file we can modify. To modify the MSI we need to download and install ORCA. This can be found here. Once you have installed ORCA run it and open the MSI package. We are going to remove one row from this package to allow us to run it within Hyper-V. On the left hand side look for “InstallUISequence” click on this and the right hand side should show you a new list of options. Look for “VM_CheckRequirements” right click it and select drop row. Now save the MSI and close ORCA. The MSI package is ready to use in Hyper-V

Mounting a VHDX virtual hard drive to Hyper-V:

Once you have your VMWare tools MSI package ready it is now time to mount the VHDX file to Hyper-V. Since I am doing this with a VHDX file from my PVS server I need to make note of the following:

– Merge base the Vdisk image
– Make sure no virtual machines are using this Vdisk

Once the Vdisk is ready you can have Hyper-V mount the VHDX file over the network using a UNC path or if you would like better performance you can copy the Vdisk locally and mount it that way.