Skip to content

Scheduled reboots not working on Citrix XenDesktop 7.12

Just a short one:
We had the problem that our scheduled reboots for a Delivery Group under XenDesktop 7.12 (not the new tagged based rebooting) did not work any longer. If you have the same problem contact Citrix Support and ask for private LC6766. This contains a new BrokerAgent.exe for the VDA which should fix the problem.

Citrix XenServer 7 shows VMs created with XenDesktop 7.12 MCS as I/O not optimized

After upgrading to XenDesktop 7.12 VMs show I/O not optimized and Install I/O drivers and Management Agent when they are created using MCS.
01_io_not_optimized

When checking the master VM everything was fine:
02_io_not_optimized

If you try to google for the problem, you only find hints to reboot the VM several times to fix it – not helpful on pooled (random) machines. Thus I restarted the Master-VM several times, created a new Snapshot and applied it to the Machine Catalog. This did not solve the problem. I opened a Ticket at Citrix. Luckily they already knew the problem and gave me a hotfix to solve it. The hotfix replaces the following files:

C:\Program Files\Common Files\Citrix\HCLPlugins\Hypervisor\v2.20.0.0\XenServer
HypervisorsCommon.dll
XenServerPlugin

To replace them you need to stop the following services:

Citrix Host Service
Citrix Machine Creation Service
Broker Service

Don’t forget to Backup the existing ones before adding the Hotfix ones.
03_io_not_optimized

After replacing the files start the stopped services. Now you need to create a new Machine Catalog – otherwise the fix will not work.

That’s it – to get the fix open a ticket at Citrix and reference to private LC6769.

Automatic Shortcut generation for local installed applications in a Citrix XenDesktop / XenApp 7.x environment

I think you all know that Citrix is still not able to detect if an application is installed locally when you publish a Desktop under XenApp / XenDesktop 7.x (in XenApp 6.5 and before that was working really good…). Instead you have to create a Shorcut-Template-Folder containing Shortcuts for all local applications and a Receiver Registry-Key. Furthermore you need to add KEYWORDS:prefer=SHORTCUTNAME to each application . Now Receiver checks if a Shortcut with the specified name exists. If it exists this Shortcut is copied to the Startmenu instead of creating one which starts another ICA-Session. The downside of this that this way it’s not detected that a published application was started – but that’s another story.

As announced during DCUGTecCon in Kassel I have created a script that creates the required Shortcuts. The script checks for all applications with the KEYWORDs:prefer= setting, exports the Application Icon and creates the Shortcuts in a configured folder. The following Script from Andreas Nick is required. You can use Andreas Script to generate any Shortcut with PowerShell. You must save the script in the same folder like my script and name it create-shortcut.ps1. Beside that you have to exclude the following line:

[ValidateSet("AllUsersDesktop", "AllUsersStartMenu", "AllUsersPrograms", "AllUsersStartup", "Desktop", "Favorites", "SendTo", "StartMenu", "Startup")]

The script must be executed on a Delivery Controller. If you only want to create the Shorcut for a specific Application you can use the paramter –ApplicationName “APPLICATIONNAME”.

You can download the script here.

A little bit of background informations about the script idea:
During the preparation for the DCUGTecCon I had some discussions with Andreas. He told me about his script to generate Shortcuts with PowerShell. At the same time, I had to create some shortcuts for some new published applications which are also locally available on a published desktop. Thus I had the idea to automate this with Andreas Script. A few days later the following script was born. I have already done some optimizations.

Microsoft Office shows Network Printers multiple times when using Citrix Universal Print Server

We had some users reporting that all Office programs (Word, Excel, Outlook,…) show each Network printer multiple times in a XenDesktop 7 environment. The printers where connected from a central Print Server using the Citrix Universal Print Server. All users affected where using the same VDA Catalog.
office_printer_duplicated_01

When you checked the Devices and Printers area the network printers where only shown once.
office_printer_duplicated_02

Furthermore other applications only showed the printers one time.
office_printer_duplicated_03

After searching for some time I found a (hidden) Citrix Blog (!) post from 2014 which describes the issue for XenApp 6.5. Ok let’s check the mentioned Registry-Key

HKLM\SYSTEM\CurrentControl\Print\Providers

office_printer_duplicated_04

And look – it was the same problem. In the order key the Universal Printer was listed three times – and guess: The network printers are also shown three times.
office_printer_duplicated_05

So I removed the doubled entries and only kept the first Universal Printer. Moreover I removed empty lines at the end of the list.
office_printer_duplicated_06

After removing the entries and restarting the Print Spooler (with the corresponding Citrix Service) the duplicate printers in Word were gone.

Citrix PVS Reverse Imaging with Windows Backup

During the last weeks I had different problems with the “known” Reverse-Imaging Technics. One of them was the after reverse Imaging a Windows 2012 R2 Server the Server Manager didn’t start any longer.
pvs_reverse_imaging_windows_backup_01

Faulting application name: ServerManager.exe, version: 6.3.9600.17238, time stamp: 0x53d0b3e7
Faulting module name: ntdll.dll, version: 6.3.9600.18233, time stamp: 0x56bb4ebb
Exception code: 0xc0000374
Fault offset: 0x00000000000f1b70
Faulting process id: 0x1214
Faulting application start time: 0x01d1de6cee400844
Faulting application path: E:\Windows\system32\ServerManager.exe
Faulting module path: E:\Windows\SYSTEM32\ntdll.dll
Report Id: 2c2107c1-4a60-11e6-80f6-0050568817e7
Faulting package full name:
Faulting package-relative application ID:

Another was that the Server Manager wasn’t able to refresh the Roles and Features. So I wasn’t able to see (or add) any installed Roles / Features.
pvs_reverse_imaging_windows_backup_02

I tried different options to fix the problems – e.g. dism – none of them worked.

Sometimes even the complete reverse imaging failed with the following error.

Failed to load registry key {_BCD_} on \Boot\BCD. The system cannot find the path specified. (0x00000003)
Volume to Volume stopped
Volume to Volume lasted  834,7 seconds
Failed to convert Boot Configuration Data. The system cannot find the path specified. (0x00000003)

Also it didn’t make a difference if I used the P2PVS Tool….
pvs_reverse_imaging_windows_backup_03

…or the old BNImage.
pvs_reverse_imaging_windows_backup_04
The errors were different – but the reversed image was not usable.

So I started to look for a different method and found one: The integrated Windows Backup.

Before you can start you need to extend (or add) a separate drive from your Master-VM so that a backup of the whole system drive fits on it. I just extended the Cache Disk. You can’t use the local system drive for the backup.
pvs_reverse_imaging_windows_backup_05

As you can see my Cache Disk has now 200GB – more than enough for a 100GB System drive.
pvs_reverse_imaging_windows_backup_06

The next step is to install Windows Server Backup Feature from the Server Manager.
pvs_reverse_imaging_windows_backup_07

Confirm the installation.
pvs_reverse_imaging_windows_backup_08

And Close the installation when it’s finished.
pvs_reverse_imaging_windows_backup_09

Now start the Windows Server Backup and select Local Backup on the left side. On the right side choose Backup Once.
pvs_reverse_imaging_windows_backup_10

You can now only select Different options.
pvs_reverse_imaging_windows_backup_11

In the next step it’s important to select Custom – otherwise you can’t exclude e.g. the Cache Drive.
pvs_reverse_imaging_windows_backup_12

Now you have to Add Items for the backup.
pvs_reverse_imaging_windows_backup_13

Select System state, System Reserved and Local disk (C:).
pvs_reverse_imaging_windows_backup_14

Your selection should now look like this:
pvs_reverse_imaging_windows_backup_15

As the Backup Destination pick the local drive (which you extended or added at the beginning).
pvs_reverse_imaging_windows_backup_17

A last check if everything is correct before you can start the Backup.
pvs_reverse_imaging_windows_backup_18

Windows is now creating the backup which will take some time (like reverse imaging…).
pvs_reverse_imaging_windows_backup_19

After the backup it is important to clean the local system disc (not the PVS one the system is booted from Winking smile)
pvs_reverse_imaging_windows_backup_20

You can try to just format it…
pvs_reverse_imaging_windows_backup_21
… but I sometimes had problems with just formatted disks. So I suggest to remove the current disk from the VM and attach a new one with the same size.

The next step is to boot the VM from a Windows-Installation-Iso (with the same OS you plan to reverse image). Select your Language/Time/Keyboard and continue.
pvs_reverse_imaging_windows_backup_22

Now don’t choose Install now instead click on Repair your computer.
pvs_reverse_imaging_windows_backup_23

Go to Troubleshoot…
pvs_reverse_imaging_windows_backup_24

… and select System Image Recovery.
pvs_reverse_imaging_windows_backup_25

The shown OS Version must match your installed OS.
pvs_reverse_imaging_windows_backup_26

The wizard now detects the backup on the local disc – only if you created multiple ones you need to Select a system image.
pvs_reverse_imaging_windows_backup_27

No changes needed here.
pvs_reverse_imaging_windows_backup_28

Start the Restore with Finish.
pvs_reverse_imaging_windows_backup_29

You need to confirm that the local disc will be formatted and the system is restored.
pvs_reverse_imaging_windows_backup_30

The restoring starts…
pvs_reverse_imaging_windows_backup_31

.. after a successful restore an automatic reboot follows. The VM will still boot from the PVS.
pvs_reverse_imaging_windows_backup_32

So open the properties of your Master-Target Device and select Boot from Hard Disk.
pvs_reverse_imaging_windows_backup_33

That’s it. After another reboot your VM can start from the local Hard-Drive.

Hope the article was helpful for some of you Smile

Removal of Citrix XenDesktop / XenApp 7.x VDA fails with InstallFailure 1603

Some of you might have seen the following problem – the removal of the VDA failed:
vda_removal_error_01

If you check the details you get some more information’s – e.g. the removal of the Citrix Profile Management failed.
vda_removal_error_02

Removal of MSI Product ‘profilemgt_x64.msi’ (‘{9321930C-A53F-452C-80D5-AE1A8D69D9C0}’) failed with code ‘InstallFailure’ (1603).

Or the VdaMonitorPlugin_x64.MSI cannot be removed.
vda_removal_error_03

Well – but there is no solution shown how to fix it nor you can find a documentation from Citrix to solve the problem. You can’t just start the removal from the Control Panel – they are not shown under Programs.

Luckily Microsoft has published a really helpful Tool that helps to remove “problematic” Applications. After downloading open the Tool and press Next.
vda_removal_error_04

Now select Uninstalling.
vda_removal_error_05

You now get a much bigger list (compared to the one under Programs) – here you can see all Programs and their “Sub-Programs”. Now select your faulting part of the VDA – e.g. Citrix Profile Management.
vda_removal_error_06

Select Yes, try uninstall to start the removal.
vda_removal_error_07

The Tool now tries to remove the selected package….
vda_removal_error_08

… and resolves problems found during the removal.
vda_removal_error_09

After some time you should see the following dialog:
vda_removal_error_10
The problematic VDA-Component is now removed.

You can now restart the VDA removal like before – if another failing component is shown – just repeat the steps above.

Configuring a Nvidia Tesla M60 under Citrix XenServer (and assign a vGPU to a VM)

In this blog post I would like to show you how to configure a Nvidia Tesla M60 under a XenServer and deploy a VM with a vGPU assigned. There are a lot of good documentations from Nvidia for the different steps – but I didn’t find one complete for the whole process after putting the Tesla into the physical Server and installing XenServer.

In this post I will cover the following areas:
Installing the XenServer Nvidia vGPU Supplemental pack
Changing the Tesla M60 from Compute to Graphics Mode
Installing and Configuring the Nvidia Licensing Service
Configure a VM with a vGPU and assign a license

Installing the XenServer Nvidia vGPU Supplemental Pack

After the installation of the XenServer (I am not going to cover that here – there are enough other resources describing this) the necessary Nvidia supplemental pack is not available. You can see the installed packs in the XenCenter under the Server General Properties => Updates.
nvidia_tesla_m60_xen_01

To download the necessary package you need an Nvidia Portal Account. Interestingly at the moment there is no Register-Button on the Login-Page. You can register on this page. The problem only is that you require either a valid Key or a Demo-Key. It’s not possible to get one here. So you need to contact an Nvidia Sales Guy to get a Demo key. After registering and logging in you have the area Product Download available. Here you can download the necessary extensions for XenServer, ESX and so on. Download the package corresponding to your XenServer version (currently 6.2, 6.5 and 7).
nvidia_tesla_m60_xen_02
The download is a zip file containing different documentations, packs and applications. First of all you only need the following file:
NVIDIA-vGPU-xenserver-VERSION-NUMBER.x86_64.iso

To install the supplemental pack open the XenCenter and navigate to Tools => Install Update…
nvidia_tesla_m60_xen_03

Confirm the Starting guide with Next.
nvidia_tesla_m60_xen_04

Now you have to select the ISO file lower area Select update or supplemental pack from disk.
Important:
There are different supplemental packs for the different Nvidia vGPU cards available. One is for K1/K2 – the other for Tesla cards. The name of the package is different:
K1/K2: Contains the word Keplar
Tesla: without Keplar (see screenshot).
At the moment it is not supported to run cards of both types in the same server (thanks @Rachel Berry for the information).
Furthermore it is currently not possible to remove an installed pack – so if you have a Tesla card and accidentally installed the Keplar pack you have to reinstall your XenServer.
nvidia_tesla_m60_xen_05

After choosing the ISO select on which XenServers you would like to install the pack.
nvidia_tesla_m60_xen_06

The pack will be uploaded to the XenServer.
nvidia_tesla_m60_xen_07

After installing the updates some tasks have to be done (e.g. rebooting) – you can either let that happen automatically (from the XenCenter) or do that manual (like you know from every other update).
nvidia_tesla_m60_xen_08

The installation starts, VMs (if there are any) are migrated off the XenServer and it is rebooted (if you selected automatically before Winking smile).
nvidia_tesla_m60_xen_09

After the reboot the Maintenance mode is quite and some checks are done.
nvidia_tesla_m60_xen_10

If you now check the Updates section again you should see the NVIDIA vGPU package.
nvidia_tesla_m60_xen_11

Moreover you can run the following command on the console to check if the pack is correctly installed:

lsmod | grep nvidia

If everything is correct the output should look like this.
nvidia_tesla_m60_xen_13

When you now open the GPU area of the XenServer it might be possible that still no vGPU Profiles are shown on the right side – also the Tesla Card is correctly detected. The reason for this is that the Tesla card is often shipped in Compute mode and not in Graphics mode.
nvidia_tesla_m60_xen_14

Changing the Tesla M60 from Compute to Graphics Mode

To check in which mode the Tesla card is running open the XenCenter Console. Now enter the following command:

lspci -n | grep 10de

The red marked area shows the mode:
0302: Compute
0300: Graphics
nvidia_tesla_m60_xen_15

To switch the mode, you need an Utility from Nvidia. You can either Download this from the Product Download page (after logging in) or under the Nvidia support download for the Tesla cards.
nvidia_tesla_m60_xen_16

The downloaded Zip-Files contains the following files. There are different options how to change the GPU mode (e.g. install Linux) – to make it easy we will integrate the utility in the XenServer. Thus we only need the file gpumodeswitch.
Important: Not the file with the extension exe – the file without an extension (the first in the screenshot).
nvidia_tesla_m60_xen_17

To copy the file to your XenServer you need to start WinSCP. Select SFTP, enter the XenServer IP-Address as the Host name. Username is root with the same password you use in the XenCenter.
nvidia_tesla_m60_xen_18

Confirm the Warning.
nvidia_tesla_m60_xen_19

Now copy the gpumodeswitch file to a temporary folder (e.g. tmp) on the XenServer.
nvidia_tesla_m60_xen_20

Switch to the command line from the XenServer and navigate to the tmp folder. To show the current GPU mode enter the following command:

./gpumodeswitch –listgpumodes

But what’s that – the permission is denied.
nvidia_tesla_m60_xen_21

To allow the execution of the file you have to modify the file permission. Enter the following command:

chmod 700 gpumodeswitch

Now you should be able to execute the gpumodeswtich utility. After the execution you get another warning that first the NVIDIA kernel driver has to be unloaded.
nvidia_tesla_m60_xen_22

Before you can remove the driver first stop the xcp-rrdd-gpumon service:

service xcp-rrdd-gpumon stop

Now remove the unload the NVIDIA driver.

rmmod nvidia

nvidia_tesla_m60_xen_23

You can now change the graphics mode with this command:

./gpumodeswitch –gpumode graphics

The mode change needs to be confirmed with Y.
nvidia_tesla_m60_xen_24

The Tesla cards now receive the graphics mode firmware.
nvidia_tesla_m60_xen_25

After the update finished you can again check if the graphics mode is now active.

lspci –n | grep 10de

In the red marked area you now see a 300 for all Tesla cards – the Graphics mode is now active.
nvidia_tesla_m60_xen_26

If you switch to the GPU area from the XenServer the different vGPUs are shown.
nvidia_tesla_m60_xen_27

Installing and Configuring the Nvidia Licensing Service

The next step is to install and configure the Nvidia Licensing service. The necessary downloads are also available in the Nvidia portal under Product Download.

nvidia_tesla_m60_xen_28

The package contains a setup.exe and two documents. Start the installation with the setup.exe
nvidia_tesla_m60_xen_29

If you haven’t read the requirements you might have missed that the service requires a Java 32Bit installation.
nvidia_tesla_m60_xen_30

So first install Java….
nvidia_tesla_m60_xen_31

And then start the setup again.
nvidia_tesla_m60_xen_32

Accept the license agreement for the Nvidia software.
nvidia_tesla_m60_xen_33

And also accept the license for Apache – an Apache Tomcat is used for the license service.
nvidia_tesla_m60_xen_34

You can now change the installation path (if you like).
nvidia_tesla_m60_xen_35

The default setting is to configure the Windows Firewall to only allow connections to the license service itself – not to the management website. If you want to access the website not only from the license server itself (and the Windows Firewall is active) you need to activate the Management interface as well.
nvidia_tesla_m60_xen_36

A summary shows the installation path and the required disk space.
nvidia_tesla_m60_xen_37

The license service (including Apache Tomcat) is now installed.
nvidia_tesla_m60_xen_38

Finish the installation with Done.
nvidia_tesla_m60_xen_39

The first check is now if the tomcat is running. Open a browser on the server and open http://localhost:8080 – you should now see the Tomcat welcome page if everything is running correctly.
nvidia_tesla_m60_xen_40

To open the Nvidia license server enter http://localhost/8080/licserver
The first things shown are the Licensed Clients – of course there is no client shown until now because we didn’t configure a client or install a license.
nvidia_tesla_m60_xen_41

The licenses are managed under License Management. As you can see you need to upload a license file.
nvidia_tesla_m60_xen_42

To get the license file browse again to the Nvidia portal and switch do License History. Here you can see all of your licenses. Select the licenses you would like to assign.
nvidia_tesla_m60_xen_43

For assigning the licenses you need the MAC address of the license server.
nvidia_tesla_m60_xen_44

To get the MAC open a Command prompt or a Windows PowerShell on the licensing server. Enter the following command:

ipconfig /all

Search for the Ethernet-Connection you plan to use and note the Physical Address.
nvidia_tesla_m60_xen_45

Enter the Physical Address in the MAC address field (without any signs like “-“ or “:”). Add a free choose able Alias and Site Name.
nvidia_tesla_m60_xen_46

The server is now created – but no licenses are assigned. Choose Map Add-Ons to add a license.
nvidia_tesla_m60_xen_47

Press Search to view your current licenses. Enter the Qty to Add of the licenses you want to assign and press Map Add-Ons.
nvidia_tesla_m60_xen_48

Now the licenses are mapped to the server. Select Download License File to download the license BIN file.
nvidia_tesla_m60_xen_49

Put the downloaded BIN file on a folder on the license server.
nvidia_tesla_m60_xen_50

Now open again the license management console and go to License Management.
nvidia_tesla_m60_xen_51

Select the downloaded BIN file and press Upload.
nvidia_tesla_m60_xen_52

A sucessful upload is confirmed with Successfully applied license file to license server.
nvidia_tesla_m60_xen_53

Go to License Feature Usage to show the currently available licenses.
nvidia_tesla_m60_xen_54

Configure a VM with a vGPU and assign a license

The last configuration step is to assign a vGPU and install the Nvidia Drivers inside the VM.

Open the properties of a VM (I am not going to cover how to create a VM and install Windows on the VM) and switch to GPU.
Now you have to select the vGPU-Profile.
Depending on the profile you need a different license. The profiles are split into the following licenses:
A: Grid Virtual Applications
B: Grid Virtual PC
C: Grid Virtual Workstation

You can find a good comparison of the types in this blog post from Richard Hoffman.
nvidia_tesla_m60_xen_55

When you now start the VM and check the Device Manager you will still only see a Default VGA Graphics Card. To change that the necessary drivers need to be installed.
nvidia_tesla_m60_xen_56

Copy the ones for your OS to the VM.
nvidia_tesla_m60_xen_57

Start the setup and confirm the Windows UAC Message with yes.
nvidia_tesla_m60_xen_58

Select a folder to extract the driver files.
nvidia_tesla_m60_xen_59

Now the actual setup starts. Agree to the licenses,
nvidia_tesla_m60_xen_60

Either choose Express or Custom installation.
nvidia_tesla_m60_xen_61

There is no difference between the installation except that in a Custom installation you can see which components are installed and it’s possible to Perform a clean installation if you had problems with the currently installed driver.
nvidia_tesla_m60_xen_62

The installation starts.
nvidia_tesla_m60_xen_63

After the installation is finished a reboot is necessary.
nvidia_tesla_m60_xen_64

If you now open the Device Manager again and check the Graphics Card you will see a NVIDIA GRID card – here you can also see which vGPU-Type is assigned.
nvidia_tesla_m60_xen_65

The last step is to assign a license to the VM. Open the Control Panel and search for Nvidia.
nvidia_tesla_m60_xen_66

Open the Nvidia Control Panel.
nvidia_tesla_m60_xen_67

Now select License management. Here you can enter License Server FQDN and the configured Port (default: 7070).
nvidia_tesla_m60_xen_68

After entering the information’s press Apply to assign a license.
nvidia_tesla_m60_xen_69

If everything is working correctly the license is now applied.
nvidia_tesla_m60_xen_70

If you now open the License Server Management Interface again you will find the client under Licensed Clients.
nvidia_tesla_m60_xen_71

For each client you can also open get detailed information’s.
nvidia_tesla_m60_xen_72

That’s it. Now you can continue with everything else (e.g. Citrix XenDesktop HDX 3D Pro VDA). Hope the article helped some of you Smile

%d bloggers like this: