Showing posts with label XenDesktop. Show all posts
Showing posts with label XenDesktop. Show all posts

Tuesday, 6 February 2024

Citrix Information available in Session (NameSpace)

 




We can use Namespace Info to get some information on a VM

This can be handy for getting some awareness within windows. 



gwmi -Namespace root\citrix\desktopinformation -class Citrix_VirtualDesktopInfo


  • This will shows
  • Site Name
  • Catalog Name
  • Delivery Group Name

Monday, 25 March 2019

Xendesktop power State unknown - Vmware Xendesktop UUID GUI Mismatch

A POWER STATE UNKNOWN is quite likely to be produced in the event of change to VMs on the hyper-visor that breaks its connection with Xendesktop. This commonly occurs with a VM GUID change.

You need to ensure that the Xendesktop GUID for VMs matches the Hyper-V or Vmware GUID.


Vmware Command to View Hosted Connection GUID
$Data = get-vm $Machinename | get-view
$DataConfig = $data.vmware.vim.virtualmachineconfiginfo
$GUID = $DataConfig.Config.uuid


Vmware View GUIDs on Host Machine
get-childitem -path xdhyp:\hostingunits\hostservername -recurse | select -property name,id | Export-csv C:\host.csv

Xendesktop view GUID
Get-brokermachine -machinename uk\machinename | select Name,Hostedmachineid


If they are out sync, then you will need to set the GUID In Xendesktop to match the hypervisor with the following command

set-brokermachine -machinename domain\computername  -hostedmachineid xxx-yyyy-zzzz


Note : If the command to get the ID from Vmware fails, it can also be gained by changing directory to cd XDHYP:\connections\hypervisorname  then dir *.vm >out.txt and check inside the output for the machines ID









Wednesday, 30 January 2019

Citrix Upgrade Workflow

The following is a handy workflow for the Citrix Workflow upgrade.


Thursday, 30 June 2016

Citrix Session reliability screenshot of the user experience

The Citrix Session reliability feature has been around for ages. It has changed its behavior a bit recently dependent on Citrix Receiver Version. The following show the differences for the end-user experience. Thanks to Kaleigh at Citrix for her help with this.


Citrix Receiver 3.4 - This shows a reconnecting systray bubble. 
Citrix Receiver 3.4

 Citrix Receiver 4.0 thru 4.2 - This shows a systray bubble and grey's the window to show its not active

Citrix Receiver 4.0


Citrix Receiver 4.3 & 4.4 This shows a systray bubble with newer logo and connection interrupted message. The window goes grey the window to show its not active
Citrix Receiver 4.3




Citrix Session reliability screenshot of the user experience

The Citrix Session reliability feature has been around for ages. It has changed its behavior a bit recently dependent on Citrix Receiver Version. The following show the differences for the end-user experience. Thanks to Kaleigh at Citrix for her help with this.


Citrix Receiver 3.4 - This shows a reconnecting systray bubble. 
Citrix Receiver 3.4

 Citrix Receiver 4.0 thru 4.2 - This shows a systray bubble and grey's the window to show its not active

Citrix Receiver 4.0


Citrix Receiver 4.3 & 4.4 This shows a systray bubble with newer logo and connection interrupted message. The window goes grey the window to show its not active
Citrix Receiver 4.3




Tuesday, 7 June 2016

Citrix ICA file behaviour (some of it)

When connecting to a Citrix environment the connection between end-point and resource is established via an ICA file. (receiver for web)

The ICA file is generated by storefront and delivered back to the end-point.

ICA file Location
The ICA file get stored in the users
"%Appdata%\local\Temp" or "%LocalAppData%\Local\Citrix\Web Helper\Temp\2"

ICA files downloaded 
IE downloads - 4 ICA files
Chrome downloads - 2 ICA files
Firefox - 4 ICA Files
(Note : 4 files are downloaded for desktops and 2 for published applications)

File Assocation
The ICA file is then launched via file Association to open Citrix Receiver or Citrix Connection Manager.

File Delete
When the session is disconnected or logged off the ICA file should be deleted. This is contolled via the Default.ICA file on storefront with the setting RemoveICAfile=Yes

Testing
My testing showed that Firefox did not always clean up the ICA files on logoff or disconnect and left 1 ICA file behind. This was always true when "Connection Manager" was used to open ICA files. When Receiver was used within Firefox the ICA files removed as expected.
It was noticed that ICA files are always called ICAxxxx except in firefox with connection manager which names the files WEQ3xxxxx

Monday, 6 June 2016

Citrix XenApp 7 - Application not running

When looking at a recent XenApp 7 environment i noticed a number of disconnected users listed with a strange session state of "Application not running"




After examining these user sessions i could see that how a lingering systray process APPVStreamingUX.exe.

This is a known process that should be placed in the LogoffCheckSysModules registry key to ensure the logoff is not held up waiting for this process to close.

Monday, 12 October 2015

Citrix XenDesktop 7 Connection Leasing (LHC replacement)

Citrix XenDesktop 7.6 Connection Leasing

Description

When Citrix changed the management architecture from IMA to FMA we faced a challenge in that database connectivity became important as without we lost management and the users could not make new connections. 

The "IMA" architecture featured a LHC (local Host Cache) Feature which kept a subset of database information on Farm Controllers. This meant a loss of connection to the database server would only impact the administrators. 

The newer "FMA" architecture had no such caching option and as such always required access to the SQL database to service admin and user requests.

This meant that we had a much greater reliance on a High available SQL than before. 

The release of XenDesktop 7.6 gave us a feature called "Connection Leasing" which gives us back a similar safety net that LHC had given us. 

The connection leasing feature supplements the SQL Server high availability best practices by enabling users to connect and reconnect to their most recently used applications and desktops, even when the Site database is not available.
Connections are cached for a lease period of two weeks. So, if the database becomes unavailable, the desktops and applications that the user launched in the previous two weeks remain accessible to that user through StoreFront. However, desktops and applications that have not been launched during the previous two-week lease period are not accessible when the database is unavailable
Connection Leasing will only occur in the event of a failure of all controllers within a site.

Database Sync

Each controller retrieves the sync information from the SQL database. This is throttled at a rate of up to 1000 leases every 10 seconds until all leases are synchronized.

Lease Files

The lease files are stored by default in
%programdata%\Citrix\Broker\Cache
The number of expected lease files can be calculated  using the following formula for Desktop accessible via LAN and Access Gateway.
(Users *2) + (Users * Desktops) + (Users * Application delivery groups) + VDAs
Leases file vary in size (0.5K – 512K) but will typically consume 4K blocks on NTFS file systems.

Example VDI Sizing

table to follow

VDA Registration

During connection leasing there is a 2 minute period at the start and end of the outage where VDAs maybe un-registered and then re-registered. This can have a performance impact with large amounts of machines registering in a short period.
In the event that some controllers remain connected to the database while others  fail, VDAs should register themselves with the working controller. Connection Leasing will only occur in the event of a failure of all controllers within a site.

SQL TimeOut

SQL queries have a default of 30s before they are deemed to have timed out, then the controllers will wait another 90s for a response, giving a total of 120 seconds before leasing will activate. This value can be altered if desired. (see parameters table)

Query Commands

The following commands can be used to view Broker Leasing information.
Set-BrokerSite -ConnectionLeasingEnabled $true|$false - Turns connection leasing on or off. Default = $true 
Get-BrokerServiceAddedCapability - Outputs “ConnectionLeasing” for the local Controller. 
Get-BrokerLease - Retrieves either all or a filtered set of current leases. 
Remove-BrokerLease - Marks either one or a filtered set of leases for deletion. 
Update-BrokerLocalLeaseCache – Updates the connection leasing cache on the local Controller. The data is resynchronized during the next synchronization.

Configurable Parameters

table to follow

Thursday, 9 July 2015

Citrix MCS Catalog Failure Troubleshooting


 The following technique can be used to troubleshoot Image Preperation errors in Citrix Xendesktop.

1.) Set reg Key
On the master machine that will be cloned logon
add the following registry key
HKLM\Software\Citrix\MachineIdentityServiceAgent\Logging = 1

2.) Shutdown
Shutdown the Master VM

3.) Snapshot
Take Snapshot

4.) Disable auto-shutdown
On the DDC powershell run the following command
Set-ProvServiceConfigurationData -Name ImageManagementPrep_NoAutoShutdown -Value $True

5.) Create catalog
Create a new catalog from the snapshot

6.) Get Logfiles
When a new VM is created in the hypervisor , logon and check the log files in the root of C:\

7.) Enable auto-shutdown
On the DDC powershell run the following command
Remove-ProvServiceConfigurationData -Name ImageManagementPrep_NoAutoShutdown

Wednesday, 23 July 2014

Citrix MCS an overhead on IOPS ?

During some testing of some flash based storage i noticed something strange in my test results. 
Machines created with MCS (Machine Creation Services) seemed to not be able to perform as well as machines cloned full fat by the hypervisor. 

Conducting testing with IOMeter setup with a VDI type workload as detailed in another blog article we saw the IOPS saw the following results.

MCS Cloned Machine Peak IOPS 3500
VMware Cloned Machine Peak IOPS 40,000

This was using the same master image, on the same VLAN, on the same Hypervisor host. 
The MCS created machine was a dedicated VM type. 
The VM was assigned 3GB of RAM , 2vCPU and the disk size was 80GB
The storage was isolated for the tests. 
The test was repeated over a number of times to validate the result.

I understood that using linked cloning would have a slight overhead over a full fat VMDK file but did not realise the overhead could be as high as 10X

It should be noted that 3500 IOPS per desktop is still good enough to deliver a great experience to users, and the feature benefit of pooled.

Wednesday, 18 June 2014

PowerShell Create a Large file with random content and fixed size

In order to test storage its sometime handy to be able to generate large files with random content. This allows us to test such things as

Deduplication engines
Thin Provisioning
SDelete
VMWware space reclaimation VMFKTOOL
Vmware PunchtoZero features

To this end i created this powershell script to create random content into a file. There are some thirdparty applications and other utils out there but i found them wanting and often not containing unique random data. There tended to be alot of whitespace. 

Powershell means no install required and we can customise. 
This script grabs a file full of content and randomly picks out the data and then writes it to a file until the file is the desired size. This script is not the quickest but it should be fast enough. It created a 1GB file for me in about 2 minutes.

You will need to create a c:\temp\content.txt file containing random words or sentences. 

$Input = get-content C:\temp\content.txt
$OutputFile = "Abigfile.txt"
$stream = [System.IO.StreamWriter] $Outputfile
   do {
   $Counter = 0
       do {
           $Counter=$Counter+1
           $a = $Input | get-random
           $Text = $Text + $a
           }
       While ($Counter -le 50)
   $stream.WriteLine($text)
   $FileSize = (Get-Item $Outputfile).length
   }
   While ($FileSize -le 2000000000)
$stream.close()
$WshShell = new-object -comobject Wscript.shell
$WshShell.Popup("Complete",5,"Title")

Friday, 2 May 2014

Citrix VDA Standalone Installer

Citrix have the VDA component of their product contained on the XenDesktop 7 ISO.

However if you want to remove the VDA from the ISO and make a portable version that can be used by deployment teams its not as easy as just copying a MSI or files in the \VDA folder.

This is un-tested but i believe the following are the required folders to remove the VDA agent from the main installation ISO


├ AutoRun.inf

├ AutoSelect.exe

├ ProductVersion.txt

├───Citrix Receiver and Plug-ins

│   └───Windows

│       ├───ReceiverEnterpriseMetadata.xml

│       ├───ReceiverMetadata.xml

│       └───ReceiverMetadataForCitrixUpdates.xml

├───Support

│   ├───AdDeploy

│   ├───Tools

│   ├───UnregisterVDA

│   ├───VcRedist_2005

│   ├───VcRedist_2008_SP1

│   └───VcRedist_2010_RTM

├───x64

│   ├───MediaId_7C57BFC2-CAA2-4a7f-8A81-4D9DEC545EF4_x64

│   ├───MediaId_C8096DF2-8AF8-45DE-B01B-A6CC9AFBCA9C_x64

│   ├───ProfileManagement

│   ├───Virtual Desktop Components

│   └───XenDesktop Setup

└───x86

    ├───MediaId_7C57BFC2-CAA2-4a7f-8A81-4D9DEC545EF4_x86

    ├───MediaId_C8096DF2-8AF8-45DE-B01B-A6CC9AFBCA9C_x86

    ├───ProfileManagement

    ├───Virtual Desktop Components

    └───XenDesktop Setup

Tuesday, 29 April 2014

Citrix HDX Adobe Flash Redirection

Citrix Flash-Redirection allows us to redirect Adobe Flash playback to be rendered on a compatible end-point.This technique ensures an optimal experience with the end-point taking the processing hit as opposed to the CPU on the VM or server.

Flash Redirection Set-up and Configuration
In order to ensure Flash redirection can occur the following are required.

1)Adobe Flash player Installed within the VM or Xenapp server host.

2)Adobe Flash player Installed on the end-point (for IE or other depending on your browser)

3)Citrix Receiver Client (V13 or newer for Gen2 Flash redirection)

4) Flash Redirection enabled in Citrix Policy (Default=Enabled)






5)Enable Flash Optimisation on the end point in the Receiver desktop viewer preferences



Testing its working
Once enabled we need to ensure that everything is working as expected. 
The HDX monitor tool from Citrix is great for this as it can show if Flash redirection is enabled and active.
(screenshot of Flash redirection working)


To Test the experience visit a decent flash website. I found this one pretty good as it provide statistics on the playback experience. This video playback will resize based on the available bandwidth. 


Note : Newer IE Browsers failing to perform Flash Redirection in Citrix Sessions
For Internet Explorer 11 the following may be required,

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\HdxMediaStreamForFlash\Server\PseudoServer
Add the entry named IEBrowserMaximumMajorVersion with a DWORD value = 11 (decimal). The hexadecimal equivalent is 0x0000000b



Monday, 10 February 2014

Citrix XenDesktop Reboot Powershell

The following powershell could be used on a Desktop controller to perform reboots. This script could be run with a scheduleded task.

This can be handy for things like Physical machine catalogs which dont have Xendesktop power management control.

$machines = Get-BrokerMachine -CatalogName "CatalogXX" -PowerState On

foreach ($machine in $machines)
{
write-host $machine.hostedMachineName $machine.LastHostingUpdateTime
if ( ( get-date $machine.LastHostingUpdateTime ).day -lt ( get-date ).day )
{
New-BrokerHostingPowerAction -Action Restart -MachineName $machine.HostedMachineName
}
}

Citrix Desktop Director Custom Searches Fails to Save

We had a problem on Citrix Desktop Director where custom searches would not Save. The user was given a "Access Denied" error message.

On investigation we found that custom searches are placed in the folder

c:\inetpub\wwwroot\desktopdirector\userdata

with an XML file for each user personal customization.

The director install seems to create and use a local account called "DesktopDirector" this
account needs NTFS permissions to write to this area.

On our failing server for reasons unknown the NTFS permissions were not correct.

Wednesday, 3 July 2013

Citrix XenDesktop show peak hours from CLI Powershell

The GUI for setting peak hours is a little wobbly with the slider bars.
If you want to see the power schedule with a PS command use the following

$WeeklyPeakHours = Get-BrokerPowerTimeScheme -name "DesktopGroup_Weekdays"

or

$WeekendPeakHours = Get-BrokerPowerTimeScheme -name "DesktopGroup_Weekend"

Then the following commands will show a display of the hours

$WeeklyPeakhours.PeakHours
$WeekendPeakHours.Peakhours

The Output is in the format of the hours and either a true or false value as to if it set as a peak hour.

eg.

FALSE
FALSE
FALSE
FALSE
TRUE
TRUE

Wednesday, 15 May 2013

McAfee Remove Uniqueness

When using gold images we commonly need to remove uniqueness in order to allow the image to be cloned multiple times.

The following is the process to remove the uniqueness from McAfee

Stop the following Services
McAfeeEngineService
McAfeeFramework
Mcshield
McTaskManager
mfevtp

Remove the following registry values under
HKLM\Software\Network Associates\ePolicy Orchestrator\Agent

AgentGUID
ComputerName
IPAddress
LoggedOnUser
MacAddress
SubnetAddress
SubnetMask


Thursday, 7 February 2013

Citrix Reciever - Getting to grips

Im playing around with Citrix Receiver and its install and config methods.

This blog will contain some references for myself while i work out my plan.

Web Interface 5.4 Users
Citrix Receiver Enterprise 3.2 is the last version to support legacy PNAgent Sites (eg. Web Interface 5.4)

Streamed Applications
The OfflinePlugin is required for streaming applications to that device.
Also ensure that the web interface/PNAgent site is set to trusted in the IE Sites list.
Streamed VHD info app-streaming-mounting-vhds-on-xenapp

Debug Streaming
Under HKEY_LOCAL_MACHINE/Software/Wow6432/Citrix/Rade/
ADD DWORD “EnableDebugConsole”
ADD Value =1
for full information on Debugging Streaming http://support.citrix.com/article/CTX112472

Streaming using VHDs
For pooled desktop environments or virtualized XenApp servers the option to mount the applications as VHD mount points is a great option. This saves loading the apps into the image, They can just be added as a VHD and read across the network at block level.
The use of the VHD is auto-detect for XenDesktop but the following registry keys allow you to better set the control, and force Xenapp to use this behaviour (if your Xenapp servers are using network storage)

HKLM\Software\Wow6432Node\Citrix\Rade

UseVHD
  • Omitted = autodetect
  • 0 = Don’t even think about mounting VHDs
  • 1 = If you see one do your best to mount it no matter what you see
VHDErrorFallback
  • 2 (default) – Fall back to DIR if VHD mount fails.
  • 1 fall back to DIR only if VHD does not exist.
  • 0 Never physically populate the cache. Fail the app launch if you didn’t find a VHD.

To perform an easy check if you machine is using the VHDs look in the Radecache folder and if the GUIDs have a shortcut arrow they are re-directed to a VirtualDisk.

Info gained from this Citrix Blog

Receiver 3.3 - Prevent the setup prompt for users
http://support.citrix.com/article/CTX135438

PNAgent Server Site Path
HKLM\Software\Wow6432Node\Citrix\PNAgent
ServerURL  (REG_SZ) = http://server/citrix/pnagent/config.xml

Setting this HKLM version of the key then copies the setting to the user into a REG_BINARY version inside their HKCU\Software\Citrix\PNAgent\Configuration Model 000

Full details on the process are here

http://support.citrix.com/article/CTX135584


Suppress URL Prompt at Logon
HKCU\Software\Citrix\PNAgent
SuppressURLPromptAtLogin = 0

How the Site URL is used by the Citrix Online plug in
http://support.citrix.com/article/CTX135584

Wednesday, 30 January 2013

Remove Safely Remove Hardware option from Virtual Desktop

My windows 7 Virtual Machines hosted on VMWare ESX 5.0 were showing users a "Safely Remove Hardware" Prompt in their systray.

This showed the NICs and the Harddisk as removal devices.

If the users click to remove the NICs they remove and lose their connection.
The hard disk cannot be removed as its in use.

To remove this un-required icon perform the following action for VMware ESX environments.


Click the VM, Select Edit Settings, Click Option, Click General under the advanced section.
Click Configuration parameters and click “Add Row” enter devices.hotplug and a value of false
Click OK and click OK to save the changes.

Tuesday, 29 January 2013

ICA Bandwidth usage for Login VSI tests

I have recently being using LoginVSI to perform alot of benchmarking testing.
The following are the results of some quick ICA bandwidth tests performed with the various LoginVSI workloads

My figures were based on a 5 second perfmon statistic which is really to longer gap, i will repeat with 1 second and post the results.

MediumNoFlash                  avg 10KB         Max 165KB
Multimedia (No Sound)       avg 22KB         Max 542KB
Multimedia (sound med)      avg 15KB         Max 484KB