Configuring Altiris Deployment Solution to perform automated Citrix XenServer Host Builds

In our environment we use Altiris Deployment Solution (DS) to perform a completely automated server build. My deployment jobs configure the hardware, install the operating system, Citrix XenApp, and supporting applications. At the end is a server, ready to take applications. We are now in the process of virtualizing our XenApp servers on XenServer and I want to automate that process, as well. This guide will provide the instructions for performing an automated Citrix XenServer build, and end up with a XenServer installation with the Altiris agent installed and configured.

The XenServer installation guide shipped with the software, specifies how to perform an automated PXE installation of XenServer. For the record, that documentation has many, many mistakes, so if you follow it exactly you won’t get a working setup. Citrix seems to have just copied it from early Xen versions without updating it.  The documentation assumes the use of a Linux server that will serve as a DHCP/PXE/HTTP server for the installation. We already have Altiris Deployment Solution, and I didn’t want to have to reinvent the wheel, and have two disparate solutions; so I started working on getting the automated build working with Altiris. My solution will assume Altiris Deployment Solution 6.9 SP1 and XenServer 5.5.0, but you should be able to easily adjust for your environment.


Install Files


The first step in the installation routine is to provide a location for the install files. The XenServer automated build process actually support http, ftp, and nfs for storage locations. I am using http because I already have it running for the Deployment Web Console.

  1. If you don’t already have IIS installed for the Deployment Web Console go ahead and install it now.
  2. Navigate to the “Default Web Site” home directory.
    1. Create a directory called XenServer.
    2. Within XenServer create a directory called 5.5.0.
  3. Copy the packages.main directory from the XenServer install CD to 5.5.0.
  4. Copy the packages.linux directory from the XenServer Linux CD to 5.5.0. (You can leave this step out if you never plan on running Linux guests.)
  5. In IIS Manager, bring up the properties for the XenServer directory.
    1. Under “HTTP Headers”, select “MIME Types…” and enter the information below.

      This step is needed  for IIS to treat all .* files as binary files and allow them to be downloaded during the installation.

  6. Configure  and copy adlagent.conf from the AgentsAdlAgent directory of your DS eXpress share to the XenServer directory.
  7. Copy Altiris-adlagent-2.6-65.x86_64.bin from the AgentsAdlAgent directory of your DS eXpress share to the XenServer directory.


Answer File


The next step is to create the answer file that the XenServer installation process will use for the install. In my installation, I keep this answer file as simple as possible and use Altiris to perform the customizations. The next step is to create the answer file that will provide the configuration details for the base installation.

  1. In the XenServer5.5.0 directory created earlier, create your answer file, “answerfile.xml”. Refer to Appendix B in the XenServer 5.5 Installation Guide pg. 32 for the syntax.

Included below is a working example you can use. Replace *SERVER* with the name or IP Address of your DS server. Also, since this file can be read by anyone, I highly recommend changing the root password at the very earliest occasion.


<?xml version="1.0"?>
    <primary-disk gueststorage="no">sda</primary-disk>
    <source type="url">http://*SERVER*/XenServer/5.5.0</source>
    <post-install-script type="url">http://*SERVER*/XenServer/
    <admin-interface name="eth0" proto="dhcp"></admin-interface>


Installation Scripts


Now we will work on the installation scripts. This process involves two. The first script sets up the second script to be executed when the server reboots into the XenServer OS. The main reason for this is that during the installation process the target filesystem is actually mounted to /tmp/root. So any installations, such as the Altiris client, would actually install to the temporary filesystem setup by the installation environment. We remedy this by having the setup work done when the server reboots into the XenServer OS.



  1. In the XenServer folder create and insert the code below substituting *SERVER* for your DS name or IP Address.


  1. #!/bin/bash
  2. #
  3. #   XenServer Automated Build Post Install Setup Script
  4. #
  5. # Download setup script and set up to be executed on reboot.
  6. cd /tmp
  7. wget http://*SERVER*/XenServer/
  8. chmod +x /tmp/
  9. mv /tmp/ /tmp/root/etc/rc3.d/
  10. chmod +x

As mentioned above, the root filesystem of the host is actually mounted to /tmp/root so by placing the in /tmp/root/etc/rc3.d we can have the script run on the first host boot.



  1. In the XenServer folder create and insert the code below substituting *SERVER* with your DS name or IP Address.


  1. #!/bin/bash
  2. #
  3. #   XenServer Automated Build Post Install Setup Script
  4. #
  5. cd /tmp
  6. wget http://<SERVER>/XenServer/adlagent.conf
  7. wget http://<SERVER>/XenServer/altiris-adlagent-2.6-65.i386.bin
  8. chmod +x altiris-adlagent-2.6-65.i386.bin
  9. ./altiris-adlagent-2.6-65.i386.bin install-as=redhat
  10. cp /tmp/adlagent.conf /opt/altiris/deployment/adlagent/conf/
  11. /etc/init.d/adlagent start
  12. rm etc/rc3.d/

This script downloads the agent files, installs the agent, copies the configuration file to the appropriate location and then deletes itself.


PXE Setup


Now we will set up the PXE files to start the installation process.

  1. Create a directory and copy the following files from the XenServer Installation CD: install.img, Bootxen.gz, and Bootvmlinuz.
  2. Download Syslinux from and extract mboot.c32 and pxelinux.0 to the directory above.
  3. Open the PXE Configuration Utility and create a new boot option.
    1. Select Linux, x86, and user supplied.
    2. Click “Manual Boot Image…” and select the directory created above.

    Make a note of the “Final Location”. You will have to edit some files manually.

  4. Navigate to the PXEMasterImagesMenuOptionXXX directory using the number designation from the “Final Location”.
  5. In the X86PC directory create a directory called pxelinux.cfg. In this directory create a file called default and insert the content below substituting *SERVER* with your DS server name or IP Address.


default xenserver-auto label xenserver-auto
kernel mboot.c32
append xen.gz dom0_mem=752M com1=115200,8n1 console=com1,tty --- vmlinuz console=ttyS0,115200n8 console=tty0 answerfile=http:///XenServer/5.5.0/answerfile.xml install --- install.img &amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;<br />
&amp;lt;p align="justify"&amp;gt;&amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The append line, which is the last line, is one single, non-breaking, line. If you break up the line it will break the setup.&amp;lt;/p&amp;gt;&lt;br /&gt;<br />
&amp;lt;p align="left"&amp;gt;6.&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Replicate the PXEMasterImagesMenuOptionXXX directory to PXEImagesMenuOptionXXX directory using the number designation. &amp;lt;/p&amp;gt;&lt;br /&gt;<br />
&amp;lt;h3&amp;gt;&amp;amp;nbsp;&amp;lt;/h3&amp;gt;&lt;br /&gt;<br />
&amp;lt;h3&amp;gt;Conclusion&amp;lt;/h3&amp;gt;&lt;br /&gt;<br />
&amp;lt;p align="justify"&amp;gt;&amp;amp;nbsp;&amp;lt;/p&amp;gt;&lt;br /&gt;<br />
&amp;lt;p align="justify"&amp;gt;Now with all of this setup you now have a working automated XenServer build. On your target server, boot the server. At the PXE menu, hit F8 and select “XenServer Automated Build”. The server will have XenServer installed and automatically added to your DS console.&amp;lt;/p&amp;gt;&lt;br /&gt;<br />
&amp;lt;p align="justify"&amp;gt;The selecting of the PXE boot boot menu has to be manual. You could have it boot into the menu by assigning the job, but since there is no agent in the installation environment it would just continuously boot into the PXE installation.&amp;lt;/p&amp;gt;&lt;br /&gt;<br />
&amp;lt;p align="justify"&amp;gt;Since the hostname was not specified, it will default to localhost.localdomain. This also means that it will show up as localhost in the Altiris console.&amp;amp;nbsp; For one system this is not really an issue. However, when&amp;amp;nbsp; trying to set up a number of systems this can cause confusion. In a subsequent post,I will demonstrate a method for using an external reference, to provide to Altiris the information needed to correctly configure the systems. &amp;lt;/p&amp;gt;&lt;br /&gt;<br />

One Comment

  1. wilder

    Mark, Did you ever get altiris to differentiate xenserver builds?
    I’m currently using a similar deployment method which sets th servers to DHCP but with the same name, then using a .sh script to rename the xenserver and configure a static IP once the xenserver communicates with the deployment server.

Comments are closed.