How to reinstall VMware Tools on a ParaVirtual VM

At a customer location I was asked to reinstall VMware Tools on machines, normally the customer would do this their selves, but after uninstall of the VMware Tools, the VM wouldn’t boot. They needed to reinstall the VMware Tools because of the issue encountered described in  VMware KB2063887

The issue is quite simple, it’s a chicken-egg kind of thing. VMware Tools includes the device driver for the PVSCSI Controller, without VMware Tools, Windows lost its driver for the PVSCSI controller and can’t boot from it.

So I created this how to for the customer, and thought it might be useful for others.

So what’s the trick. Actually if you ever changed a VM to use the ParaVirtual SCSI Controller, you boot the VM using it’s ‘normal’ SCSI controller, you add the PVSCSI and a (temporary) hard disk to it, wait for Windows to install all drivers and ‘see’ the hard disk connected to the PVSCSI. You then shutdown Windows, remove any temporary hard disk, remove the extra PVSCSI controller and change the type of the original controller to PVSCSI.  This is mostly doing the opposite:

This is done on Windows Server 2012R2, the process should be much the same on other versions.

20171018_001

Device Manager showing VMware hardware devices in default view.

20171018_002

Device Manager showing VMware hardware devices in Device by connection view.

  1. Add Temporary Hardware
    1. While the Virtual Machine is running, using the vSphere Client, select the Virtual Machine and open Edit Settings…20171018_003
    2. From the Pull-Down Menu New Device, select SCSI Controller
    3. Click Add, a new LSI Logic SAS Controller will be added.
    4. From the Pull-Down Menu New Device, select New Hard Disk
    5. Click Add, a new 40 GB Hard Disk will be added.
    6. 20171018_004

    7. From the Virtual Device Node Pull-Down Menu select New SCSI controller
    8. (Optional) Adjust the size of the new Hard Disk from 40 GB to 1 GB
    9. (Optional) From the Disk Provisioning Pull-Down Menu select Thin provision
    10. Click OK
    11. Almost instantaneous the added hardware is visible in Windows:

      20171018_005

      Device Manager showing the newly added LSI Adapter, SAS 3000 series, 8-port with 1068 SCSI controller and the added VMware Virtual disk SCSI Disk Device hard disk connected to it. The original two disks are still connected to the VMware PVSCSI Controller

      20171018_006

      Disk Manager showing the added Hard Disk. It does not have to be partitioned or formatted.

  2. Reboot
    1. Reboot the Virtual Machine.
    2. When the Virtual Machine starts, Windows will commit some changes to the device drivers.
    3. 20171018_008

      Windows is installing drivers for the added hard disk.

      When you are quick enough you might see the Plug and Play Device Setup running installing the hardware. (On my example server it took only a few seconds to install.)

      For those interested, the Kernel-PnP log shows what happened:

      20171018_009

      GridView showing Kernel Plug & Play events created by the following PowerShell command:

      Get-WinEvent -LogName Microsoft-Windows-Kernel-PnP/Configuration |
      Where-Object { $_.TimeCreated -ge ( (Get-Date).AddHours(-1) ) } |
      Select-Object TimeCreated,Message | Out-GridView
      
    4. Shut down the Virtual Machine
    5. TL;DR
    6. Important: If you should skip the reboot step and just shut down the Virtual Machine and start modifying the Virtual Hard Disk Configuration, you’ll be presented with a BSoD boot loop. “Your PC ran into a problem and needs to restart. We’re just collecting some error info, and then we’ll restart for you.”
      20171018_010

  3. Modify Virtual Hard Disk Configuration
    1. While the Virtual Machine is shut down, using the vSphere Client, select the Virtual Machine and open Edit Settings…
    2. In my example the Virtual Machine started with 2 original Hard Disks before the third one was added. Since only the first two disks are showed, to remove the third Hard Disk first we need to click on Manage other disks.
    3. In the Pop-Up window, hover above line Hard disk 3, and a gray icon with a white X is shown. Click this icon.
    4. The line changes and shows a checkbox Delete files from datastore. As long as you are sure that you are removing the newly added disk, check the checkbox.
    5. 20171018_011

    6. Click Close
    7. Back in the Edit Settings window, click OK
    8. Important: Only after closing Edit Settings with OK, the changes will be applied. If not applied the following steps cannot continue.

    9. Open Edit Settings
    10. Click the little triangle shaped toggle in front of each Hard disk to open the advanced settings.
    11. From the Virtual Device Node Pull-Down Menu select SCSI controller 1
    12. Important: The Logical Unit Number should stay the same, only the adapter number may change:

      • SCSI(0:0) must become SCSI(1:0).
      • SCSI(0:1) must become SCSI(1:1).
      • Etc.
    13. Click OK
    14. Start the Virtual Machine.
    15. Check if all disks are only connected to the LSI Adapter using Device Manager:
    16. 20171018_012

  4. Remove VMware Tools
    1. Click Start -> Control Panel -> Program and Features
    2. Select VMware Tools and click Uninstall.
    3. Click Yes
      20171018_013
    4. When the Uninstall is finished, reboot the Virtual Machine20171018_014
    5.  When the Virtual Machine is restarted, the Device Drivers for the VMware Paravirtual devices are missing (Unknown devices):

      20171018_015

  5. Install VMware Tools
    1. While the Virtual Machine is running, using the vSphere Client, select the Virtual Machine and click Guest OS -> Install VMware Tools…
    2. 20171018_016

    3. If the VMware Tools Setup is not started automatically, click Choose what to do with this disc Pop-Up.
    4. Click Run setup64.exe
    5. 20171018_017

    6. Install the VMware Tools using all defaults, unless you have a reason to change them.
    7. Click Next >, Next >, Install, Finish
    8. 20171018_018

    9. After the installation is finished, reboot the Virtual Machine
    10. 20171018_019

    11. After the reboot, shut down the Virtual Machine
  6. Reconfigure Virtual Hardware (Change back to Paravirtual SCSI Controller)
    1. While the Virtual Machine is shut down, using the vSphere Client, select the Virtual Machine and open Edit Settings…
    2. Click the little triangle shaped toggle in front of each Hard disk to open the advanced settings.
    3. From the Virtual Device Node Pull-Down Menu select SCSI controller 0
    4. Important: The Logical Unit Number should stay the same, only the adapter number may change:

      • SCSI(1:0) must become SCSI(0:0).
      • SCSI(1:1) must become SCSI(0:1).
      • Etc.

      20171018_020

    5. Click OK
    6. Important: Only after closing Edit Settings with OK, the changes will be applied. If not applied the following steps cannot continue.
    7. Open Edit Settings
    8. Hover above line SCSI Controller 1 LSI Logic SAS, and a gray icon with a white X is shown. Click this icon.
    9. 20171018_021

    10. The line changes and shows Device will be removed.
    11. 20171018_022

    12. Click OK
    13. Start the Virtual Machine. 
Advertisement