Tag Archives: Citrix

Citrix PVS server Dual IP issue in multiple DHCP servers with a split scope environment

Usually, when deploy PVS servers, we only use 1 DHCP scope. But for some large environment, we have to use multiple DHCP servers with a split scope if we can’t use Windows Server 2012.

Then it’s more likely to get the dual IP issue:

1. When VDI start, first, it contacted DHCP server to get the 1st IP address, then use this IP address to connect to PVS server to start to download the image and startthe VDI.
2. And when windows is up, windows DHCP client will request an IP address from DHCP server. In multiple DHCP environment, it may request IP address from a different DHCP server and got a different IP address..

Then we got below problem:
1. VDIs may have two IP address.
2. We run out IP address. You will find that lot’s IP address are marked as ‘bad addresses’
3. DNS record issue. Because some VDIs have two IP addresses, VDIs registered the wrong IP address to DNS server.

We spent lots of times with Citrix, and Citrix can’t provide a solution for this issue. They only suggest to use PVS server in single DHCP scope environment.

But finally, we found a solution to fix this issue by ourselves.

This issue was caused by that when windows is up, Citrix PVS Device Service will inject the IP address it got during PXEboot process into system. And if Citrix PVS Device Service starts before DHCP client service, then VDI will get 1 IP address. But if DHCP client start first, Citrix will still inject the IP address, and then VDI will get two IP addresses.

There are two ways to fix this issue.

1. Disable DHCP client in VDI. This option is not good, but it works. But please be aware that after you disable DHCP client service, the VDI may not be able to get DNS server from DHCP servers. Because Citrix only inject IP address/Netmask/Gateway information to windows.

2. Make “Citrix PVS Device Service” as a dependency service of DHCP client servers to make sure that DHCP service starts after Citrix inject the IP address.

Edit the reg key:
HKLMSystemCurrentControlSetServicesdhcpDependsOnService
Add "BNDevice" to the end of the list of dependent services.

Dual to Citrix can’t fix this issue, this is the only solution we found to fix this issue.
But if you are able to use windows server 2012, then go for windows server 2012 DHCP cluster maybe another choice.

Updating Database Connection Strings in XenDesktop 7.x

The scripts need powershell v3 at the moment (I may turn part of it into a module, and might be able to switch to powershell v2, but v3 is needed to load the core script into the other scripts.)

The scripts have been tested on Server 2012 R2, with XenDesktop 7.5 and XenDesktop 7.6. Note that this was as a full site admin and in local admin powershell window.

The provided scripts are:
DBConnectionStringFuncs.ps1 – this is the core script, and does the actual work. It contains common functions which the following scripts then use.
Change_XD_Failover_Partner_v1.ps1 – this is similar to the previous script I posted, and is used to update the failover partner.
Change_XD_To_ConnectionString.ps1 – this takes passed in connection strings and uses them, so a very generic version.
Change_XD_To_MultiSubnetFailover.ps1 – this toggles the addition and removal of MultiSubnetFailover=true. IE run it once and the option is added, run it again and the options is removed.
Change_XD_To_Null.ps1 – this is a reset of all the connection strings on the localhost as something has gone wrong. Note because this resets the connection strings to null, it will actually place the ddc into a “initial” state. IE if you run studio it’ll ask if you want to create a site, or join to another ddc. This is useful is something has gone wrong somewhere, and a reset is needed, as you can then attempt to set the connection strings again.

If you need to do some kind of connection string manipulation feel free to look at how the Change_XD scripts use the functions in DBConnectionStringFuncs.ps1.
XDConnectionStringScripts

Script used for enable XenDesktop Database Mirroring

Make sure that all DDCs are up and running, then run below PowerShell Script.

$cs = 'Data Source=DB1; Failover Partner=DB2; Initial Catalog=XenDesktopDB; Integrated Security=True; Network=dbmssocn’


$controllers = Get-BrokerController | %{$_.DNSName}
foreach ($controller in $controllers) {
    Write-Host "Disconnect controller $controller ..."
    Set-ConfigDBConnection –DBConnection $null –AdminAddress $controller
    Set-HypDBConnection –DBConnection $null –AdminAddress $controller
    Set-AcctDBConnection –DBConnection $null –AdminAddress $controller
    Set-ProvDBConnection –DBConnection $null –AdminAddress $controller
    Set-PvsVmDBConnection –DBConnection $null –AdminAddress $controller
    Set-BrokerDBConnection –DBConnection $null –AdminAddress $controller
} 



    Set-ConfigDBConnection –DBConnection $cs –AdminAddress $controller
    Set-HypDBConnection –DBConnection $cs –AdminAddress $controller
    Set-AcctDBConnection –DBConnection $cs –AdminAddress  $controller
    Set-ProvDBConnection –DBConnection $cs –AdminAddress $controller
    Set-PvsVmDBConnection –DBConnection $cs –AdminAddress $controller
    Set-BrokerDBConnection –DBConnection $cs –AdminAddress $controller

Netscaler VPX license

When I tried to install certificate to netscaler vpx, I got below error message:

Certificate with key size greater than RSA512 or DSA512 bits not supported

After investigate, I found that this problem is caused by Netscaler License. You need to install at least 3 licenses to Netscaler to support it’s functions

1) Netscaler Platform licence: this enables netscaler features, but more importantly, unlocks the higher grades of encryption. License issued against Host-ID (= mac addr)
2) Netscaler Gateway platform licences / ICA licenses: this licence gives you up "unlimited" basic mode (ie ICA-only) connections. License issued against Hostname
3) Universal licenses: paid for licenses (you get free ones with XD platinum / NS platinum) which allow use of smart-access mode (=vpn, clientless, or ICA with epa). License issued against Hostname.

Citrix NetScaler 10.x java applet hangs while starting

For Citrix Netscaler 10, we may get some issues that we can’t start JAVA application. So we can’t config Citrix Netscaler.

So here’s the fix!

Open up the Windows Control Panel and start the Java Control panel.

Now go to General -> Temporary Internet Files -> Settings and Unselect Keep temporary files on my computer.

Now go to General -> Advanced and configure the following options
“Mixed code (sandboxed vs trusted) security verification” = “Disable verification”
“Perform certificate revocation checks on” = “Do not check”

The lastest version of Citrix NetScaler has fixed this problem!

Disable virtual printers mapping in Citrix

To disable the virtual printer mapping in Citrix, you need to deploy a Citrix user policy to disable the drivers of the virtual printers.
The policy is based on the driver name. So you need to make sure that the driver name is correct.
Here are the drivers.

Microsoft Office Document Image Writer Driver
Microsoft XPS Document Writer
Microsoft XPS Document Writer v4
Send To Microsoft OneNote Driver
Send To Microsoft OneNote 2010 Driver
Send to Microsoft OneNote 15 Driver
Microsoft Office Live Meeting 2007 Document Writer Driver