Select Page

We use XenServer to run Citrix XenApp workloads at my workplace. One of our initiatives has been the full automation of the Citrix XenApp image build, using Microsoft Deployment Toolkit (MDT). This is a free tool that makes it a fairly straightforward process to automate the building of the Windows Operating System, as well as any features / roles, and the installation and configuration of our various applications (such as Citrix).

During our time with MDT and XenServer, one thing we have noticed is that the network and disk copy operations are much slower than they should be. Breaking out the Google-fu, I was able to find an article on Citrix’s website that indicated there was a way to inject the XenServer drivers into the MDT boot ISO (WinPE). However, the article did come with a large “This is NOT Supported” stamp, so proceed at your own risk.

A typical disk image for us is about 35GB when built, and before the changes below, it would take approximately 8 hours from start to finish. Granted, that’s mostly waiting time, as the MDT system is doing all the hard work. But if we could reduce that time, that would increase the number of builds we could a day, especially if there were issues. With the tweaks below, our new image takes about 2 hours to build, so quite a bit faster. The OS installation part went from ~45 minutes, to under 7. That’s a HUGE improvement.

Please note, that this has only been test on Windows Server 2008 R2 on XenServer 7.0 and 7.1.

Here is what I was able to use in our environment to speed up the disk and network operations.

Step 1 – Update WinPE ISO in MDT for XenServer 7.0

  • Mount XS 7 ISO (to any available test / management Windows VM)
    • Extract tools for PE Image bitness
    • \client_install\managementagentx64.msi
    • msiexec /a “<source>\citrixxendriversx86.msi” /qb TARGETDIR=<target directory> /log c:\drvpe\admin.log
      • NOTE: the target directory does not need to exist prior to extraction
  • Unnmount XS 7 ISO

Step 2 – Import Drivers to MDT

  • Under your target Deployment Share (MDT Production), navigate to Out-of-Box Drivers, WinPE 5.0 (or similar) bitness (x64) (so, mine would be: WinPE 5.0 x64)
    • Right click, Import Drivers
    • Select the folder where the first driver resides, Next, Next, Finish. You should see the driver show up in the middle pane when you click on your WinPE version.
    • Proceed with the remaining drivers. I am going to install all 5 XenServer drivers, so my directories are:
      • <target directory>\Citrix\XenTools\Drivers\xenbus\x64
      • <target directory>\Citrix\XenTools\Drivers\xeniface\x64
      • <target directory>\Citrix\XenTools\Drivers\xennet\x64
      • <target directory>\Citrix\XenTools\Drivers\xenbvd\x64
      • <target directory>\Citrix\XenTools\Drivers\xenvif\x64

Step 3 – Configure WinPE to use the imported drivers

  • Right click on the Deployment Share and select Properties. Navigate to the Windows PE tab, and select your bitness from the dropdown (x64 in this case).
  • Select the Drivers and Patches tab, make sure that the selection profile exists, and that it is the one you want to modify, and note it for the next section.
  • Select the radio button for “Include all drivers from the selection profile”
  • OK out of all windows

Step 4 – Configure the WinPE selection profile to use the imported drivers

  • Expand the Advanced Configuration section under the target deployment share
  • Click on Selection Profiles, then double click (or right click -> properties) the selection profile noted in the previous section
  • Make sure that the correct Out-of-Box Drivers folder is selected (WinPE 5.0 x64 in our case)
  • Click OK

Step 5 – Rebuild WinPE ISO

  • Save a copy of your current boot images as backups. They are located in the \boot folder of your target deployment share on the file system.
    • For me, that’s D:\MDTProduction\boot. You can create a subdir called backup (or whatever) and copy your existing ISO(s) there.
    • We use XenServer with an ISO share, which also has a copy of the WinPE ISO, so I also renamed this file, just in case.
  • Right click the target deployment share -> Update Deployment Share
    • Select “Completely regenerate the boot images” and click Next
    • Verify your selection, and click Next to start
  • Copy your new ISO from the boot directory to your ISO / NFS share.
    • I kept the same ISO name, so all of my scripts continue to work
    • Boot your test VM and run a deploy. Our OS install went from about 45 minutes to slightly less than 7 for 2008 R2 SP1, fully patched.

Sorry that there aren’t any pictures – I’ll see about getting some in the near future and updating the article. Please let me know if this works for you, I’d love any feedback!

Tim