Home » pvs

Tag: pvs

Citrix PVS vdiskdif.vhdx cache file filling up and servers crashing after reboot.

Situation:

We had a number of production VMs running a Citrix desktop workload on Citrix Xenapp 6.5 via Citrix PVS 7.1 (SP3) with cache to RAM with overflow to hard drive, set at 2048Mb. VMware Hypervisor 5.5 and Appv 5 SP2 with HRP4 running in full infrastructure mode (no Microsoft SCCM) and 30GB of packages running in Shared content store mode from a network file share \\server\appvshare$

Servers have 12GB Ram, with 4 vCPU’s and Windows 2008 R2 SP1

C: Drive is 40GB (with 35GB utilised)

D: Drive is 20 GB (typically 12GB utilised at any one time) with a 6.1GB Page file redirected here, an the vdiskdif.vhdx at 4mb

We have a daily reboot for the entire Citrix desktop estate estate at 3am.

Appv GPO Settings are to use Shared content mode, use the local path of c:\programdata\appv (not app-v), autoload = ALL, user and computer refresh on logon = true

APPV_Streaming

Problem/Symptoms:

After an IE11 upgrade on the Citrix vDisk, every 2-3 days some of the citrix servers would reboot (as per policy) and quickly fill up the D drive, finally crashing the server and rendering it unusable. Hoorah for PVS cache to disk.

As the machine had crashed there was little way to troubleshoot it after the fact, so we needed to capture it during.

Steps to resolve:

Increase C: Drive to 60GB using the process listed in the first section of this article – NO FIX

Increase D: Drive to 40GB to resolve. The server stopped crashing as the server didnt run out of D drive space, we then noticed that the vdiskdif.vhds was sitting at 13.6GB and growing (vs unaffected servers sitting at 4Mb) When checking the system processes, nothing was obviously running or processing. This was a nice workaround but not a final solution or fix.

We rebooted and remotely monitored the system with PSTools (sysinternals) executable “pslist -s \\servername”. During the reboot the appvclient.exe was siting 25% CPU, whilst the GPO to do a full client sync was ‘called’ and run (powershell: get-appvpublishingserver | sync-appvpublishingserver)

Our crashing was finally narrowed to the AppV client that was sporadically somehow crashing and filling the D drive. When the AppV client was stopped or the server removed from any ‘global’ publishing – the server never crashed. As soon as the production APPV packages were republished to the device, and after every 2 or 3 reboots the appvclient.exe would run, start caching files, and start filling up the D drive as it was ‘copying / caching’ the packages.

This felt very much like the AppV client was ignoring the shared content mode, and trying to cache everything locally.

Final Resolution:

The ‘gut feeling’ on this problem was that the AppV client wasnt getting the correct settings from GPO in time. The local AppV Client settings (registry) were reviewed and it seemed there were some improvements to be made.

OLD SETTING

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\Streaming]

“AutoLoad”=dword:00000001

“SharedContentStoreMode”=dword:00000000

Turns out the Appv Client settings were set to disable Shared content mode, and to autoload all apps which we are assuming its doing sometimes before it gets its required settings from GPO.

 

NEW SETTING

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\Streaming]

“AutoLoad”=dword:00000000

“SharedContentStoreMode”=dword:00000001

After creating a new vDisk version with the ‘New Setting’ registry keys listed above tattooed in the vDisk image  the servers haven’t crashed since.

Also we were using a GPO powershell script that tells the client to go and ‘autoload’ all the apps. So the autoload registry option was just confusing things, hence we disabled it.

Autoformat Citrix PVS Write Cache Drive

Problem:

We wanted to Autoformat Citrix PVS Write Cache Drive of the PVS D drive (writecache) for things like Citrix logs, edgesight database. Otherwise the servers boot up first time and complain they cant create or access the pagefile.

Want the D Drive labelled with Server name so if ever they are moved or detached – its easy to identify.

Solution:

Create a batchfile that does the following

diskpart.exe /s \serversharePVS_ddrive_creation.txt
shutdown.exe /r /t 001

Add this batchfile with additional logic to the regrunonce windows registry key or use Appsense EM to call the batchfile when deployed to a new machine.

Contents of PVS_DDrive_Creation (change to suit your needs)

select disk 0
clean
create partition primary
select partition 1
format fs=ntfs Label=%computername%PVS quick
assign letter=d

Done!

Citrix PVS 7.1 and AppV 5 applications crashing, launching once

This issue absolutely did my head in. I had to publish it for you all to save you the time if you ever come across it as I was close to QUITTING because I couldn’t get this to work.

Scenario:

  1. Windows 2008 R2, Citrix XenApp 6.5 and Microsoft AppV 5 SP2.
  2. Applications published globally to the XA Servers
  3. All Servers streamed from Citrix PVS 7.1
  4. User profiles managed with Citrix User Profile Manager

This article for the Citrix UPM was already followed and the AppV Exclusions were definitely set

https://support.citrix.com/proddocs/topic/user-profile-manager-5-x/upm-using-with-app-v.html

Some App-V packaged applications would launch once, then never again when the Package Installation Root was pointing to the Read Only PVS Image (%programdata%AppV) and ONLY when the server was in Read only mode. If I was editing the image in PVS maintenance mode to update the vDisk – the issue never presented itself.

Ideally I wanted the App-V cache to point to the ‘out of the box’ %programdata%AppV – and in conjunction with PVS you can guarantee its fresh everytime

A temporary work around was to move the Package Installation Root to the D: (Read Write Disk) < but we soon started getting errors with this as no amount of scripting and startup scripts would cleanly remove this directory 100% all the time. I.E:

Get-AppvClientPackage -All | Remove-AppVClientPackage

remove-item -Recurse -Force d:app-v

get-appvpublishingserver | sync-appvpublishingserver -Global

This script would only remove the currently published applications, too bad for any legacy packages that were no longer published to the servers,

AppV_D_Notrefreshing

and for whatever reason the SYSTEM account was unable to delete the d:app-v folder (access denied even though it was owner and had full rights) sporadically the folder wouldn’t update at all and no applications would be refreshed until a user logged into the server. (Poinless on a citrix server where the applications have to exist if delivered as published apps’  Citrix could not find / see the executable and the published app would not run.

Eventually App-V Clients services started failing unable to start.

appv_d_Error7024

The Microsoft App-V Client service terminated with service-specific error The system cannot find the path specified.. EventID 7024 (Update: After further troubleshooting it turn out this was because some of the legacy packages were referenced in the Windows registry)

There had to be a better solution.

Solution:

Change the PVS 7.1 Disk Cache mode to  “RAM with Overflow to Disk”, Return the Package Install Root to %programdata%AppV and generalise the AppV 5 Client before shutting down the image after each PVS update.

 

vdisk_properties_pvs7.1_appv5_Fix

 

AppV 5 Generalise:

c:admintoolspstoolspsexec.exe -s powershell.exe “Get-AppvClientPackage -All | Remove-AppVClientPackage”
regedit.exe /s “C:adminToolsAppV_Generalise.reg”

AppvGeneralise.reg Contents:

Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINESOFTWAREMicrosoftAppVClientIntegrationPackages]

[-HKEY_LOCAL_MACHINESOFTWAREMicrosoftAppVClientPackageGroups]

[-HKEY_LOCAL_MACHINESOFTWAREMicrosoftAppVClientPackages]

[-HKEY_LOCAL_MACHINESOFTWAREMicrosoftAppVClientStreamingPackages]

Articles / References:

http://discussions.citrix.com/topic/348198-app-v-5-client-citrix-provisioning/ – Explains the situation clearly, and finally provided me the solution to fix it once and for all. Much thanks to Carl Fallis!

Dynamically display the PVS environment detail on users desktop with BGINFO

I want all PVS servers to dynamically display their environment on the desktop when a users logs into the desktop.

This can be achieved by:

1) adding a new ‘personality’ variable to each device in PVS

2) scripting the import of the variables from the c:personality.ini file to the windows registry

3) setting BGINFO to display the registry information at each user logon.

Process:

1) Edit the properties of the Target Device > Personality Tab > and Add your variables

PVS_Personality_variable

2) Script the import with VB and run as a computer startup script in the GPO

Set objShel = CreateObject(“WScript.Shell”)
objShel.Run “C:Progra~1CitrixProvis~1GetPer~1.exe Environment /r=HKEY_LOCAL_MACHINESOFTWAREMYCOMPANYPVSEnv”

3) Download BGINFO from sysinternals and setup the new desktop display

BGINFO_PVS_ENVIROMENTVIEW BGINFO_PVS_ENVIROMENT_registryssetup

bginfp_pvs_examplebginfp_pvs_example_prod

 

PVS vDisk extension results in windows boot manager failure

Situation:

Our C: drive on a test PVS image (Private mode acccess) was nearly full

We extended the vDisk following this process

  1. Open Cmd Prompt
  2. diskpart
  3. Select vDisk file=”Path to your PVS vDisk”
  4. List vDisk
  5. expand vDisk maximum=xxxxx (in Mb) (61440 for 60GB etc)
  6. attach vDisk
  7. list Disk
  8. list volume
  9. Select volume x
  10. extend
  11. List volume
  12. detach vDisk
  13. exit

After detattching and booting the Test PVS Server windows wouldn’t boot with a System volume couldnt be accessed

windows_pvs_boot_error_0xc000000f

Solution:

Repeat steps 3,6 and 12 to reattach the disk and deattach the vdisk cleanly then boot the VM.

WebEx Install on Citrix XenApp 6.5, PVS Image and Appsense 8.3

Problem: Our webex client would install on the xenapp image ok for any user, webex would connect and work ok first time, subsequent attempts to connect to a test meeting would crash the webex client.

Solution – Create a SYMLINK
Ensure that Appsense AM Agent is STOPPED before beginning the install. It was preventing the installation from completing 100% (even though you get no feedback that the install has failed)

Run the cisco webex client offline installation from the cisco website

Start the Appsense AM Agent

Create a (symlink) as WEBEX is stupid enough to install itself into c:\programdata\webex
to ensure all users had their own webex installation be sure to run the following command to creation a directory junction point.
h=userhomedrive or other personal drive they have full access to
mklink /D c:\programdata\webex\webex1124 h:\webex

Open Internet explorer and connect to www.webex.com/test-meeting.html and test the login – the client should open fine and connect

Solution – Already installed but broken:
Stop Appsense AM Agent
Run the webex offline installer and remove all components
Browse to c:\programdata and DELETE the webex folder
Now follow the ‘Solution – Fresh Install’ above.

Good luck!
James

PDF Converter Script

Screipt provided will change the password associated with the PDF Printer AMYUNI Documet Converter 400.

This had to be automated as our PVS environment couldnt be updated everytime we wanted to change the devices password company wide.

START SCRIPT—————————————————–

Option Explicit

‘ This VB script can be used to configure the installed printer

Dim PRINTER_NAME

PRINTER_NAME = “PDFPRNxx”

Dim PDF

‘for version 4

Set PDF = CreateObject(“cdintfex.cdintfex”)

‘for version 4.5

‘Set PDF = CreateObject(“cdintfex.cdintfex.4.5”)

PDF.DriverInit (PRINTER_NAME)

‘/*////////////////////////////////////////////////////////////

‘Permission Permission value

‘Enable Printing – 64 + 4

‘Enable document modification – 64 + 8

‘Enable copying text and graphics – 64 + 16

‘Enable adding and changing notes – 64 + 32

‘To combine multiple options,

‘use -64 plus the values 4, 8, 16 or 32. E.g. to enable

‘*/

‘//1 = 40-bit encryption

‘//2 = 128-bit encryption

PDF.Encryption = 2

‘PDF.OwnerPassword = “owner”

PDF.UserPassword = “password”

‘MsgBox “pwd set”

‘PDF.Permissions = (-64 + 32)

‘//Apply changes

PDF.SetDefaultConfig

Set PDF = Nothing

‘MsgBox “done”

Automation of Printer settings for PVS images

Scenario: A password protected printer, where the password changes every month. We had to manually enter the new password when our PVS images were rebooted, as we didnt want to update the PVS image with just a password change (we hadnt introduced DFS-R for the PVS image management so it was manual and time consuming)

Solution:

EXPORT the settings to a file for the specific printer – rundll32 printui.dll,PrintUIEntry /Ss /n “MYLAMEPRINTER” /a “file.dat” u

IMPORT the settings to any server that needed it – rundll32 printui.dll,PrintUIEntry /Sr /n “MYLAMEPRINTER” /a “file.dat” u

Add this as a startup script GPO

References:

http://support.microsoft.com/kb/189105

http://zacky.cleverits.com/IT/printer.htm

http://www.robvanderwoude.com/2kprintcontrol.php

http://www.unattendit.com/2009/10/17/unattended-installation-of-network-printers-using-printui-dll-for-all-users/

XenApp 6.5 PVS Generalise Script 2012

Copy of script used to further ‘generalize’ our XenApp servers before cloning via PVS

__ BEGIN SCRIPT ___

REM clear event logs

wevtutil cl System

wevtutil cl Security

wevtutil cl Application

wevtutil cl Setup

wevtutil cl “Forwarded Events”

 

REM Stop Edgesight and Delete database

net stop RsCorSvc

net stop FirebirdServerCSMInstance

del “C:ProgramDataCitrixSystem MonitoringDataRSDATR.FDB” /q

del “D:ProgramDataCitrixSystem MonitoringDataRSDATR.FDB” /q

 

REM stop Appsense Services and delete JUST the machine ID

net stop “AppSense Application Manager Agent”

net stop “AppSense Client Communications Agent”

net stop “AppSense EmCoreService”

net stop “AppSense Watchdog Service”

reg delete “HKEY_LOCAL_MACHINESOFTWAREAppSense TechnologiesCommunications Agent” /v “Group ID”

reg delete “HKEY_LOCAL_MACHINESOFTWAREAppSense TechnologiesCommunications Agent” /v “Machine ID”

 

REM Change EnableSecuritySignature value to 0 for drive mappings to modified down level clients (Win 2000) – this setting didnt work in just GPO.

reg delete “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesLanmanWorkstationParameters” /v “EnableSecuritySignature” /f

reg add “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesLanmanWorkstationParameters” /v “EnableSecuritySignature” /t REG_DWORD /d 0 /f