Thursday 15 July 2010

Unattended\Scripted Installation of XenApp 6

This is the end of a 5 part guide to making a simple XenApp 6 farm.  These are the other sections:

  1. Installing a server manually
  2. Creating a XenApp 6 farm
  3. Citrix Licensing
  4. Web Interface
  5. Unattended installations

 

I imagine that Citrix will tell you that you don’t need to do unattended or scripted installations, just buy Provisioning Server!  But back in the real world you’re likely to be installing XenApp 6 on hundreds of servers in even a medium sized farm and unattended scripts are the way forward.

In this I am making the assumption that you already have an established XenApp 6 farm and you are just joining servers to it, though its only the “XenAppConfigConsole.exe” step below that would need to be changed to create the farm instead, assuming you also created the SQL database manually.  This is also quite a simple farm with everything in the same Zone, but you get the idea.  I’m also making the assumption you have a Data Store database already created on a full SQL Server which you know the details for and that you have a working license server.

Citrix have changed the way that scripted installations work since XenApp 5 incidentally, so you can forget MSTs and mps.msi, its all different now!

Finally, you’ll have to decide how you are going to actually copy the files and run the commands listed here – I used Altiris, which worked fine.  I’m sure you have your own ways and means.  If you are installing the XenApp Server steps manually by logging onto the server’s desktop, don’t use Terminal Services.  I haven’t actually tried this over a TS session but it didn’t work in XenApp 5 and I doubt its changed.

  1. Install Windows Server 2008 R2 on a server.  Join it to the domain, install anti-virus (if that’s your thing), sort the networking, etc.  I’m assuming here you’ve turned off UAC which might not be a great idea but make the instructions more simple. 
  2. The command to turn off the Windows Firewall (should you be doing this – if not, you’re going to have to open ports) is:

    netsh advfirewall set allprofiles state off

    image
  3. Add the required server roles.  These are the GPMC (required to support the admin tool – this might not be needed on servers without the admin tools) and Remote Desktop Services.  Other roles required will be added automatically.  To do this execute the following commands, which will grumble about servermanagercmd being deprecated but will work fine:

    servermanagercmd -install GPMC –restart
    servermanagercmd -install AS-NET-Framework –restart
    servermanagercmd -install RDS-RD-Server –restart

    The last command will cause a reboot.
     image
  4. Install a XenApp client.  I installed our standard v12.0 client by downloading the full Online Plug-in, copying it to the C:\ drive of the new server and executing this command:

    c:\CitrixOnlinePluginFull.exe  /silent ADDLOCAL="ICA_Client,PN_Agent,SSON" SERVER_LOCATION=http://xenapp/Citrix/PNAgent/config.xml ENABLE_SSON="Yes" ENABLE_DYNAMIC_CLIENT_NAME="Yes" ENABLE_KERBEROS="No"

    The precise options will depend on your environment. 
  5. Copy the XenApp 6 DVD to your server or make it available on your network.  In this I copied the extracted ISO to c:\XA6_2008R2_ML\
  6. Execute the command to install an unconfigured XenApp 6 installation by using the XenAppSetupConsole.exe from the DVD.  This is a valid string which will install just XenApp (not web interface, licensing server, etc, etc) but exclude the administration tools, which are included with XenApp by default.  Miss the /exclude option out if you want the admin tools on this server. Set your product edition as well - my edition is Enterprise.  This example logs to the root of the C: drive too.  For a full list of switches for this part, see this http://support.citrix.com/proddocs/index.jsp?topic=/xenapp6-w2k8-install/ps-install-command-line.html

    "c:\XA6_2008R2_ML\XenApp Server Setup\bin\XenAppSetupConsole.exe" /install:XenApp /exclude:XA_Console /Enterprise /logfile:c:\ctxsetup.log

    This is silent – if you are logged on you should see things happening in Task Manager such as msiexec.exe and XenAppSetupConsole.exe itself 
     image

    EDIT 19 July 2010 - I originally posted this command wrong.  I gave the edition switch as “/edition:Enterprise” for an Enterprise farm.  Actually I misread the instructions, it should be /Enterprise for an Enterprise farm or /Advanced for an advanced farm.  Any other setting will give you the default of Platinum.  I’ve corrected the line above and the screenshot. 
  7. Once the command above completes, reboot your server to complete installation.  If you are scripting this in a batch file, use this as the next command:

    shutdown –r –t 0
  8. Copy or create a DSN file for your data store as c:\sql.dsn.  This doesn’t need the password of the SQL user you’re connecting with but will need everything else.  If you don’t know what you’re doing with this, its a text file which you can create manually – this is an example, obviously replace the values for DATABASE, UID and SERVER with your real values:

    image 
  9. You now have an unconfigured XenApp 6 installation and must configure it with the XenAppConfigConsole.exe tool from the DVD.  Again, tailor the command to your own environment, especially the farm name, SQL Server username and password and the name of your License server.  It should take a couple of seconds and end with Exit Code: Successful.  Note the “/ExecutionMode:Join” part – this could be changed to create the farm.

    "c:\XA6_2008R2_ML\XenApp Server Configuration Tool\XenAppConfigConsole.exe" /ExecutionMode:Join /FarmName:"XenApp 6 Farm" /LicenseServerName:licenseServerName.domain.local /LicenseServerPort:27000 /ZoneName:"Default Zone" /AddUsersGroupToRemoteDesktopUserGroup:True /AuthenticationType:sql /DsnFile:c:\sql.dsn /OdbcUsername:sqlusername /odbcPassword:sqlpassword /log:c:\joinfarm%1.log 

      image
  10. Reboot to complete the operation – it will not appear in your list of servers in the XenApp DSC admin tools until you do this.
  11. If you are using the User Profile Manager you will need to install this too.  Download the latest MSI and copy to the C: drive:

    msiexec /i c:\profilemgt3.1.1_x64.msi /qn
  12. One last possible change – if you are streaming applications that use Services (Office 2010 being the obvious example) and you don’t sign your profiles, you will need to run this to add a registry key to allow the service to start.  Replace “fileserver” with the name of the file server that stores your profiles.  This can be multiple entries separated by semicolons.

    REG ADD "HKLM\SOFTWARE\Citrix\Rade" /v AppHubWhiteList /t REG_SZ /d fileserver

 

You should now see the new server in the DSC and be able to publish applications to it.  Obviously these instructions have not been a fully unattended installation as such but providing you have a system such as Altiris to copy files and execute commands remotely they should be enough for you to build such a process.

7 comments:

Anonymous said...

well done

Anonymous said...

Thx
Very helpfull

Anonymous said...

I have a problem with these steps - I am being prompted by windows Security about "windows can't verify the publisher of this driver software" - and as best as I can tell this is from the install of the CtxSbx.sys driver. Google is not being to helpful for me on this one. Any suggestions?

Anonymous said...

YOU SHOULD TURN OFF DRIVER SIGN CHECK. Xenapp Installs some Printer drivers (UPD!)
regards

Anonymous said...

Many thanks, great documentation!

Anonymous said...

I cannot disable firewall because this is set via Company GPO. Can you tell with ports to open.

sk said...

Hi,

I am using Oracle DB, could you please let me know what should I put in authentication and in dsn files?

regards
Sreekanth

Post a Comment