How to clone a XenApp 6.5 server with VMware

I have been working with XenApp a lot just lately and I find myself knee-deep in the Citrix e-docs a lot. However I think that they don’t cover some topics particularly well, especially when they don’t seem to want to acknowledge that other vendors exist.

So, here are my simple steps using VMware and Citrix. You don’t need to bother with provisioning server etc. I am aware that there are many ways of doing this but I consider myself to be a Citrix novice so keeping it simple is the way to go!!

Please note this was done on a 2008 R2 server running XA 6.5 FP1.

  • Ensure that you have configured a guest customisation script in your virtual centre. If you don’t you could use Sysprep, I would suggest using generalize and oobe.
  • Jump onto a XenApp server, so long as it’s not the first server in the farm, as you should not image that. Ensure that you have all of your apps installed and configured and ensure that no users are logged in.
  • Open the Citrix role manager. Select the XenApp role and click configure. If you cannot find it either someone has uninstalled it or go and find it under C:\Program Files (x86)\Citrix\XenApp\XenAppServerRoleManager\
Citrix Role Wizard
Citrix Role Wizard
  • Select to prepare the server for imaging
Citrix Role Wizard
Citrix Role Wizard
  •  Now I wanted my server that I was imaging to remain in the farm, so I unchecked the top tick box. This means that my server will just rejoin the farm after the next reboot. This also means that I don’t want the database locations to be wiped. So I left the bottom check box clear. This also means that I didn’t have to create any policies to set the server information.
Citrix Role Wizard
Citrix Role Wizard
  • Finish the wizard and go to services. You will need to stop and disable the Citrix IMA service

XenApp Server Clone 6

  • Now, if you’re not using a VMware customisation script, now would be the time to use Sysprep. You will find Sysprep in C:\windows\system32\sysprep
  • Now shut the server down and use VMware to clone the server, your customisation script should rename the server and sysprep the machine. I am not going to detail these steps, but if you get stuck drop me a comment and I will give you a hand 🙂
  • You could now power up the machine that you imaged and set the IMA service to automatic and start it up.
  • Then you can power up your clone and do the same with the services, but only after you have checked over Windows.

That should be job done, clearly you could do multiple clones and you could do a clone to template but there may be some other caveats there, so I would do a little R&D before you do that.

Hope this helps someone out.

32 thoughts on “How to clone a XenApp 6.5 server with VMware

  1. Maelito June 5, 2013 / 10:27 pm

    I am also looking to clone my xa6.5 fp1 citrix server.

    My plan is to deploy w2k8 > install xa6.5 fp1 > install all user apps > run the xa server configuration > remove server from farm > shutdown the vm > convert the vm to template > deploy new servers from this template.

    Would this work ok?
    What about the AD side? When will the clone join the domain?



    • infrastructureguy June 6, 2013 / 7:28 am


      You must make sure that you dont clone the first server in the farm. So I would advise building two XenApp servers and cloning the second one in the farm. You also have to run the role manager to prepare the XenApp server for removal, treat that like a sysprep for XenApp. I must admit I didnt go down the template root as I was only deploying a small farm of 6 servers, unless you are planning on deploying loads I would debate the merit of having a template.

      So if I may I would amend your plan to look like this.

      Build 1 w2k8 server and get XenApp on it to create the farm
      Build a second XenApp Server and join that to the farm
      Then run the role manager on the second server and shut it down
      Then clone or try your template
      You need to make sure that your template or clone has a VMware Guest customisation applied to it, this will handle adding the cloned servers to the domain.

      On a side note make sure that your XenApp servers go into an OU that block group policy inheritance as you only want your XenApp policies to apply to them.

      Best of luck

  2. Maelito June 19, 2013 / 3:51 pm

    I am cloning the server OK, it gets added to the farm no problem.

    The only thing is that the server is not being added to the domain.

    when the server does the first boot I can do a domain logon but then it powers off automatically and I think it’s running another sysyprep. So the server is removed from domain…. Not sure why? Could it have something to do with the sysyprep check box on the customisation form in VMware?

    • infrastructureguy June 19, 2013 / 8:22 pm


      I not able to get onto my work pc to check my notes but I have a feeling that I know what your issue is. If you are using a VMware customisation script, which it sounds like you are then I will say that you have a similar issue that I found on a few nodes but not all.

      I found that there was a registry key in HKLM relating to VMware that was forcing the guest customisation over and over.

      Apologies that I don’t have the exact key to hand but it was something like “HKLM\SOFTWARE\VMWare\Guest Cutomization\”

      there was a value that was set to a 1 that when changed to 0 fixed my issue.

      If you can’t find it from my slightly vague answer let me know and I will check out the exact key tomorrow and reply to this post.

      Hope that is some help.

    • infrastructureguy June 25, 2013 / 1:46 pm

      Hey your totally welcome, glad I could help. I think that having a blog can be very rewarding especially when you can help someone else out. I started mine to record my findings but now its my chance to attempt to give back as I use a number of peoples blogs to help me from time to time.

      It does require some effort but I think it is worth it on so many levels, if you want any help getting started let me know.

      Enjoy XenApp and take a look at Pre Launch, if it fits your use case it can really help you out with launch times!

      • E52 January 22, 2014 / 9:55 pm

        I’m having the same issue as the previous user. Everything seems to come up correctly in the new VM EXCEPT the domain and it is unable to join the farm if it is not in the domain. Even after looking at that KB article, and applying the domain credentials as such, it is still failing to join the domain. Any suggestions?

      • infrastructureguy January 22, 2014 / 11:20 pm

        Hi Eric.

        Have any of your cloned XA servers joined the domain and have you successfully joined other cloned VMs to the domain?

        If I assume that you have Then I have a couple of thoughts/questions for you to think about. Hope it’s not teaching you to suck eggs, that’s not my intention!

        Have you tried to create a new customisation in VMware? You could just do the wizard manually. I have done that when i have not seen the black DOS customisation screens come up on the VM, during boot.

        Are you seeing any attempt to join the domain, perhaps in the event logs on the VM or your DC? Can that cloned VM ping your DC returning the full FQDN as well as ping your AD domain?

        What happens if you manually join the VM to the domain, does that work?

        I am pretty sure that the VMware customisation has a log file, if it does and you can find it you may see a clue?

        Let me know how you get on.


  3. JP July 16, 2013 / 6:18 pm

    I have a xenapp 6.5 server up and running (not the data collector) can I just use VMWARE to create a Template of the xenapp server and deploy the template for the additional Xenapp servers?

    • infrastructureguy July 16, 2013 / 9:46 pm

      Hi JP, I thought about doing that and I don’t see why it wouldn’t work. I would just do some good testing to be sure. I didn’t bother doing it this way as I have a pretty small farm (7 XA servers) and if I need to scale out this process is pretty quick.

  4. Don M July 24, 2013 / 2:09 pm

    So, I just did a test clone yesterday. We did not do a customization script on the clone, so when I started it up, it had no IP, was not on the domain, did not have the hostname I specified int he VM name. I realize all of these are things I can specify in the clone process. What I found with the existing and cloned servers was the MF20.DSN was not set in the registry, so it was not starting up IMA once I enabled it. The seed server also lost its hostname, so I rolled back to the snapshot I took prior to the cloning process. These are minor issues that I can handle on future clones now that I know how to do it. We use AppSense and EdgeSight and the cloned server got added into both of these, as well as the XenApp 6.5 farm, with no problems. This cloning will save me days of installing software on freshly built servers. Thank you so much for these simple steps!!

  5. isujosh August 5, 2013 / 1:32 pm

    I had a quick question regarding re-cloning XenApp 6.5 servers. We successfully deployed 7 new servers using your basic method (customisation script, clone 2nd server in farm etc.) and it worked fine. However, we would like to periodically ‘refresh’ the servers in the farm with a new clone using the same host/XenApp name – can we just re-clone in vmware to the same hostname or do we have to remove the servers from the XenApp farm / delete VM from disk first etc?

    Thanks for your advice in advance.

    • infrastructureguy August 5, 2013 / 3:29 pm

      I think you will run into issues as vCentre won’t like you having two VMs’ with the same name, whilst you can rename them in the inventory you have to do a storage vMotion to rename the underlying folders and disks. Also worth noting that in 5.1 this “feature” was removed and only re-added with update one. Earlier versions are fine. So you will need to rename as a minimum.

      From a Citrix perspective I cannot say for certain. But if I were you I would remove the server from the farm first. Never any harm in being cautious 🙂

      I am interested in your reasons for wanting to do this as my XenApp servers have been extremely stable and are running week in week out with even requiring a reboot.

  6. isujosh August 5, 2013 / 3:57 pm

    Thanks for the info – very helpful. I think we will remove the servers from the farm and delete the old VM’s from both the inventory and disk as this seems sensible.

    The XenApp servers are very stable as you say, but we are looking to add a number of new applications, update MS Office to the latest version, apply service packs and hot fixes and cloning allows us to do this without having to apply these changes individually to each existing server in turn – a very laborious and time consuming task – more so than just updating one, testing and then cloning again knowing that each box is an identical build. Once the first server is prepared for cloning (not the collector obviously) it is relatively simple to clone the remainder, one after another.

    Hope that makes sense – unless there is a better way that is!

    • infrastructureguy August 6, 2013 / 9:41 pm

      That makes a lot of sense, don’t forget to take advantage of vSphere snapshots when your updating your first server, just don’t forget to commit them when your done 🙂

      As for another way I am not sure if you have Microsoft SCCM? But if you do then you can use the SCCM connector for Citrix and deploy your applications to your XenApp servers. This would save some time. It’s really cool as it actually creates the published app for you.

      Or.. If you have VMware ThinApp you can store these centrally and point your published app to the ThinApp again meaning you only manage the packages.

      I am lucky enough to have both and can say that they both work well.

      I have also used Softgrid now called App-v from Microsoft to stream applications to Presentation servers, it worked well at the time but I have not done it with XenApp.

      Any of these three would help you manage your servers and reduce the need to re-clone all the time as apps are patched and managed centrally and then delivered to the XA servers.

      This final thought is not something I know a lot about but I am wondering if Citrix provisioning services could help with this? Could be worth a Google if you have five minutes.

      Hope this helps.

  7. JP August 16, 2013 / 8:39 pm


    I seem to be stuck on the VMware portion, I created a template from the Xenapp server (prepped it using Citrix GUI) while it was off, deployed the template using a Custom Script to change the name….but the name won’t change from the old server and the Custom Script keeps trying to run everytime I reboot? Any ideas what is wrong, thanks again.


    • infrastructureguy August 17, 2013 / 9:27 pm

      Hi JP,

      I think I know what is going on and the answer lies in the registry of the cloned server. If you look back to a comment I made above in June it should point you in the right direction.

      If not let me know and I will as best I can.



  8. Arash Fattahi August 29, 2013 / 12:11 am


    Thanks heaps for your great how-to!

    I have done all of your procedures and everything is going very well and smooth.

    But there is an issue that after cloning was completed, i renamed the cloned servers and added them to the domain, but in my XenApp AppCenter, under Servers container I see 2 servers with the old computer name (start with WIN-). However, the renamed ones are OK and are shown in the Servers contaner.

    Have you seen this before? If yes, how can i rectify this and remove these 2 servers?

    Thanks in advance.

    Arash Fattahi

    • infrastructureguy August 29, 2013 / 12:04 pm


      In the Xenapp clone server wizard are you selecting to keep the current server in the farm as that would mean that the old servers still exist?



  9. JLF September 26, 2013 / 5:23 pm

    When running sysprep against a machine to prepare it for cloning, will that server come back online and be part of the domain and farm again?

    • infrastructureguy September 26, 2013 / 7:57 pm

      You should not need to run Sysprep on the machine before cloning, providing that you are using VMware or another product to customise the cloned vm.

      In my case I just use a VMware customisation script on my cloned VM.

      Hope that helps?

      • JLF September 27, 2013 / 11:51 am

        I think so. What I was trying to determine is when I create a clone template from an existing server would that server then need to go offline and stay offline from the farm and the Windows domain or could I keep using it in the farm without any sort of SID conflicts between itself and it’s cloned copies.

        We are using VMware ESX 4.1 and I normally build out our application servers by hand and that’s a time consuming process given the number of printers to install and apps to install.

        When you say ‘customization script’ do you mean the script process in vSpere using the “Customization Wizard” for deploying VMs from a clone template?

      • infrastructureguy September 27, 2013 / 12:29 pm

        Sorry, yes I meant the Customisation Wizard.

        No, you dont have to keep it offline, so long as you select the options in the XenApp wizard as shown and you use the VMware Customization wizard on the clones to Generate a new VM and Windows name, and run SYSPREP, you wont have any conflicts.

        Remember dont clone the first XenApp server in your farm and make sure that you have put the Sysprep files for your OS in the Virtual Centre folder location, that way you will be able to select to Sysprep the server in the VMware Customization wizard.

        Depending what OS your VC is running on the path will change but you can google for that one easy enough 🙂

        Does that make sense?

  10. JLF September 27, 2013 / 5:55 pm

    Yes it does. I intend to test this for future deployments. Thanks 😀

  11. isujosh October 21, 2013 / 9:04 am

    Having a few issues with re-cloning Xenapp 6.5 farm servers. We had one server which crashed out and lost it’s trust relationship with the domain. Re-added it and all seemed fine but now we are starting to see issues with printer driver signing and application crashes.

    Decided that best option would be to remove server from farm (from Appcentre) and then redeploy from customisation template based on one of the other farm servers. Citrix recommend uninstalling Citrix from the farm server (a long and laborious process) as part of removing the server from the farm.

    Can I just remove farm server from appcentre and then simply re-clone as per orginal process to put it back in farm? or will this give me problems? Slightly worried that it will give issues. Re-cloned server will have same name, IP as old one.

    Any pointers would be useful as this was to be our main way of ‘refreshing’ our farm.

  12. Robert C March 13, 2014 / 3:37 am

    Thanks for the great info. You keep mentioning not to clone the first server in the farm. I currently only have one App server. Are you saying that I will need to create a second ‘manually’ before I am able to use your instructions? I have two data collectors, two storefronts, a server that shares the licensing and SQL duties, and two Netscalers for load balancing. My plan was to get the App server golden then clone it off a couple times, three total. VMWare 4.1 / XenApp 6.5

    • infrastructureguy March 13, 2014 / 7:08 am

      Hi Rob, glad you found the post helpful. You are correct in that I would build a second server and clone from that one. The reason I say this is because the first server in your farm has several unique roles. You may wish to double check this but if you have split out your roles out and your app server is just doing app delivery then you could just clone the app server.

      I hope this helps? I know that I found some Citrix docs on the roles and how to identify them in XA65.

      Good luck

  13. fun June 9, 2014 / 10:27 am

    Ahaa, its nice conversation regarding this article at this place at this webpage,
    I have read all that, so now me also commenting here.

  14. Slamdog (@JPSlamdog) April 20, 2015 / 12:35 pm

    Hi, this is a really good guide. I’m new to all this cloning Citrix, so one of your steps has me totally puzzled, and I could just be really dim but:

    “Now shut the server down and use VMware to clone the server, ”

    In the past we have used VMware P2V to clone a physical I’m wondering how you can clone a shutdown machine into VMWare. Are you talking about an existing VM XA server?

    • infrastructureguy April 20, 2015 / 7:40 pm

      Hi Slamdog.

      The key thing is that the Build you have just done, is windows, xenapp etc is a virtual machine. So once you have done all your installs and prep just shut the VM down and use VMware to clone it.

      If you have done this on a physical machine then you either need to use a different tool like ghost or P2V the server so that you can clone it in VMWare.

      Hope this helps??

  15. Moshe December 18, 2015 / 1:57 am

    Cheers for such a great article,
    I have a XenApp 6.5 farm in production state, I need to clone one out of 6 session-host servers, apply HRP R06 to that clone and then test the Apps on it. Currently, all the servers have R06 on them. Since I don’t have a template, if I take the server out of production state, prepare for imaging via Citrix and sysprep it, that means I cannot re-use this server in the farm as sysprep will change windows settings, name, etc. How can I clone the server without losing it?

    • infrastructureguy December 18, 2015 / 12:04 pm

      Hi, you dont say if you have your server running as a VM or anything? But in general if you clone a server and sysprep it the original will stay in place. Its your choice if you wish to convert it or the orginal to be a template. Clone by its very nature does just that, it does not replace the original box.

      Sysprep by its very nature will allow you to put the new machine into production as it will have all the same settings but it will have a new name and SID. Or how about if you just want to test an update, you could do the following if you have the software….

      If your XA servers are VMs just take a snapshot and apply the hotfix. Test and if it breaks roll back the snap. Or if you prefer clone the server, do not connect it to the production network and test your update and apps. Obviously that would depend if your apps could run in a sandbox so to speak.

      Hope this helps?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s