Remove unused device drivers from Citrix gold image

It is advisable to keep your system clean from a lot of things but how many people perform a tidy up of unused, no longer present devices within Device Manager?

For most vDisks, the lifecycle will probably involve the image moving between different hosts possibly with different hardware. How many vDisks started off being built on a machine with a CD-ROM attached for example and now the production VMs don’t have the same hardware? Multiple NICs is also another reason (especially in VMware) that requires us to perform cleanups. VMs used to have 4 vCPUs now they have two, different disks etc. can all amount to the same problem of devices that used to exist but no longer do.

Old non-present device drivers can still use up server resources. The resource usage might be low but with Citrix farms come many servers normally sharing a gold image. Add all these servers together and the unneeded resource usage on hypervisors hosting these VMs start to build.

To remove redundant hardware device drivers from your image boot in to a maintenace mode version and run CMD as an administrator.1-min

Run command set devmgr_show_nonpresent_devices=1 followed by devmgmt.msc and press enter.2-min

Device Manager should now appear. Click View -> Show hidden devices.3-min

Now expand each component subsystem i.e. Batteries, Computer, Disk Drives. Look at how many components are actually no longer present in my machine, and this isn’t the full list either.4-min5-min

For each component that is now unavailable, right-click and select Uninstall.6-minShut down the VM when done, promote the vDisk to test, perform some testing to make sure everything is working and proceed from there! As you now know, working with gold images can potentially gather up a lot of different device drivers. Some hang around but a lot don’t so you should perform a cleanup once in a while.


Leave a Reply