IThastobecool.com Geeks have opinions too!

21Jun/1011

Installing Citrix XenClient from MDT / SCCM / WinPE

Ok… I have been playing with Citrix XenClient for a while now, and I like it a lot!
Yes it has it’s quirks, bugs and issues, but what can we expect from a RC! So far I think Citrix has done an amazing job… to you XenClient developers, we salute you!

Ok, let’s get to the point.
This XenClient is awesome, but how are customers going to DEPLOY it to their systems? Using the CD was no option ofcourse!

So against all my geek instincts, I decided to read the XenClient manual. And b00m! They support installation using a PXELINUX server! Whooho!
But how many big enterprises, that are Windows houses have a PXELINUX server installed? Outside of universities I rarely see client deployment systems for Linux. Most of my customers use either MDT or SCCM to deploy their client machines. So I combined the steps in the XenClient manual, with my (very very very limited) knowledge of Linux systems. And came up with the following solution.

I created a script that will run from WindowsPE, install the necessary boot files onto a 100 mb fat partition. Inject your custom answerfile(s) and reboot the computer into the XenClient installation using the answerfile you have passed as an argument :)

VERY IMPORTANT. This script assumes that there is a 100mb (or more) FAT volume mounted to driveletter C: during the WindowsPE phase. Use the partitioning of MDT/SCCM to do this. Or create your own custom diskpart script, if you want to run it from Windows PE.

I use some free GNUWin / UnixTools for this script, which are not included in the download. But I provide the link where you can download them :)

So here are the instructions:

  • Copy the packages.main folder from the XenClient cd to a location on a http or ftp server.
    The parent location of the packages.main folder is inserted in the answerfile.
    In my case I have a webserver at http://10.0.0.12 in which I created a subfolder xenclient. In my answerfile I refer to http://10.0.0.12/xenclient as the source URL for the packages.

image

  • Creating the package
  1. Download and extract my zip file to C:\XCInstaller for example
  2. Download cpio for windows from http://sourceforge.net/projects/gnuwin32/files/cpio/ and extract cpio.exe to C:\XCInstaller\bin
    IMPORTANT, download version 2.4.2 (bin), because the commands I use in my script seem to be broken in higher versions
  3. Download UnxUtils from http://sourceforge.net/projects/unxutils/ and extract usr\local\wbin\gzip.exe to C:\XCInstaller\bin
  4. Download Syslinux from http://www.kernel.org/pub/linux/utils/boot/syslinux/ and extract win32\syslinux.exe to C:\XCInstaller\bin
  5. Insert your XenClient cd and copy all files from the boot directory of the XenClient cd to C:\XCInstaller\boot
  • Creating one or more answerfiles and place them in C:\XCInstaller\answerfiles

Here is an example of my answerfile

<interactive>false</interactive>
<mode>fresh</mode>
<source type="url">http://10.0.0.12/xenclient</source>
<primary-disk>sda</primary-disk>
<network-interface mode="dhcp"></network-interface>
<password>somepassword</password>
<enable-ssh>true</enable-ssh>
<license-key></license-key>

For a full reference of the answerfile, please consult the XenClient User Manual.

  • Running the package

This script can be run from within WindowsPE, so this means that you can either use a vanilla WinPE boot image, or use MDT or SCCM to start this script. I will give an example for all three scenarios :)

NOTE: The .cmd file takes an answerfile name as a a parameter.
For example you have 2 answerfiles: fullunattend.txt and quickoptions.txt
If you want to install this machine using fullunattend.txt you can use InstallXenClient.cmd fullunattend.txt
If you do not specify a answerfile, the script will default back to the LAST answerfile found in the answerfiles directory. so if you have an answerfile called a.txt and an answerfile called z.txt and you did not specify the answerfile name, the script will default to z.txt

Vanilla Windows PE

  • Share the C:\XCInstaller folder so you can access it via the network (in my case I host it on my windows server: 10.0.0.140)
  • Start your target machine in Windows PE
  • Partition and format the disk using diskpart:
    select disk 0
    clean
    create partition primary size=100
    select partition 1
    format fs=fat quick
    assign letter=c
    exit

image

  • Connect to the XCInstaller share
    (in my case: net use \\10.0.0.140\XCInstaller)
  • Start the script
    \\10.0.0.140\XCInstaller\InstallXenClient.cmd
    NOTE: The .cmd file takes an answerfile name as a a parameter.
    For example you have 2 answerfiles: fullunattend.txt and quickoptions.txt
    If you want to install this machine using fullunattend.txt you can use InstallXenClient.cmd fullunattend.txt
    If you do not specify a answerfile, the script will default back to the LAST answerfile found in the answerfiles directory.
  • Reboot the machine and VOILA! Your xenserver installation is installing using your answerfile!

Microsoft Deployment Toolkit

  • Import the XCInstaller directory as an application in MDT

image

  • Create a new custom task-sequence called Install XenClient

image

  • Add the following steps to the task-sequence
    Fake a NEWCOMPUTER DEPLOYMENT TYPE, otherwise the diskpartitioning will fail.
    image
    Partition the disk to a 100mb fat partition
    image
    Start the InstallXenClient.cmd
    image
    Reboot the computer in the XenClient installation
    image

NOTE: It is very important that you do not use the Install Application step, but the custom command line step for the installation. The install application step will not run from within the WinPE phase of MDT. Point this command line to z:\Applications\YOURIMPORTDIRNAME\InstallXenClient.cmd (which is mounted by default by MDT to the distribution share)

SCCM
For SCCM the steps are almost identical as to MDT. Instead of importing an application > create a new package. For the SCCM task-sequence you only need 3 steps:

  • Format and Partition disk (make a 100mb fat partition)
  • Run Command Line (point it to run from package) InstallXenClient.cmd
  • Reboot Computer (in the target partition)

Et voila! Watch your target machine installing XenClient! Here are some“old-fashioned” screenshots, to prove I have it running. Seeing as XenClient requires VTx I couldn’t test it inside a VM and had to use a physical machine… (just an explanation for the photo’s)

IMG_0128

IMG_0129

IMG_0130

IMG_0133

IMG_0134

IMG_0135

IMG_0136

Download zip file

Have fun with this!
-Henk Hofs

7Oct/090

Add optional updates to MDT

Since Henk is the MDT guy on this blog he got me interested enough to give it a try. For testing purposes i use and break a lot of virtual machines so using MDT + WDS to recreate them wasn’t such a bad idea. Out of the box you can give your task sequence the option to run windows update post-setup: But then it will run every time :( .  As you all know you can add your own applications as optional packages so you can select them pre-installation. This got me thinking: Let’s add windows update as optional package and use the framework that’s already available for this.

Howto:

  • Add a new application
  • Standard application
    • Quiet installation command
      • cscript.exe "%SCRIPTROOT%\ZTIWindowsUpdate.wsf"

That’s it :)

 MDT UPDATE

Filed under: mdt, Tweak No Comments
30Sep/090

MDT 2010: Fix for ‘Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed”

There is now a fix for the problem that MDT 2010 has when connecting to the deployment share with different credentials in sysprep, refresh, replace and custom task-sequences.

Read more about it here

Tagged as: , , , No Comments