Pages

Thursday, February 16, 2012

Configuring “Change Host Details” in Citrix XenDesktop 5.5 Desktop Studio to use a new vCenter server throws the error: “The hypervisor could not be contacted.”

Problem

You’re attempting to change the vCenter server instance that your XenDesktop 5.5’s DDC uses via “Change Host Details” in Desktop studio but after entering the new Address for vCenter:

image

… you receive the error:

The hypervisor could not be contacted.

image

Solution

There can be many reasons that may cause this and one of them is the network connectivity between your XenDesktop’s DDC over to your vCenter but if you’ve confirmed that it is not a network issue, one of the items you should check is whether you have the vCenter’s certificate installed onto your DDC’s local computer store’s Trusted People –> Certificates.

The situation I was in was that I had temporarily connected my DDC over to a temporary vCenter and when we finally got new blades provisioned, I had to move it over to the production environment’s vCenter.  What I initially forgot to do was to download and install the production vCenter’s self signed certificate that it uses to present to clients connecting to it which was what caused the error thrown by the DDC.  So if you have missed this step, proceed with downloading the vCenter’s certificate and import it into the DDC’s local computer store as shown here:

image

**Note that you see 2 VMware default certificates listed because one was from the old temporary vCenter

Make sure you don’t forget to import this certificate to any secondary DDCs that you may have or you will encounter erratic behavior when provisioning new desktop catalog pools.

Wednesday, February 15, 2012

How do I set the “Devices” settings in the “Citrix Receiver-Desktop Viewer Preferences” configuration accessed via the Citrix Desktop Viewer connection toolbar?

I’ve been working with a few thin-clients from HP and Wyse lately as the client evaluates which device they’re going to use for their deployment.  One of the requirements the client has was to be able to attach a USB attached receipt printer for their tellers.  Installing the drivers onto the thin-client was a challenge in itself which I will write a separate post but when I finally got the drivers installed, I was faced with the challenge of having the virtual desktop automatically map the USB attached printer upon start up or attached during the time the user is logged on.  By default, the Citrix Receiver’s Citrix Receiver-Desktop Viewer Preferences is set to the following:

image

Choose how to connect devices to your virtual desktop

When the virtual desktop starts

  • Connect all devices automatically
  • Ask me each time
  • Do nothing <— Default

When a device is connected while the virtual desktop is running

  • Connect the device automatically
  • Ask me each time
  • Do nothing <— Default

image

As some of you may know, this means that the virtual desktop will not automatically map USB devices upon startup as well as when the user suddenly decides to plug in a device while logged into the desktop.  Furthermore, thin-clients usually don’t give the user access to the connection bar and therefore there is really no way to set it once the user has logged into their virtual desktop.

Having browsed the icaclient.adm template:

image

… as well as the Citrix policy settings available in Desktop Studio:

image

… and not able to find the settings, I placed a call into Citrix.  The engineer wasn’t really sure where to configure this and said he would call me back so I went ahead and did some searching around in the registry of the client (physical computer with the Citrix Receiver installed).  What I found was that the settings I was looking for could be found under the following registry keys:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client
  • HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client
  • HKEY_USER\SID\SOFTWARE\Citrix\ICA Client

Before I proceed with what keys represent the settings, let’s step back and talk about which of the registry hives listed above takes precedence over the other.

The HKEY_CURRENT_USER hive represents the account you are currently logged onto the desktop and the settings in here takes precedence over the HKEY_LOCAL_MACHINE.  This means that if you have conflicting settings set in both locations, what you have in HKEY_CURRENT_USER will be effective for the Desktop Viewer Preferences.  The HKEY_USER\ hive contains all of the users who have logged into this desktop and the SID portion is used to differentiate which keys belong to which user.

So what does this all mean?  This means that if you intend on apply the Desktop Viewer Preferences settings for all users who log onto this server, make sure you remove all the keys pertaining to the settings from HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client and HKEY_USER\SID\SOFTWARE\Citrix\ICA Client.

Now that we have the hive precedence explained, let’s look at the key settings.  If you’ve manually gone into the connection bar:

image

… and set the preferences for devices, you’ll notice that your HKEY_CURRENT_USER and certain HKEY_USER\SID\ will have the following key listed:

… SOFTWARE\Citrix\ICA Client\USB\yourVirtualDesktopPoolName+someUniqueNumber

If you would like to have specific settings set for all of the users on this desktop or thin-client, simply delete the USB key from:

  • HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client\
  • HKEY_USER\SID\SOFTWARE\Citrix\ICA Client\

… then navigate to:

HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client

image

… then add it to the following USB key and the following String and DWORD values:

String –> ExistingDevices

String –> NewDevices

DWORD –> ShowAllDevices

image

The String and DWORD values are mapped accordingly:

Type

Name

Value

Setting

String

ExistingDevices

  • Ignore
  • Ask
  • Always
  • Do nothing
  • Ask me each time
  • Connect all devices automatically

String

NewDevices

  • Ignore
  • Ask
  • Always
  • Do nothing
  • Ask me each time
  • Connect all devices automatically

DWORD

ShowAllDevices
  • 0
  • 1
  • Check:
    Simplify device connections for me (Recommended)
  • Uncheck:
    Simplify device connections for me (Recommended)

Here’s another screenshot of the Device settings for reference:

image

Now that we know how to set these values via registry, we can either use a .reg file to create the keys that may look like the following:

[HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\USB]

“ExistingDevices”=”Ask”
”NewDevices”=”Ask”
”ShowAllDevices”=dword:00000000

… or a combination of a .reg file and GPO via a custom .adm file to set these keys.  The .reg file would be used to create the keys and the custom .adm file, which you will need to create yourself since Citrix doesn’t supply one, to set the value for these keys.  I’ll be spending some time over the next few weekends to create the custom .adm file and test it and will update this post when I have that completed.

Tuesday, February 14, 2012

Disabling RDP redirected printers for VMware View Virtual Desktops

One of the common issues that I find fellow professionals bring up when we’re talking about VMware View desktop customizations and deployments is that if the environment is trying to extend the life of their existing desktops, users tend to complain about duplicate printers showing up in their Devices and Printers settings.  This issue is usually caused by redirected printers that are mapped on their physical desktop so when they log onto their View desktop, they automatically get redirected into their virtual desktop and most of the time, these printers are the same as the ones that are mapped in their virtual desktops.  To add to the duplicate printers, the default printer may also be set to a redirected printer mapped to the physical desktop.  This almost always causes confusion to the user and can potentially increase network traffic as print jobs get routed in between the virtual and physical desktop, over to the print server and finally to the printer.

**Note:  The policy mentioned below are for clients connecting via RDP protocol.  For PCoIP clients where printers are redirected via ThinPrint, see this post instead:

VMware View virtual desktop printers defaulting to thinprint redirected printers
http://terenceluk.blogspot.com/2012/10/vmware-view-virtual-desktop-printers.html

The solution to this issue is actually quite simple and that is to use Active Directory Group Policy to disable this redirection.  Start off by creating a new policy (or open up a policy you would like to add this setting to) and navigate to:

Computer Configuration –> Administrative Templates –> Windows Components –> Terminal Services –> Client/Server data redirection

Within this note, enable the following two settings:

  • Do not allow client printer redirection
  • Do not set default client printer to be default printer in a session

image

Note that this policy is applied to the computer object so you need to apply it to the users’ physical desktops.

Hope this helps anyone looking for a quick answer to removing redundant printers showing up in their View desktops.

Monday, February 13, 2012

Creating a new desktop catalog in XenDesktop 5.5’s Desktop Studio throws the error: “A snapshot could not be created from the specified Virtual Machine” “The specified master VM is not a Snapshot”

Problem

You attempt to create a new desktop catalog in XenDesktop 5.5’s Desktop Studio but the desktop creation fails with the following error:

A snapshot could not be created from the specified Virtual Machine

The specified master VM is not a Snapshot

image

When browsing through the Tasks and Events in vCenter, you see the following error:

The operation is not allowed in the current state.

image

Solution

One of the reasons why you may receive this error is if the master image you’re using is stuck in a limbo state.  In the case of what caused my error, it was because I had initiated a shutdown via vCenter but the virtual machine was stuck in a shutting down state and therefore when Machine Create Services attempted to snapshot the virtual machine, it failed.  Here’s a screenshot of what the virtual machine’s summary tab looked like:

image

The console showed an error message indicating that a duplicate network name exists and that Windows was “shutting down”.

To rectify the problem, simply get it out of the limbo state.  I simply clicked on the OK button on the error message and let the shutdown process complete.  Once the virtual machine was off, MCS was then able to create the snapshot and continue with creating the pool.  Note that the virtual machine doesn’t need to be in a powered off state in order to be used to create a new desktop pool.

Do I need to snapshot my master image when creating a pooled desktop catalog in Citrix XenDesktop 5.5 via Desktop Studio?

I know this may seem obvious but I’ve been asked a few times about whether to create snapshots for the master image that will be used for a pooled desktop catalog in Citrix XenDesktop 5.5 via MCS’ Desktop Studio.  Those who are familiar with VMware View would know that it’s mandatory for you to create a snapshot of your master image when creating a linked-clone pool but in the case of XenDesktop, the answer is yes and no.  Yes in the sense that your master image needs a snapshot in order for MCS to create the pool and no in the sense that if you don’t create a snapshot for your master image, MCS will do it for you. 

The only draw back I see of not manually creating a snapshot of your master image is that MCS will create a snapshot and name it with its naming convention.  The following is an example:

We have a Windows XP SP3 master image with no snapshot:

image

We proceed with creating a static pool:

image

We select the master image that has no snapshot:

image

We name the pool:

Test Pool

image

Once MCS begins to create the pool, you’ll see a snapshot that was automatically created.  The name convention MCS uses is:

Citrix_XD_

… then followed by the name you gave to the pool so in this example, it ends up being:

Citrix_XD_Test Pool

image

So where does the Citrix_XD_ come from?  I’m not sure and I know it doesn’t have any relation to whether the pool is static or random because I’ve created both type of pools and noticed that the name is the same.

So what would I recommend?  Create your own snapshot because you can give it a meaningful name and you’ll avoid the following mistake some people may accidentally make.

What to Avoid

Now that we’ve talked about how XenDesktop handles snapshots, I would like to demonstrate a situation that having XenDesktop’s MCS automatically create the snapshot for you would create an undesired result.  Say we already have a desktop catalog created with a master that has a snapshot created.  If we decide to create another desktop catalog using the same master image with the intention of having the new second pool in lockstep with the existing pool, but forget to select the snapshot during the creation of the pool, we’ll end up with the following:

image

Notice how XenDesktop just created another snapshot on top of the first pool.  This is probably going to be the undesired result because now you have the second pool’s snapshot stacked on top of the original one.  The next time you decide to update your original desktop catalog, you’ll need to either use the second pool’s snapshot or create another one from it.

Sunday, February 12, 2012

VMware View Linked-Clone Desktop Pre and Post Deployment Checklist

I’m not sure why I never wrote a blog post about the items I typically go through when I have a VMware View virtual desktop deployment but as some of you may know, I’m currently finishing off a deployment so as I went through my old project task lists, I took the time to put most of the items into a list.  The following items aren’t meant to be a complete list since every environment is different so please use it as a starter list which requires more items to get appended to.  Also note that in addition to the items I’ve included in this blog post, there is also a lot of optimization tips in the VMware View Administration guide:

image

Preparing Master Image for Linked-Clones

  1. Review your guest hardware configuration for your master image as per the VMware View Administration guide with the consideration of the operating system you’re using:
    • vCPU (is 1 vCPU sufficient?  Or do you need 2 or more?)
    • Memory (View 5 suggests to start @ 512MB)
    • Network (single homed or dual? Type of network adapter. For example, E1000 adapter is known to have customization timeout errors for Windows 7 so VMXNET 3 is recommended but a patch is also required when you use this adapter)
    • SCSI Controller (LSI Logic is suggested for Windows 7 and XP guest OS.  LSI Logic SAS is only available for VMs with hardware version 7.  Windows XP does not include a driver for the LSI Logic adapter so it needs to get downloaded)
    • Disk Size (the non persistent O/S disk should be large enough for the OS and apps while the persistent disk needs to have enough space for your cached mailbox’s OST file if you decide to cache the Exchange mailbox.  If you cache the mailbox, 2GB suddenly isn’t all that big)
  2. Prepare and use a dedicated account that you know will never log onto the linked-clones in the future to prepare the master image or you may encounter the issue where redirected profiles would fail.  See this post for more details: http://terenceluk.blogspot.com/2012/03/vmware-view-50-user-profiles-on-windows.html
  3. Install VMware Tools.
  4. Install Vmware View Agent.
  5. Go into Device Manager of the Windows guest OS, navigate to the NIC, open up the properties, navigate to Power Management and uncheck Allow the computer to turn off this device to save power.  This is important or else you’ll notice that your virtual machine will intermittently lose its IP address and vCenter will display the message that VMware Tools is not installed.  See one of my previous posts for more details: http://terenceluk.blogspot.com/2012/01/strange-vmware-vsphere-50-behavior-on.html
  6. Run Windows Updates and disable Windows update if you’re not using GPO (recommend to disable it anyways).
  7. Install Java, update java and turn off auto updates.
  8. Install Adobe Reader, update adobe and turn off auto updates.
  9. Install Adobe Flash, update flash and turn off auto updates.
  10. Install the latest Silverlight.
  11. Install Anti-Virus agent.
  12. Create shortcuts to desktop for all users via: C:\users\public\desktop.
  13. Install Microsoft Office and use the Microsoft Office Customizations tool to create a custom.msp file to change items such as template paths and/or create an Outlook Profile. If you don’t want to use a customization file, you can also use group policies to apply customizations.
  14. Turn off hibernation with: powercfg.exe /hibernate off.
  15. Install printer drivers if your print server does not have them installed to offer (i.e. you have Windows 7 64-bit desktops but still using a Windows Server 2003 32-bit server).
  16. Remove unused profiles from C:\Users (be careful with Windows 7 desktops as the registry also keeps track of profiles).
  17. Rearm Office 2010 before shutdown. Make sure you keep a count on how many times you rearm Office 2010 as there is a limit of 5.
  18. Also be aware that you can only sysprep Windows 7 a total of 3 times.
  19. Prepare KMS server for activating Windows 7 and Office 2010 with KMS keys.  Note that depending on whether you choose to use quickprep or sysprep, you may need to prepare your KMS server differently.  I won’t go too deep into this but quickprep does not create new CMIDs for Windows 7 so if your KMS has not reached 25 Windows 7 clients yet, it will never activate your pool of linked-clones whether there’s 10 or 1000 of them.  This means if your KMS server is new, and you plan to use quickprep, deploy a pool of 25 Windows 7 desktops with sysprep so you can get your KMS server to start activating because once the KMS reaches 25 clients, it doesn’t care about the CMID anymore.

Post Deployment Tasks

  1. Make sure you test your View desktops’ printing by sending print jobs to a few printers.
  2. Make sure you ensure the appropriate default printers that are mapped via scripts and GPOs in your View desktops.
  3. If you’re using an older version of Exchange such as 2003, migrate the users’ signatures.
  4. If retaining email address history autofill is important, migrate them from the users’ physical desktop.
  5. If desktop, my documents, etc folders are not configured as redirected folders to a server, copy any local profiles from the user’s physical desktop to their new persistent disks.
  6. Test VMware View client login to check for duplicate printers. If you do not want View to mount the local physical desktop’s printers, use GPO to disable redirected printers.
  7. Use VAMT Tool to review activation status of Windows and Office applications.
  8. If automating log on to the users virtual desktop is required when users log onto their physical desktops, configure a GPO and apply it to the user account (http://terenceluk.blogspot.com/2012/01/automating-vmware-view-client-logon.html).
  9. If automating the deployment of VMware View Client via GPO is required, configure a policy to install the client with the msi package (http://terenceluk.blogspot.com/2012/02/extracting-msi-file-from-vmware-view.html).
  10. If customizing the VMware View Client settings on the users’ physical desktops is required, configure a GPO to apply settings with VMware’s custom adm templates.
  11. Configure Office 2003/2007/2010 GPO to customize Office settings (i.e. annoying welcome messages, Office update selection, etc).
  12. If you want users to be able to automatically connect their USB devices within the virtual desktops when they plug these devices into their physical workstations then create a GPO with the vdm_client.adm template and assign it to an OU with the physical workstation’s computer accounts.  The settings to turn are the following:
       a) Connect all USB devices to the desktop on launch.
       b) Connect USB devices to the desktop when they are plugged in.
    You can see another one of my blog spot with instructions on how to do this here: http://terenceluk.blogspot.com/2012/02/enabling-usb-devices-for-vmware-view.html

I’ll append more items to this list as I come across items I’ve forgotten.

Improving PowerShell performance for XenDesktop 5.5

I’m sure this information can probably be found in a Citrix KB article but if you’re like me, I’ve always found it difficult to locate the Citrix KB I’m looking for just so this is so that I have something to reference in the future:

Your PowerShell console would load faster when it needs to add the Citrix snap-ins if you disable the following 2:

  1. Check for publisher’s certificate revocation
  2. Check for server certificate revocation

image

The reason why this would decrease the loading time is because this will prevent PowerShell to have to wait for a CRL check.