Thick or thin client

The standard user desktop can be delivered in radically different ways. While this is interesting technically, what difference does it make to your business? Some of the claims are just plain confusing or misleading.

The standard user desktop can be delivered in radically different ways: standard PC; netbook; virtualized applications; remote desktop; virtual desktop; virtual disk; the list goes on. It is a big subject, so it is hard to know where to start. There are use cases for different types of desktop that seem obvious, but the more you look into it the less obvious it is.

Let’s explode the problem to see what is actually happening. Then we can form a better view of how the methods differ. On the standard PC we have the following subsystems, all connected by the motherboard:

  • Processor
  • Hard drive
  • RAM Memory
  • Graphics
  • Network interface
  • Interfaces for different types of devices
  • Services like power and cooling
  • A BIOS that controls how they work together.

I am sorry this is so basic but we have to start somewhere. Obviously we could move different parts to different places. We could put the graphics controller and a few other bits and pieces near to the monitor and the user, and put the rest miles away in a cupboard somewhere. What would this achieve? There would be less noise and heat and it would take less space on the desk. Nothing to break or steal. Sounds good. What have we got? A Terminal. We could obviously explode our PC in lots of different ways to achieve different results. The different explosions that the engineers have given us are today:

  1. Remote KVM
    • Put the PC in a cupboard and operate the keyboard, video and mouse (KVM) remotely.
    • What exactly do we need locally? Just something to transmit the KVM signals presumably.
    • But KVM switches works only over short distances. Over long distances they need an IP communication protocol, with something as a server and something as a client.
    • Here’s how Adder do it: Infinity Transmitter and Receiver
  2. Remote PC
    • Put the PC in a cupboard and connect to it remotely using a remote communications protocol.
    • Strip it down so it shares components with other PC’s like power supply and cooling (a Blade PC).
    • Use a terminal with an operating system on the desk, to run a remote desktop client that communicates with a remote desktop server service.
    • Here’s how HP do it: HPBlade-Thin
  3. Remote Disk, or Remote Boot
    • With the remote PC I still need a terminal locally to run a remote desktop to it. The terminal has a processor, memory, and connections of its own. To avoid all this duplication why not keep those local and just put the hard drive in a cupboard. Then, obviously, instead of lots of hard drives I could use space on shared disks.
    • The trouble is, I have to get the OS or some of it at least into local memory. RAM is volatile, so I have to do it each time the machine starts up.
    • This works OK if the OS is a stripped down utility like a public kiosk, but not with a full desktop.
  4. Shared OS (aka Terminal Services)
    • Put the PC in a cupboard, but make it a very large PC and use the Windows OS to share out sessions to different users.
    • The OS method of sharing needs to be pretty good to make sure that one part-share of a big PC is as effective as a whole share of a smaller PC.
    • Windows has this built in as Remote Desktop Services. XenApp is a more specialized version: Citrix ICA Connection
  5. Shared hardware (aka Virtual Machine)
    • Instead of having lots of separate PC’s in a cupboard, I could use a Hypervisor on one large machine to share the same physical hardware between different OS instances and allocate one instance to each user.
    • The trouble is, the hypervisor has to run on an Intel processor the same as the virtual machine, so there are only so many multiples I can achieve. I could give one user a very powerful virtual machine, like a workstation. Or I could give 10 or 20 users a smaller machine, like a low-spec PC. But I can’t give lots of users a virtual workstation.
  6. No desktop!
    • Deliver every application into a web browser, instead of a full desktop. Cut out the middleman and go straight from a simple browser on a thin client or even an iPhone to an application on a server somewhere remote.
    • This is essentially what Google Apps are doing.
    • This works fine if every application you need is web-enabled, but if you need even one that isn’t (say, Adobe Photoshop) then you need something else.

All this remoting and sharing. Many of the descriptions are confusing. Many of the claims are misleading. We just need to understand how the box on the user’s desk communicates with the box in the cupboard, and what happens in the box.

To use a full desktop like Windows 7 remotely, we need to use an IP protocol running over ethernet. Everything you see at the remote end has to come via the TCP/IP connection and the communications protocol. A normal graphics cable to your monitor runs at around 4 Gbps or more. Over TCP/IP this has to come down to say 100 Mbps over a LAN, or down to some fraction of 1 Mbps over a WAN. Obviously if you have 10 users on a 2 Mbps WAN leased line, then the most they can have at the same time is 200 Kbps. To come down from 4 Gbps to 200 Kbps means that something has to give in what you can see on the screen and how fast you can work on the desktop.

  1. Microsoft use their own Remote Desktop Protocol (RDP). Remote Desktop Services (RDS) runs on the box in the cupboard, and Remote Desktop Connection (RDC) runs on the local box. They communicate using RDP.
  2. Citrix provide a heavily optimized proprietary protocol, Independent Computing Architecture (ICA). XenApp runs on the box in the cupboard. A Citrix client runs on the local box ("plug-in" for Windows, "receiver" for Linux). ICA does a lot of clever things to make the local response appear fast and consistent.

What is happening on the box in the cupboard is exactly the same as you could do if it were under your desk, with the same result. You can run multiple user sessions on one OS, or multiple virtual machines on one physical machine. You can break the physical hardware down from one box into separate Blade servers and SAN storage. You can add specialist graphics accelerators. What you are going to get as a remote desktop is exactly the same as if you were there, except it has to come over one of the remote communication protocols.

There is one thing to add. If we share the hardware of the remote box, we introduce an array of new problems about connecting users to the right machine and configuring that machine to have the right resources. For shared OS these are handled by Remote Desktop Services or XenApp. For shared hardware the connection broker, the virtual disk and so on are solving new problems created by virtualizing the box, not adding new features to the user’s experience.

So when people talk about, say, "a virtual application running on your thin client" what they mean is: "an application running on a box in a cupboard that you can interact with using a remote communication protocol". A "virtual desktop" is a virtual machine running on a box in a cupboard that you can interact with using a remote communication protocol. A "virtual disk" is shared storage for the box in the cupboard that you can interact with using a remote communication protocol.

What difference does it all make in practice?

A. Ergonomics

If you put the PC in a cupboard and connect to it remotely with a thin client there is no doubt it will take less space and create less heat and noise on the desk. You have just moved them somewhere else. You now have two processors, two lots of memory, two power supplies. But clearly, if the desk ergonomics are important, then a remote desktop works well.

B. Security

With the thin client there is nothing much to steal. No information is stored on the client after the user logs off. But with a well managed PC there is very little user data on the PC anyway and if you really want to, even that can be wiped each time.

In a very insecure environment, having literally only the bits of the remote desktop graphics present locally provides less opportunity to exploit. In a normal workplace it won’t make a difference.

C. Robustness

The only difference is a hard drive and a fan. With new solid state disks even this difference is gone. Hard drives don’t fail that often, and with a properly managed desktop, rebuilding the OS image is quick, easy and remote.

D. Cost

A huge subject, and I am not even going to try to generalize, but bear in mind that the thin client is only a remote access device to a desktop provided somewhere else, so it is an added cost, not a reduced cost. By and large, if you need a license to run something on the desktop, you need the same licenses to run it on a remote desktop.

E. Ease of management

Much the same tools are required to manage servers supplying the remote desktop, as the PC desktop. If the desktop is properly automated, one thousand PC’s are not more difficult to manage than servers supplying remote desktop to one thousand devices. There is some extra complexity to managing PC desktop (for example, Wake on LAN for automated patching) but this is balanced by the tools needed for the added complexity of the remote desktop sharing such as load balancing, printing and profile management.

F. Performance

The performance aspect is fascinating and a topic in itself. There is a trade-off between:

  • the amount of graphics needed to see what is going on, and
  • the amount of data that would need to be transferred between my desktop and a server (for example, a file server or application server), and
  • the amount of bandwidth available to me, and
  • the synchronicity of the transaction (I need to see graphics right now, but I can wait for a file to be printed).

If I have a lot of data going between desktop and server and not much bandwidth (for example running a report in a remote finance system), then it might be better if only the graphics have to be sent to me. If I am working with video (for example watching a training DVD), then I want it very local.

The XenApp ICA protocol will compress the graphics of a remote desktop to around 200 Kbps or less. This means we can get a perfectly adequate remote desktop over a WAN, provided we don’t need demanding video. We can open, edit and save a 10MB Powerpoint presentation in a blink with a remote desktop, whereas opening it directly over a 200 Kbps WAN connection would be hopeless.

The determining factor for the desktop is really where the data has to live, from every consideration:

  • where the user can have sufficiently responsive access to it
  • where it can be held securely and backed up
  • where you can authenticate to get to it
  • where all the people who need to get to it from different places can reach it
  • how it integrates with application data.

So for example, in a five person remote office, users will want fast access to their own personal data but unless you have a local server with UPS, cooling, and backup it may be better to put the data in a central data center and use a remote desktop to get to it.

G. Flexibility

Let’s say you have a wide range of different applications, used by different people on different desktops. Let’s also say that some are incompatible with others, or have different pre-requisites. Perhaps some users require Office 2003 while others are using Office 2007. Some applications might require Access 2000. Isn’t a local desktop, or a remote virtual desktop, more flexible to deal with this variety?

As long as the applications are not incompatible, you can install them all on a Shared OS remote desktop. You can control what shortcuts people actually see using Group Policy Preferences, or other third party solutions like AppSense. You can use application virtualization, to an extent, to isolate incompatible applications from each other.

To conclude:

Obviously there are many entirely different use cases where one type of desktop delivery works better than another. The aim of this blog is not remotely to generalise across different use cases. The aim is just to see what is actually going on when we remove the PC from the desk.

Windows 7 Deployment Part 7

There are several different tools for installing drivers in Windows 7. This blog aims to describe them and show how they differ.

Driver installation tools for Windows 7:

  • DISM
  • DPInst
  • DrvInst
  • PnpEnum
  • PnPUnattend
  • PnPUtil

DISM

Deployment Image Servicing and Management (dism.exe) is the new tool for modifying Windows images. It replaces the individual tools that were introduced for Vista images. There is plenty of documentation about DISM.

DISM is a "framework" tool that gives access to different "providers". The DISM host itself controls things like logging and rebooting. The different providers do the work with their own command line options, called by the DISM host.

  • CBSProvider (Component Based Servicing)
  • OSProvider (OS updates)
  • WIMProvider (handling the WIM file)
  • SMIProvider (Settings Management)
  • DMIProvider (Driver Management)

DISM is a tool for servicing both Online and Offline images. Dism /image:[path] refers to a mounted offline image. Dism /online refers to the current running image. However, you can not use DISM to add or remove drivers from an online Windows 7 image. The facility to do this does not exist. The commands /add-driver and /remove-driver apply only to offline images. When the image is Online:

  • you can add and remove updates
  • you can enable and disable features
  • you can not add and remove drivers.

Servicing in Audit mode, with the image online, uses PnPUnattend, not DISM.

DPInst

Driver Package Installer (DPInst.exe) is part of the Driver Installer Framework (DIFx) provided to vendors to enable them to distribute drivers. DIFx gives vendors three tools of varying complexity to install drivers. The intention is that the user just clicks Run and is insulated from the method used.

  • DPInst
  • DIFxApp
  • DIFxAPI
  1. DPInst is a very simple installer. Put the inf and sys files together in a folder with a copy of DPInst.exe. Execute DPInst and the driver is imported into the Driver Store. By default, the tool searches the current directory and tries to install all driver packages found.
  2. DIFxApp is a plug-in or extension to Windows Installer or InstallShield. It provides the actions that enable, for example, a Windows Installer msi to install drivers.
  3. DIFxApi enables the vendor to write custom installers.

So by using DPInst you would effectively be authoring a driver installation package on behalf of the vendor. Why does Microsoft provide DPInst at all? Because it has simple features to enable a vendor to distribute a driver, including:

  • localisation
  • customisation of text, icons and bitmaps
  • an option to add an EULA

It might be fun to use this to add drivers during deployment, but it is not what it is for.

DrvInst

DrvInst.exe is the Driver Installation Module of Windows 7. When Windows detects new hardware, DrvInst is the module that selects drivers from the Driver Store and sets up the driver for the hardware.

PnpEnum

PnPEnum.exe is a Microsoft utility that enumerates the Plug and Play hardware ID’s in a system. It is not part of the operating system. It is supplied as part of the Microsoft Platform Support Reporting tools. It is also part of Microsoft Deployment Toolkit (MDT).

In MDT 2010 it is used by the ZTIDrivers.wsf script as part of the task of importing drivers:

  • PnpEnum.exe outputs the hardware ID’s in pnpenum.xml
  • this is matched against the list of MDT Out-of-Box Drivers in drivers.xml
  • matching drivers are copied to c:drivers
  • c:drivers is defined as the Driver Path in the PnPCustomization component of WinPE or auditSystem.

PnPUnattend

PnPUnattend.exe is part of the operating system. During the auditSystem pass of setup (if there is one configured to run) it automatically imports drivers in the path defined in the unattend.xml PnpCustomizationsNonWinPE component.

This is specifically to install drivers from a path, unattended, as part of the Audit pass of setup. The command line options are: /s to search the driver path without importing; and /l to show logging information.

PnPUtil

PnPUtil.exe is part of the operating system. PnPUtil is a command-line tool to add and remove third party plug and play drivers. After Windows 7 is deployed, you can use PnPUtil to add or update specific drivers.

  • PnPUtil -a imports the specified driver or drivers
  • PnPutil -e lists the third party drivers that have already been added (but it does not provide a facility to pipe the output to a file)
  • PnPUtil -d deletes the specified third party driver.

Windows 7 Deployment Part 6

Importing a block of drivers into an image takes quite a bit of time. This is not important before deployment, but during deployment it can add many minutes to the imaging process. During deployment you really want a process to inspect the target computer and obtain just the drivers required for it. For this we need specialist tools. Microsoft Deployment Toolkit (MDT) 2010 does this. It is interesting to see how it does it.

In Microsoft Deployment Toolkit (MDT) 2010, open the Deployment Workbench and import drivers into the Out-of-Box Drivers folder.

WorkbenchImportDrivers

You can also filter the drivers into Selection Profiles

WorkbenchSelectionProfile

In the Task Sequence, select the Preinstall action Inject Drivers

TaskSequencePreInstall

When we study the Setup methods and the unattend.xml syntax, there is no such thing as "Preinstall", and no component to "inject" drivers, so what is going on?

Here is what happens when you use the MDT Preinstall task sequence to inject drivers:

  1. MDT uses its own tool PnpEnum.exe in the WinPE pass to:
    • enumerate the hardware devices on the computer
    • identify drivers for these devices in the Out-of-Box Drivers folder on the server
    • copy them into a folder in the offline image, C:Drivers
  2. Setup performs an Offline Servicing pass
    • The folder C:Drivers is specified as the DriversPath In the PnPCustomizationWinPE component of the Offline Servicing Pass
    • Deployment Image Servicing and Management (DISM) does its stuff to import the drivers
  3. During the Specialize pass, Setup selects and installs drivers from the Driver Store as normal.

The DISM import process took 1 minute on a test VM, because only the required drivers were imported, not all the drivers in the Out-of-Box Drivers folder. Apart from that, the process is the same as the DISM process performed in Offline Servicing.

Here are the details of the process:

  • The MDT scripted installation process running in WinPE executes the ZTIDrivers.wsf script
  • ZTIDrivers runs PnpEnum.exe from the Deployment Share on the server. PnpEnum is an MDT tool that enumerates the hardware devices in the computer. The script pipes the output to a local file PnpEnum.xml.
  • ZTIDrivers looks at the Selection Profile for this Task Sequence and finds the folders on the network with the drivers matching the profile.
  • ZTIDrivers processes each hardware device in PnpEnum.xml and checks if there is a matching driver.
  • If there is, the driver is copied to C:Drivers.
  • The ZTIDrivers script ends.
  • By default there is an offlineServicing pass, and if there are drivers in C:Drivers they will be imported.

So the trick that MDT has performed is to find only the required drivers, instead of a large block of drivers. The process of importing and selecting the drivers is exactly the same as if you had used Windows Deployment Services (WDS) with an unattend.xml file built with Windows System Image Manager (WSIM).

Windows 7 Deployment Part 5

If you have only a few standard models of computer in the organisation then you can maintain specific Windows 7 images for each. But if you have many models you may want to be able to add or update drivers without capturing a new image.

This piece looks at the different ways you can add drivers, and what happens when you do.

You can add or remove drivers in two main ways:

  1. Servicing the image as a file
  2. Running Windows 7 in Audit mode.

You can do either of these at two different places in the deployment workflow:

  1. On a base image, recapturing the image as an updated or customised version of the base before it is deployed anywhere
  2. While deploying an image to a specific production computer.

This gives you four potential methods:

  1. Servicing the image before deployment
  2. Servicing the image during deployment
  3. Running in Audit mode before deployment
  4. Running in Audit mode during deployment.

First, a bit of background about how Windows 7 manages drivers. Windows 7 keeps a database of approved drivers in a special folder called the Driver Store. This folder has Full Control permissions only for System and Trusted Installer. Therefore the interactive sesson cannot write to it and a system process is needed to import drivers into it.

The processes involved in using a driver from the Driver Store are:

  • Windows detects new hardware
  • Windows selects the best match drivers in the Driver Store and sets up the hardware with the drivers.

The default Driver Store in Windows 7 has in the order of 650 sets of drivers.

DriverStoreFolderCount1

1. Servicing before deployment

Before deployment the Windows 7 image exists as a file. The file can be opened and manipulated. Deployment Image Servicing and Management (DISM) is the new tool to do this. DISM is supplied as part of the Windows Automated Installation Kit (WAIK), which you set up on any deployment workstation or server. DISM mounts the image file (.wim) as a folder in Windows, giving you the opportunity to add files or edit the registry.

After mounting the image with dism /mount-wim, you add drivers to the driver store with dism /add-driver. You then commit the changes and unmount the image. Obviously you could do something like add a set of Dell drivers to a default image and commit it as a customised image for Dells.

Dism /add-driver reads each driver INF file provided in the command line and does the following:

  1. Imports the driver package into a new folder in the Driver Store AddDrivers2
  2. Indexes the INF file as oem#nnn in the %SystemRoot%inf folder AddDrivers4
  3. For boot critical drivers only:
    • creates the registry keys in the offline registry hive
    • copies files into %SystemRoot%System32 and %SystemRoot%System32Drivers
    • copies files into %ProgramFiles%[Vendor].

Dism /add-driver does not run the DrvInst process to select the driver. This only happens online.

For three devices from one vendor this took 11 minutes. Now these drivers will be loaded on boot or evaluated by Plug and Play on hardware detection the same as if they had been shipped with Windows.

DriverStoreFolderCount2

You can also use DISM to:

  • enable or disable Windows features
  • apply Windows updates (but not service packs)
  • add or remove a language pack, and configure international settings

2. Servicing during deployment

You can modify the Windows 7 image after it is copied to the computer but before it boots by performing an Offline Servicing pass in Setup.

To add drivers during the Offline Servicing pass you need to configure the sysprep unattend.xml file.

To configure the file with Windows System Image Manager (WSIM), which is also part of the WAIK:

  1. Open the Distribution Share. WSIMOutofBoxDrivers
  2. Right click the Out-of-Box Drivers folder and select Insert Driver Path to Pass 2 offlineServicing. The required component is added to your unattend.xml file.WSIMAddDriversPathOfflineServicing
  3. The path can be the Distribution Share, or it can be a folder in the image like C:Drivers, or both. If a network share, you can specify credentials.

Note that WSIM is just a GUI for editing the unattend. The Out-of-Box Drivers folder shown in the Distribution Share is a way of adding the correct path.

Here is what happens when you perform Setup with an offlineServicing pass:

  • WinPE, after partitioning the disk and laying down the image file, moves into an offlineServicing pass and calls Deployment Image Servicing and Management (DISM)
  • DISM imports the driver package from the Driver Path you specified into a folder in the Driver Store, in the same way as it does before deployment.

After the offlineServicing pass, Windows boots as normal into the Specialize pass where DrvInst is called to select matching drivers from the Driver Store based on driver ranking.

3. Audit mode before deployment

Another way to add or update drivers before deployment is to perform an Audit pass. The Audit pass is a way of booting Windows without completing the normal Windows Welcome to complete the setup. The difference between servicing an offline image and an Audit pass is that in Audit mode the OS is actually running. DISM before deployment will install drivers and updates, but it will not install user applications or service packs. You can do these things with an Audit pass.

Specifying an Audit pass instead of OOBE during capture of the base image

SysprepAudit

To add drivers automatically during the Audit pass you need to configure the sysprep unattend.xml file:

  1. Open WSIM.
  2. Right click the Out-of-Box Drivers folder and select Insert Driver Path to Pass 5 auditSystem. The required component is added to your unattend.xml file.WSIMAddDriversPathAuditSystem
  3. As with Offline Servicing, the path can be the Distribution Share, or it can be a folder in the image like C:Drivers, or both.

Here is what happens when you select an auditSystem pass and specify the Driver Path:

  • Windows 7 boots into Audit mode
  • Setup launches PnPUnattend.exe
  • PnpUnattend imports the driver package into a folder in the Driver Store
  • Indexes the INF file as oem#nnn in the %SystemRoot%inf folder
  • Prompts the user for unsigned driversAuditPassUnsignedDriver
  • At the end of the import, DrvInst runs to install drivers for detected hardware.

On a test VM this process took 9 minutes. You then need to run sysprep to generalize the image again before re-capturing it.

Note that in the Audit pass we used a similar component in the unattend as we did for offlineServicing but:

  • In Offline Servicing setup used DISM
  • In Offline Servicing setup does not run DrvInst to set up the hardware with the driver
  • In Audit mode setup used PnpUnattend
  • In Audit mode setup does run DrvInst to set up the hardware with the driver.

You can also use Audit mode to:

  • install software
  • apply service packs
  • check that the image fully works.

4. Audit mode during deployment

You can also perform an Audit pass while deploying the image to its final destination computer, after Windows boots, but before OOBE. Once in Audit mode you can install drivers and software. The computer will remain in audit mode until you run sysprep /oobe /restart.

Obviously during deployment you want this all to be automatic. You can configure this in the unattend.xml:

  • use the PnpCustomizationsNonWinPE component of the auditSystem pass to specify a Driver PathWSIMAddDriversPathAuditSystem
  • use the Deployment component of the auditUser pass to reseal at the end of Audit and reboot into OOBE

Setup will call PnpUnattend.exe to import the drivers in c:drivers into the Driver Store and then use DrvInst.exe to install them.

Summary

  1. You can install drivers (and customize the Windows 7 image in other ways) before or during deployment.
  2. You can use Offline Servicing or Audit mode at either time.
  3. Offline Servicing uses DISM. Audit mode uses PnPUnattend.
  4. The process of importing drivers into the Driver Store and selecting a driver to match a Plug and Play hardware device is the same in either case.
  5. Importing drivers takes a significant amount of time. This does not matter before deployment. But during deployment you will want to minimise the number of drivers you import.
  6. Offline Servicing and Audit mode use the same PnPCustomization xml in the unattend.xml file to specify a driver path for the additional drivers.

Windows 7 Deployment Part 4

Time to deploy Windows 7. You take a look at your desktop and laptop inventory. Is it going to be easier to create an image for each model, or to create one image and to add the different drivers and components required for each model? Adding drivers sounds more efficient, but creating different images is more straightforward. What are the trade-offs? And what tools do you need? The more you think about it the less clear it can seem.

If you have a limited range of models, and you decide to create one image for each model, you can use Windows Deployment Services (WDS) alone to create and deploy the image. You will:

  • Build your reference image
  • Run Sysprep to generalize it
  • Capture it
  • Add an unattend.xml to automate the deployment
  • Deploy it to the same make and model of computer.

However the default sysprep /generalize command during image capture strips out computer-specific information. This includes the device detection and driver selection information. In the sysprep /specialize pass during image deployment the computer re-runs the device detection and driver selection, and re-installs the drivers.

This adds minutes to each deployment. It can be a few minutes for a simple VM image, up to twenty minutes or more for a laptop. You can save a lot of time by using the sysprep option PersistAllDeviceInstalls in your Unattend to avoid stripping out and reloading the same drivers.

Here is the Unattend:

<unattend xmlns="urn:schemas-microsoft-com:unattend">
   <settings pass="generalize">
      <component name="Microsoft-Windows-PnpSysprep" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86">
         <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
      </component>
   </settings>
</unattend>

This has to go into an Unattend file used during image capture, not image deployment. Using WDS you will need to add the custom unattend.xml file to the reference image and run sysprep at the command line instead of the GUI before shutting down and capturing the image.

Custom unattend

Customizing the Generalize pass in WDS

This command line translates into the following:

  • Run the Generalize pass now
  • Run the Out of Box Experience when the computer next starts
  • Shutdown instead of restart, so the image can be captured with WinPE
  • Use the provided xml

This is just a small tweak to your workflow when using WDS to deploy images to the same make and model of computer. Don’t forget, you need to sysprep and capture an image that has not been joined to the domain.

In Microsoft Deployment Toolkit (MDT) 2010 the process of creating the reference image and capturing it is automated in a Task Sequence. However there is no opportunity to interrupt the task sequence to change the unattend.xml. Instead you modify the unattend file for the task sequence beforehand in the Workbench.

Customise unattend

Select the OS Info in the Task Sequence

Add to unattend

Edit the unattend.xml and save it

There is an option in the WDS Client (aka Windows Deployment Wizard) to Prepare to capture the machine, but stop before running sysprep. This would give you an opportunity to customise the image, including the unattend file.

Custom prepare

But there is no option to resume the capture, so you would choose this option if you want to hand the image over to a different capture process.

Windows 7 Deployment Part 3

If you want to perform completely unattended imaging, you need to change the computer so that it boots from the network when there is an imaging task. There are two ways you can do this:

  • You can change the boot device order so that a network boot is tried first. This is changed in the BIOS setup.
  • You can leave the boot order as it is but, when required, edit the boot configuration of the hard disk so there is no bootable partition. Then the boot sequence will fail through to the network.
  • Change the BIOS

    Normally when the computer boots there is a BIOS option F12 to break out of the boot sequence and perform a network boot. The computer then looks for a PXE server on the network to download an OS into RAM disk and boot from that. Obviously you have to be at the computer to press the F12 key.

    However if you press F2 to enter the BIOS setup you can change the boot device order to put the network boot first. When this is done, the computer will always first attempt a network boot. It will register itself with a PXE server and download a boot loader. This only takes a few seconds. The computer is then under the control of the boot loader program and can be told what to do next. It can:

    1. Wait a few seconds for user input before continuing with a normal hard disk boot
    2. Automatically proceed to download and boot from a boot image.

    Being under the control of the PXE server provides the opportunity to automate the imaging task. However you need a server deployment tool that can make use of this. WDS and MDT do not do this.

    To change the boot order you need to visit the computer. But if you are going to visit the computer you may as well do it when you re-image. And then you have no further need to change the boot order. So changing the boot order is really only relevant if you want to be able to perform unattended imaging of clients in the future. There are two ways you can set the boot order remotely.

    You can push out a BIOS update to the computers. If the computers are one or two years old this may not be a bad idea. You can use the vendor’s tools to do this.

    Here is an example of the HP BIOS update tools provided by Altiris.

    HP Altiris BIOS

    And the equivalent for Dell.

    Dell Altiris BIOS

    Or you can use Intel vPro. The Active Management Technology (AMT) feature enables you to create a security context between computers at the BIOS or firmware level. Once this security context is created you can use it to manipulate the BIOS remotely. AMT is a seriously heavyweight feature that enables secure management of the computer before the OS is booted, "Out of Band". You can power on, take an inventory (e.g recognise which computer it is) and perform operations on the disk without booting. To do this you need an AMT Management tool.

    AMT

    Change the Boot Configuration

    In Windows 7 the Boot Configuration is stored in the Boot Configuration Data Store. It is edited with BCDEdit. For fully automated imaging your deployment server can edit the boot configuration and then restart the computer to boot into an imaging task.

Windows 7 Deployment Part 2

With Windows Deployment Services (WDS) and Microsoft Deployment Toolkit (MDT) 2010 we can deploy images to our target computers with minimal interaction. We can automate selecting a different image for different makes and models of computer. We can optionally add drivers, applications, updates and features. What more could we need?

WDS and MDT are free components from Microsoft. You can have an almost fully automated deployment service with just these tools. If you have a small number of makes and models of computer – say a standard desktop model and a few different types of laptop – then you can build a dedicated image for each. The technician presses F12 at boot, and selects the image to apply. The rest is automatic. If you have a diverse range of makes and models, you can use the driver detection in setup to select and install drivers.

You can use Group Policy to install applications and configurations; or you can install an agent and pass the computer on to the control of a software distribution system. The only constraint is that someone has to be at the computer to initiate the process.

However you can avoid visiting the computer at all if the BIOS is set to perform a network boot first in the boot order. You set this by entering the BIOS setup, and changing the boot order.

Boot order

But:

  • You need to have visited the computer to make this change
  • You must already have a toolset that enables fully automated imaging.

When you set the computer to do a network boot first, it contacts the PXE server to obtain a Network Bootstrap Program. This tells the computer what to do next. By default it should time out if there is nothing to do and continue to boot from the hard disk. Otherwise it will begin the re-imaging job. With the WDS PXE Server:

  • pxeboot.exe offers a prompt to press F12 again to continue
  • pxeboot.n12 bypasses the second F12 and continues into a network boot
  • abortpxe.com aborts the network boot and continues into a normal boot.

Pxeboot

But to make use of this you need a deployment toolset that is capable of telling the computer what to do, based on an inventory of computers and jobs. If your computers are performing a network boot at present you already have this tool. And if they are not you would need to visit them anyway, to change the boot order.

The question then is whether as an organisation in future you want to be able to perform unattended imaging. If you do, then you need to both change the boot order on existing PC’s and adopt a deployment solution that enables it. If not, then you do not need a more complex deployment solution than WDS and MDT.

Windows 7 Deployment Part 1

You skipped Vista. Now you plan to start deploying Windows 7. You face a blizzard of jargon and you feel you should know how it all works. But what technologies do you really need, and how can you make rational decisions when everything is so muddled?

Here are just some of the terms:

  • DISM
  • Driver injection
  • DS
  • HII
  • ISO
  • KMS
  • Lite Touch
  • MAK
  • MDOP
  • MDT
  • OOBE
  • PE
  • PXE
  • Sysprep
  • TFTP
  • Unattend
  • WAIK
  • WDS
  • WIM
  • WSIM

And these are just the current terms. How about RIS, SIF, BDD, PKGMGR, INF in previous versions?

The first thing to note is that you need hardly any of this to perform consistent automated deployment. Deployment covers a vast spectrum of use cases, and it is important to focus on exactly what you need to do. A school re-imaging computers between lessons has very different requirements from a hardware vendor shipping PC’s, so a lot of the tools and techniques simply are not relevant to your own requirements. Here is a minimum automated deployment toolset:

  1. A USB drive with a bootable copy of the utility OS WinPE, and the network drivers for your make and model of PC
  2. The program imagex.exe stored on the USB, to capture and deploy the image of a reference computer
  3. Windows Automated Installation Kit (WAIK) on a technician’s workstation, to use Deployment Image Servicing and Management (DISM) to manipulate images and Windows System Image Manager (WSIM) to create unattend.xml files. WAIK is free, and it is a set of workstation tools, not a server product.

Waik menu

What else could we possibly need?

Well, firstly it is a bit uncontrolled to maintain copies of WinPE on USB drives, and images stored somewhere on the network. This will lead to people using different or wrong versions. If you have only one or two engineers you might be able to live with this, but otherwise you can automate the use of correct versions with Windows Deployment Services (WDS).

WDS provides a networking infrastructure to copy images down to the PC and up to the server. This includes copying the version of WinPE that you use to perform the imaging process, as well as the Window Image (WIM) file that contains the image of Windows 7. Using WDS means that you don’t need to maintain USB drives containing WinPE. When the PC starts, if you press F12 the PC will boot into a Pre-Execution Environment (PXE) stored on the network card itself. This enables the PC to contact the WDS server, through a DHCP advertising process. The WDS server responds by using Trivial File Transfer Protocol (TFTP) to copy a boot manager and a small file, boot.sdi, to the PC and this in turn will download and run WinPE. WinPE will run entirely in memory, as a RAM Disk, so that you are free to erase and re-partition the hard disk (or the SCSI array or whatever mass storage devices you have). WinPE will capture an image of a reference computer, or deploy a selected image to the PC.

Select the boot option F12

Boot menu
<

Press F12 again to start the PXE boot, and select the version of WinPE to use

SelectPE

In WDS you first add a Boot Image (which is WinPE) from the installation CD or ISO. If you boot to this version of WinPE it will automatically connect to the Deployment Server and offer you the images to install. You can also select an option to create a Capture Image. This one is also based on the WinPE Boot Image but contains a wizard to capture the image of the PC and load it up to the server. After you capture an image, it becomes available as one of the images to deploy.

Capture an image using the Capture version of WinPE

Capture wizard

Deploy an image using the Boot version of WinPE

Select OS

The aim here is just to show that WDS is a self contained tool capable of easily creating and deploying images. WDS is a role of Server 2008. It also provides the multicast functions so you can deploy images to many PC’s at the same time. Server 2008 R2 has some improvements to multicast.

As before, when using WDS you can automate the answers provided during setup by creating an unattend.xml file. The answer file is edited using WSIM, part of the WAIK. To use WSIM you first need to open and catalogue a Windows 7 image file. Then you can build an unattend.xml file with the attributes you want.

The custom answer file can be put in the image when you run Sysprep before capturing the image. Or you can open the captured image offline using the command line tool DISM, also part of the WAIK, and insert the file then. DISM also enables you to add drivers, updates, features and language packs to the image file.

The setup process with unattend.xml is an immensely powerful and flexible process. Every process taking place during the setup is controlled by sysprep.exe and unattend.xml. Because it has the ability to run executables and scripts it can do almost anything that can be done.

So now we have WAIK and WDS and we have an almost fully automated deployment process. What more could we want?

If you have a well organized PC estate with one or two current standard models of laptop and desktop then you don’t need many images, and you don’t need to create or edit them very often. In this case WAIK and WDS may well be sufficient. But there are cases where you may need more flexibility, for example:

  • You have many different makes and models and you need to re-image them. Perhaps you don’t even have a good record of what models you have.
  • You want to automate server builds and have a guided installation for different models and roles of server.

Microsoft Deployment Toolkit (MDT) 2010 provides a way to automate the workflow when imaging a computer so you can both standardize and cover more variation. MDT is another "toolkit" that sits on the technician’s workstation, but this time with a Deployment Share on a server where the resources (images, drivers, applications) are made available to the deployment process. MDT provides:

  • A wizard-style dialogue when you run WinPE, before the imaging process itself
  • The ability to skip any or all parts of the dialogue and provide a pre-defined answer or task sequence
  • A database to store configuration plans for different makes and models or computer, or for a given computer identity, or for a selected role (e.g. Web Server).

These components (dialogue, pre-defined answers etc) are used to generate an unattend.xml file dynamically, and setup then runs with this.

The scripts that operate the process

Scripts

The dialogue in WinPE

Run wizard

The settings that control the dialogue

Custom settings

The pre-defined Task Sequences that automate sections of the process

Task sequence

The database to store configuration plans

Database

MDT sits in a slightly confusing relationship to the other tools. You don’t need WDS to use MDT. You don’t need MDT to use WDS. MDT creates a deployment share, and you can use a USB Drive with WinPE to connect to it. WDS is just about the transfer process between client and server. If you do use WDS with MDT, you need to copy the MDT version of WinPE into the WDS directory, and then it uses the OS images in the MDT directory. You don’t need the WAIK with MDT, because the process of creating the unattend.xml at runtime replaces having a sophisticated editing tool for a static unattend.xml. You also don’t need the DISM because the MDT adds drivers, updates, features and applications also at runtime. But you can certainly use parts of all three components in the same imaging workflow.

Citrix EdgeSight 5.1 on Windows Server 2008

EdgeSight is the monitoring product Citrix obtained when they purchased Reflectent Software in 2006. In XenApp 5 it now replaces the old Resource Manager. The Basic features (replacing Resource Manager) are included with the XenApp Enterprise Edition license. You need additional EdgeSight licenses to run the Advanced features and the Endpoint monitoring features. You may also find you need an extra MS SQL Server license.

From the Installation Guide:

  • Basic agents provide the Resource Management capability that is included in XenApp-Enterprise Edition and require only that you have a XenApp Enterprise license available on your Citrix Licensing Server.
  • Advanced agents provide the fully featured version of EdgeSight for XenApp and require that you have either a XenApp-Platinum Edition license or an EdgeSight for XenApp license available on your Citrix Licensing Server.

When you install, you choose what features you are licensed for. You can also change this later in the configuration panel.

Licenses2

EdgeSight requires an installation of MS SQL Server Reporting Services, which in turn requires IIS. It also needs an MS SQL database engine. This presents some interesting choices. I usually aim to use a shared MS SQL Server resource, so it can be properly administered. However a non-production service can often use the free MS SQL Server Express edition.

But EdgeSight collects a lot of performance data. It is also rather unusual in creating a separate file group for each reporting period. By default it creates 8 500 MB database files. MS SQL Server Express has a 4 GB database size limit. So it is not really suitable for EdgeSight in production mode.

Filegroups1

If you have a shared Reporting Services installation you should be able to use that. If not, you need to install Reporting Services somewhere else. However an installation of Reporting Services requires a full license of MS SQL Server. MS SQL Server Express Advanced contains Reporting Services. But you can only use the Express Reporting Services against a database on the same server.

So we end up with EdgeSight 5.1 on Windows Server 2008 in practice requiring either a shared Reporting Services, or a full SQL Server license.

If you have a large Citrix server farm you may consider that an additional SQL Server license is a minor cost. But if you have a small farm and can no longer use Resource Manager, you may be surprised to find you need to pay for an additional SQL Server license to use EdgeSight. You might just get away with it by changing the default file group sizes and setting aggressive purging.

Vista Sysprep and Altiris: deploy an image

This article covers the second stage of using Altiris Deployment Solution to deploy Vista: deploying an image with the default sysprep process.

Sysprep is the tool provided with Vista to enable you to prepare a new computer for deployment. It is the only supported way of doing this. Altiris Deployment Solution uses Sysprep. However it does it behind the scenes. If you want to change the process, you need to understand a bit about what Altiris is doing, and a bit about how Sysprep works.

First we do a simple Distribute Disk Image job and check the box "Prepared using Sysprep". This is a strange title for a checkbox. If the image was prepared using Sysprep there is nothing you can do about it now. You can’t un-sysprep it. It is going to open and perform the next step specified when it was sysprepped before imaging.

If you don’t check this box, the image will be deployed and Setup will run using the unattend.xml put there when the image was created. But this xml was intended to put the imaging computer back to where it started. It has the name of the computer hard coded into the xml. When you check this box, you tell Altiris to replace the xml of the imaging computer with custom xml for the target computer.

The computer starts, copies down the image and the new unattend.xml file, boots into Windows Setup and ends with a logon screen ready to go.

If you look in %windir%system32sysprep at the unattend.xml you will see that it has the computer name and networking properties of the computer the image came from. This is the unattend used for the Generalize pass. But if you look in %windir%Panther at the unattend.xml used to set up the new computer, you can see that the computer name and the networking properties (including MAC address on the network card) have been replaced with the properties of the target computer. The custom unattend file has been written into the image by Altiris using the imaging OS (Linux or WinPE) before the Vista setup runs.

By default in a Distribute Disk Image job the box is checked to "Automatically perform configuration task after completing this imaging task". The configuration task modifies the target computer to match what is given in the Deployment console. For example, if the new computer in the console is configured to be a domain member, the Altiris configuration task will join the computer to the domain. For Vista, Altiris recommend not checking this box. Instead, configuration is run as a separate task after the image deployment is complete.