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.
- Creating the package
- Download and extract my zip file to C:\XCInstaller for example
- 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 - Download UnxUtils from http://sourceforge.net/projects/unxutils/ and extract usr\local\wbin\gzip.exe to C:\XCInstaller\bin
- Download Syslinux from http://www.kernel.org/pub/linux/utils/boot/syslinux/ and extract win32\syslinux.exe to C:\XCInstaller\bin
- 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
- 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
- Create a new custom task-sequence called Install XenClient
- Add the following steps to the task-sequence
Fake a NEWCOMPUTER DEPLOYMENT TYPE, otherwise the diskpartitioning will fail.

Partition the disk to a 100mb fat partition

Start the InstallXenClient.cmd

Reboot the computer in the XenClient installation

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)
Have fun with this!
-Henk Hofs
June 22nd, 2010 - 14:10
Great post!
I’ll try it out and will be reporting about
greetings µatthias
June 23rd, 2010 - 18:06
Thanks for sharing, this was a create post and will be helpfull for many pepole in the further.
Eric
xenappblog.com
July 8th, 2010 - 12:29
Great article. any idea on how to deploy linux images (fedora) from sccm. we are facing issues to have multiple PXE server for linux and windows images.
any idea will be grate help.
August 5th, 2010 - 08:44
Hi kldsts,
sorry to keep you waiting this long, but I have been on holidays for a few weeks
At this point I do not know how to deploy fedora from SCCM, but if you can install Fedora from PXELINUX, you can do it from SCCM as well.
Just take a look in my InstallXenClient.cmd file to see what I do there, there’s comments there.
Basically what I do is transfer the PXELINUX.cfg file to SYSLINUX.cfg which I then prestage on the HD using syslinux.exe.
For XenServer I do some extra things, such as opening the rootfs.gz and injecting the anserfiles on the fly before prestaging it to the HD.
Good luck!
If you need any more help, just let me know and we’ll figure something out
September 2nd, 2010 - 14:06
great!
does it work with XenClient_v1_0_RC2_Installer.iso too?
i get “missing operating system”
September 2nd, 2010 - 14:09
You beat me too it peter
I haven’t had time to verify if it still works for RC2.0 or not…
I don’t expect much has changed for the installation of RC2, but I will have to test it for myself (I need to update my XenClient installation to RC2 anyway
)
I’ll get back on this!
EDIT: I tried this method and it’s still valid for RC2. Did you set the partition to active (the 100 mb fat partition) so it is bootable in your diskpart / mdt /sccm diskpartitioning?
September 15th, 2010 - 15:49
i checked it now,
it worked with rc1, and the only thing i did, was to copy the packages.main from the rc2 disk to wwwroot/xenclient. I boot PXE, and install the xenclient. After reboot the installer starts as usual, installs a short time, reboots and then i get “missing os”. Switching back to the rc1 packages.main works fine.
maybe there is a difference between dom0-rootfs.i686.ext3.gz / iovm-rootfs.i686.ext3.gz (rc1) and dom0-rootfs.i686.cpio.bz2 / iovm-rootfs.i686.cpio.bz2 (rc2)
i dont have a firm relationship to linux to investigate further…
maybe there is a way to “convert” the files…
greetings…
Peter
September 15th, 2010 - 16:00
Well, you will need to change the boot files in the xc installer boot directory from the RC1 to the RC2 files… just changing the packages.main is not enough..
Which version of CPIO and Syslinux did you put in the xc installer\bin directory?
September 16th, 2010 - 08:39
Now i copied the files from the isolinux directory of the rc2 cd to deploymentshare\applications\xenclient installer\boot.
the result now is a reboot loop.
i get
boot:
it starts, until
loading rootfs.gz……………….
and after 3 seconds i get a blue screen with “Rebooting” message
before that there is a message for a millisecond i cant read… (Xen Client….. ?)
i used 2.4.2 as advised and syslinus 3.86
October 19th, 2010 - 07:53
good
July 12th, 2011 - 15:24
Have you tried the preinstall and postinstall commands provided within the Citrix documentation? I have tried both with no success. Tried the install via SCCM and via a FTP/Webserver. XenClient installs fine but the postinstall never completes. Just curious if you ever got it working.
Thanks,