<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://thedaniel.eu/feed.xml" rel="self" type="application/atom+xml" /><link href="https://thedaniel.eu/" rel="alternate" type="text/html" hreflang="en" /><updated>2026-05-26T09:19:05+00:00</updated><id>https://thedaniel.eu/feed.xml</id><title type="html">theDaniel</title><subtitle>Expert Citrix consultant sharing automation guides, CVAD tutorials, and EUC solutions. Specializing in Citrix Virtual Apps &amp; Desktops, PowerShell automation, and enterprise virtualization.
</subtitle><author><name>Daniel Madsen</name><email>danielmadsen1983@gmail.com</email></author><entry><title type="html">Automate Citrix Provisioning Services (PVS) with PowerShell - CVAD Automation Part 2</title><link href="https://thedaniel.eu/posts/2024-11-06-automate-CVAD-part-two/" rel="alternate" type="text/html" title="Automate Citrix Provisioning Services (PVS) with PowerShell - CVAD Automation Part 2" /><published>2024-11-06T00:00:00+00:00</published><updated>2026-05-26T09:17:54+00:00</updated><id>https://thedaniel.eu/posts/automate-CVAD-part-two</id><content type="html" xml:base="https://thedaniel.eu/posts/2024-11-06-automate-CVAD-part-two/"><![CDATA[<ul class="large-only" id="markdown-toc">
  <li><a href="#prerequisites-for-all-installations-in-this-series" id="markdown-toc-prerequisites-for-all-installations-in-this-series">Prerequisites for all installations in this series</a>    <ul>
      <li><a href="#prerequisites-for-this-post" id="markdown-toc-prerequisites-for-this-post">Prerequisites for this post</a></li>
    </ul>
  </li>
  <li><a href="#editing-configurationvariablejson-and-configwizard_xxxans-answer-files" id="markdown-toc-editing-configurationvariablejson-and-configwizard_xxxans-answer-files">Editing ConfigurationVariable.json and ConfigWizard_xxx.ans answer files</a></li>
  <li><a href="#component-installations" id="markdown-toc-component-installations">Component installations</a>    <ul>
      <li><a href="#pvs-prerequisites" id="markdown-toc-pvs-prerequisites">PVS Prerequisites</a></li>
      <li><a href="#pvs-installation" id="markdown-toc-pvs-installation">PVS Installation</a></li>
      <li><a href="#pvs-configuration" id="markdown-toc-pvs-configuration">PVS Configuration</a></li>
    </ul>
  </li>
</ul>

<p>This is second part of “Project Automate CVAD”. And I would very much recommend to read <a href="/posts/2024-08-24-automate-CVAD-part-one">Part one</a>.<br />
In this post, we take a look at the Citrix Provisioning Services part.</p>

<p>In case PVS is the only thing needed for automation, here’s a short list of prerequisites.</p>

<h2 id="prerequisites-for-all-installations-in-this-series">Prerequisites for all installations in this series</h2>

<ul>
  <li>All scripts are written for Citrix CVAD LTSR 2402 and Microsoft Windows Server 2022.</li>
  <li>The user used for script execution, needs temporary sysadmin on SQL server</li>
  <li>The user used for script execution, needs local administrator on every server</li>
  <li>All servers needs to have Windows Server 2022 installed, domain joined and updated with latest Windows Updates</li>
  <li>Create a share to host all scriptfiles</li>
  <li>Execution command: Powershell.exe -executionpolicy Bypass -File .\Component\xxx.ps1 -force</li>
  <li>Restart all servers</li>
</ul>

<h3 id="prerequisites-for-this-post">Prerequisites for this post</h3>

<ul>
  <li>Download Citrix installation media from <a href="https://www.citrix.com/downloads/citrix-virtual-apps-and-desktops/product-software/citrix-virtual-apps-and-desktops-alleditions-2402.html">Citrix Download CVAD 2402</a><br />
Extract installationfiles from ISO to $InstallShare\XenDesktop</li>
  <li>Download latest <a href="https://developer.microsoft.com/en-gb/microsoft-edge/webview2?ch=1&amp;form=MA13LH#download-section">Microsoft Edge WebView2 Runtime</a><br />
Move installer to $InstallShare\Prerequisites</li>
  <li>Download ConfigurationVariable.json and all scriptfiles from <a href="https://github.com/TheDanielEU/project-automate-cvad-installation">TheDanielEU Github</a><br />
Move files to the share created earlier</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>├── PVS
│   ├── AddSecodaryPVS.ps1
│   ├── ConfigurePVS.ps1
│   ├── ConfigWizard_Primary.ans
│   ├── ConfigWizard_Secondary.ans
│   ├── InstallPrerequisites.ps1
│   └── InstallPVS.ps1
└── ConfigurationVariable.json
</code></pre></div></div>

<h2 id="editing-configurationvariablejson-and-configwizard_xxxans-answer-files">Editing ConfigurationVariable.json and ConfigWizard_xxx.ans answer files</h2>

<p>As in the first part of this series, you will need to customize the <code class="language-plaintext highlighter-rouge">ConfigurationVariable.json</code> file to match your specific environment.<br />
To configure PVS, answerfiles are needed. They need to be customized aswell.</p>

<p>Let’s take a closer look at <code class="language-plaintext highlighter-rouge">ConfigurationVariable.json</code>.</p>
<blockquote>
  <p>If PVS is the only component needed, then copy json code below, and create a <code class="language-plaintext highlighter-rouge">ConfigurationVariable.json</code>. Keep in mind, the linenumbers below, will be incorrect.</p>
</blockquote>

<p>Lines 3 to 25 are static and do not need to be changed. Lines 3 to 13 are installer names, and lines 16 to 25 are the parameters. They can, of course, be changed if needed.
Line 28 - 31 needs to changed, to fit your environment.<br />
JSON interprets backslashes as escape characters. So for a UNC path to work, four backslashes are needed, with two backslashes to seperate each folder.<br />
Line 60 - 64 pretty much speaks for it self, and needs to be changed.<br />
Line 65 and 66 are being used in <code class="language-plaintext highlighter-rouge">ConfigurePVS.ps1</code> line 47 and 52, and is a path and name specification, to create a .sql file. The path needs to be local, like C:\<br />
Line 68 is a UNC to C$ on the SQL Server. This is used <code class="language-plaintext highlighter-rouge">ConfigurePVS.ps1</code> line 52.<br />
If changed from <code class="language-plaintext highlighter-rouge">\\FQDNSQLServer.local\C$</code>, edit line 53 in <code class="language-plaintext highlighter-rouge">ConfigurePVS.ps1</code> ScriptBlock { sqlcmd -S -i ‘C:\DBScript.sql’ }, to the value.</p>
<blockquote>
  <p>sqlcmd does not work with UNC paths, which is why the .sql file needs to be copied to SQLServer.</p>
</blockquote>

<p>Line 69 and 70 doesn’t need to be edited, if commands seen later in the post, is being used.<br />
Line 73 is the Passphrase for PVS. Remember it’s in cleartext. Remove it from json afterwards.<br />
Line 74 is the local path, where vDisks are being placed.</p>

<p><code class="language-plaintext highlighter-rouge">ConfigurationVariable.json</code></p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
    </span><span class="nl">"AppInstallers"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="nl">"packagenameRedist_x64"</span><span class="p">:</span><span class="w"> </span><span class="s2">"VC_redist.x64"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"packagenameRedist_x86"</span><span class="p">:</span><span class="w"> </span><span class="s2">"VC_redist.x86"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"packagenamemsOLEdbDriver"</span><span class="p">:</span><span class="w"> </span><span class="s2">"msoledbsql"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"packagenamemsEDGEwebvwr2"</span><span class="p">:</span><span class="w"> </span><span class="s2">"MicrosoftEdgeWebView2RuntimeInstallerX64"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"packagenameCDF_x64"</span><span class="p">:</span><span class="w"> </span><span class="s2">"cdf_x64"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"packagenameTelemetry"</span><span class="p">:</span><span class="w"> </span><span class="s2">"TelemetryServiceInstaller_x64"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"packagenameCitrixPoshSDK"</span><span class="p">:</span><span class="w"> </span><span class="s2">"CitrixPoshSdk"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"packagenamePVSConsole"</span><span class="p">:</span><span class="w"> </span><span class="s2">"PVS_Console_x64"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"packagenamePVSServer"</span><span class="p">:</span><span class="w"> </span><span class="s2">"PVS_Server_x64"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"packagenamePVSTargetDevice"</span><span class="p">:</span><span class="w"> </span><span class="s2">"PVS_Device_x64"</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="nl">"UnattendedArguments"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="nl">"unattendedargsEXE"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/s /v</span><span class="se">\"</span><span class="s2">/qn</span><span class="se">\"</span><span class="s2">"</span><span class="w"> </span><span class="p">,</span><span class="w">
        </span><span class="nl">"unattendedargsmsOLEdbDriver"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/qb ADDLOCAL=ALL IACCEPTMSOLEDBSQLLICENSETERMS=YES"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"unattendedargsmsEDGEwebvwr2"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/silent /install"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"unattendedargsCDF_x64"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/qb"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"unattendedargsTelemetry"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/qb"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"unattendedargsCitrixPoshSDK"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/silent"</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="nl">"Common"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="nl">"DomainName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"domain.local"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DomainDN"</span><span class="p">:</span><span class="w"> </span><span class="s2">"DOMAIN"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"InstallShare"</span><span class="p">:</span><span class="w"> </span><span class="s2">"</span><span class="se">\\\\</span><span class="s2">FQDN</span><span class="se">\\</span><span class="s2">TO</span><span class="se">\\</span><span class="s2">INSTALLSHARE"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DeliveryControllers"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"DDC#1"</span><span class="p">,</span><span class="s2">"DDC#2"</span><span class="p">]</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="nl">"PVS"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="nl">"PVSAdminGroup"</span><span class="p">:</span><span class="w"> </span><span class="s2">"domain.local</span><span class="se">\\</span><span class="s2">PVSAdminGroup"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"PVSDBName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"PVSDBName"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"PVSSiteName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"PVSSiteName"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"PVSFarmName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"PVSFarmName"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"PVSCollectionName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"PVSDeviceCollectionName"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DBScriptFilePath"</span><span class="p">:</span><span class="w"> </span><span class="s2">"C:</span><span class="se">\\</span><span class="s2">"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DBScriptFile"</span><span class="p">:</span><span class="w"> </span><span class="s2">"DBScript.sql"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SQLServerName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"PVSServerName"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SQLDBScriptRemotePath"</span><span class="p">:</span><span class="w"> </span><span class="s2">"</span><span class="se">\\\\</span><span class="s2">FQDNSQLServer</span><span class="se">\\</span><span class="s2">C$"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"PVSConfigWizardPrimaryFile"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Z:</span><span class="se">\\</span><span class="s2">PVS</span><span class="se">\\</span><span class="s2">ConfigWizard_Primary.ans"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"PVSConfigWizardSecondaryFile"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Z:</span><span class="se">\\</span><span class="s2">PVS</span><span class="se">\\</span><span class="s2">ConfigWizard_Secondary.ans"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"PVSConfigWizardPath"</span><span class="p">:</span><span class="w"> </span><span class="s2">"C:</span><span class="se">\\</span><span class="s2">ProgramData</span><span class="se">\\</span><span class="s2">Citrix</span><span class="se">\\</span><span class="s2">Provisioning Services</span><span class="se">\\</span><span class="s2">"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"PVSConfigWizardLog"</span><span class="p">:</span><span class="w"> </span><span class="s2">"$Env:SystemRoot</span><span class="se">\\</span><span class="s2">Temp</span><span class="se">\\</span><span class="s2">ConfigWizard.log"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"PVSPassphrase"</span><span class="p">:</span><span class="w"> </span><span class="s2">"PVSPassphrase"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"vDisk"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Local_path_to_vDisks"</span><span class="w">
    </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>The answer files are used to configure PVS and are being copied to each of the PVS Servers, path: C:\ProgramData\Citrix\Provisioning Services<br />
If the files are not placed in this location, ConfigWizard.exe fails the configuration.<br />
ConfigWizard_Primary and ConfigWizard_Secondary is close to being the same, except for line 13. I’ve tried changing value from “Store” to whatever, but everytime the configuration fails. So I kept the default name “Store” and everything works.<br />
Lines that needs to be edited: 2, 11, 12, 14, 16, 20, 21, 23 and 25.<br />
I’ve tried naming the values, so it pretty much speaks for itself.</p>

<p><code class="language-plaintext highlighter-rouge">ConfigWizard_Primary.ans</code></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">FarmConfiguration</span><span class="o">=</span>2
<span class="nv">DatabaseServer</span><span class="o">=</span>servername.fqdn.local
<span class="nv">DatabaseInstance</span><span class="o">=</span>
<span class="nv">MultiSubnetFailover</span><span class="o">=</span>0
<span class="nv">DatabaseAuthenticationMode</span><span class="o">=</span>ActiveDirectoryIntegrated
<span class="nv">DatabaseUsername</span><span class="o">=</span>
<span class="nv">DatabaseUsername2</span><span class="o">=</span>
<span class="nv">DatabaseAdminAuthenticationMode</span><span class="o">=</span>ActiveDirectoryIntegrated
<span class="nv">DatabaseAdminUsername</span><span class="o">=</span>
<span class="nv">DatabaseAdminUsername2</span><span class="o">=</span>
<span class="nv">FarmExisting</span><span class="o">=</span>FarmNameFromJson
<span class="nv">ExistingSite</span><span class="o">=</span>SiteNameFromJson
<span class="nv">Store</span><span class="o">=</span>Store
<span class="nv">DefaultPath</span><span class="o">=</span>LocalPathToVdisk
<span class="nv">JoinFarm</span><span class="o">=</span>None
<span class="nv">LicenseServer</span><span class="o">=</span>licenserver.fqdn.local
<span class="nv">LicenseServerPort</span><span class="o">=</span>27000
<span class="nv">LicenseTradeup</span><span class="o">=</span>0
<span class="nv">LicenseSKU</span><span class="o">=</span>0
<span class="nv">UserName</span><span class="o">=</span>domainname.local<span class="se">\s</span>erviceaccountname
<span class="nv">UserPass</span><span class="o">=</span>EnterSamePasswordAsPassphraseFromJson
<span class="nv">PasswordManagementInterval</span><span class="o">=</span>7
<span class="nv">StreamNetworkAdapterIP</span><span class="o">=</span>IPAddressOfPVSServer
<span class="nv">StreamNetworkAdapterIPv6</span><span class="o">=</span>
<span class="nv">ManagementNetworkAdapterIP</span><span class="o">=</span>IPAddressOfPVSServer
<span class="nv">IpcPortBase</span><span class="o">=</span>6890
<span class="nv">IpcPortCount</span><span class="o">=</span>20
<span class="nv">SoapPort</span><span class="o">=</span>54321
</code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">ConfigWizard_Secondary.ans</code></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">FarmConfiguration</span><span class="o">=</span>2
<span class="nv">DatabaseServer</span><span class="o">=</span>servername.fqdn.local
<span class="nv">DatabaseInstance</span><span class="o">=</span>
<span class="nv">MultiSubnetFailover</span><span class="o">=</span>0
<span class="nv">DatabaseAuthenticationMode</span><span class="o">=</span>ActiveDirectoryIntegrated
<span class="nv">DatabaseUsername</span><span class="o">=</span>
<span class="nv">DatabaseUsername2</span><span class="o">=</span>
<span class="nv">DatabaseAdminAuthenticationMode</span><span class="o">=</span>ActiveDirectoryIntegrated
<span class="nv">DatabaseAdminUsername</span><span class="o">=</span>
<span class="nv">DatabaseAdminUsername2</span><span class="o">=</span>
<span class="nv">FarmExisting</span><span class="o">=</span>FarmNameFromJson
<span class="nv">ExistingSite</span><span class="o">=</span>SiteNameFromJson
<span class="nv">ExistingStore</span><span class="o">=</span>Store
<span class="nv">DefaultPath</span><span class="o">=</span>LocalPathToVdisk
<span class="nv">JoinFarm</span><span class="o">=</span>None
<span class="nv">LicenseServer</span><span class="o">=</span>licenserver.fqdn.local
<span class="nv">LicenseServerPort</span><span class="o">=</span>27000
<span class="nv">LicenseTradeup</span><span class="o">=</span>0
<span class="nv">LicenseSKU</span><span class="o">=</span>0
<span class="nv">UserName</span><span class="o">=</span>domainname.local<span class="se">\s</span>erviceaccountname
<span class="nv">UserPass</span><span class="o">=</span>EnterSamePasswordAsPassphraseFromJson
<span class="nv">PasswordManagementInterval</span><span class="o">=</span>7
<span class="nv">StreamNetworkAdapterIP</span><span class="o">=</span>IPAddressOfPVSServer
<span class="nv">StreamNetworkAdapterIPv6</span><span class="o">=</span>
<span class="nv">ManagementNetworkAdapterIP</span><span class="o">=</span>IPAddressOfPVSServer
<span class="nv">IpcPortBase</span><span class="o">=</span>6890
<span class="nv">IpcPortCount</span><span class="o">=</span>20
<span class="nv">SoapPort</span><span class="o">=</span>54321
</code></pre></div></div>

<h2 id="component-installations">Component installations</h2>

<p>After each successful installation, a Restart-Computer is forced.</p>

<h3 id="pvs-prerequisites">PVS Prerequisites</h3>

<p>Logon to both PVS servers<br />
Start Powershell as an administrator and execute:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">net</span><span class="w"> </span><span class="nx">use</span><span class="w"> </span><span class="nx">Z:</span><span class="w"> </span><span class="nx">\\servername.domain.local\InstallScripts</span><span class="w">
</span><span class="n">Z:</span><span class="w">
</span><span class="nx">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\PVS\InstallPrerequisites.ps1</span><span class="w">
</span></code></pre></div></div>

<h3 id="pvs-installation">PVS Installation</h3>

<p>Logon to both PVS servers<br />
Start Powershell as an administrator and execute:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">net</span><span class="w"> </span><span class="nx">use</span><span class="w"> </span><span class="nx">Z:</span><span class="w"> </span><span class="nx">\\servername.domain.local\InstallScripts</span><span class="w">
</span><span class="n">Z:</span><span class="w">
</span><span class="nx">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\PVS\InstallPVS.ps1</span><span class="w">
</span></code></pre></div></div>

<h3 id="pvs-configuration">PVS Configuration</h3>

<p>Logon to the primary PVS server<br />
This creates the SQL script file, creates DB on SQL server and configures PVS site.</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">net</span><span class="w"> </span><span class="nx">use</span><span class="w"> </span><span class="nx">Z:</span><span class="w"> </span><span class="nx">\\servername.domain.local\InstallScripts</span><span class="w">
</span><span class="n">Z:</span><span class="w">
</span><span class="nx">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\PVS\ConfigurePVS.ps1</span><span class="w">
</span></code></pre></div></div>

<p>Logon to the secondary PVS server<br />
This will add a secondary PVS server to the site</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">net</span><span class="w"> </span><span class="nx">use</span><span class="w"> </span><span class="nx">Z:</span><span class="w"> </span><span class="nx">\\servername.domain.local\InstallScripts</span><span class="w">
</span><span class="n">Z:</span><span class="w">
</span><span class="nx">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\PVS\AddSecondaryPVS.ps1</span><span class="w">
</span></code></pre></div></div>]]></content><author><name>Daniel Madsen</name><email>danielmadsen1983@gmail.com</email></author><category term="posts" /><category term="Citrix" /><category term="CVAD" /><category term="PowerShell" /><category term="Automation" /><category term="PVS" /><category term="LTSR" /><category term="Windows Server" /><summary type="html"><![CDATA[PowerShell automation guide for Citrix Provisioning Services (PVS) installation as part of the CVAD 2402 automation series. Covers prerequisites, downloads, and unattended PVS configuration.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://thedaniel.eu/assets/img/blog/project-automate-cvad.jpg" /><media:content medium="image" url="https://thedaniel.eu/assets/img/blog/project-automate-cvad.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Automate Citrix CVAD Installation with PowerShell - Complete Guide Part 1</title><link href="https://thedaniel.eu/posts/2024-08-24-automate-CVAD-part-one/" rel="alternate" type="text/html" title="Automate Citrix CVAD Installation with PowerShell - Complete Guide Part 1" /><published>2024-08-24T00:00:00+00:00</published><updated>2025-08-19T10:45:53+00:00</updated><id>https://thedaniel.eu/posts/automate-CVAD-part-one</id><content type="html" xml:base="https://thedaniel.eu/posts/2024-08-24-automate-CVAD-part-one/"><![CDATA[<ul class="large-only" id="markdown-toc">
  <li><a href="#prerequisites-for-all-installations-in-this-series" id="markdown-toc-prerequisites-for-all-installations-in-this-series">Prerequisites for all installations in this series</a>    <ul>
      <li><a href="#prerequisites-for-this-post" id="markdown-toc-prerequisites-for-this-post">Prerequisites for this post</a></li>
    </ul>
  </li>
  <li><a href="#editing-configurationvariablejson" id="markdown-toc-editing-configurationvariablejson">Editing ConfigurationVariable.json</a></li>
  <li><a href="#component-installations" id="markdown-toc-component-installations">Component installations</a>    <ul>
      <li><a href="#license-server" id="markdown-toc-license-server">License Server</a></li>
      <li><a href="#delivery-controllers" id="markdown-toc-delivery-controllers">Delivery Controllers</a>        <ul>
          <li><a href="#delivery-controller-1" id="markdown-toc-delivery-controller-1">Delivery Controller #1</a></li>
          <li><a href="#delivery-controller-2-if-applicable" id="markdown-toc-delivery-controller-2-if-applicable">Delivery Controller #2, if applicable</a></li>
        </ul>
      </li>
      <li><a href="#director-if-appliable" id="markdown-toc-director-if-appliable">Director, if appliable</a></li>
      <li><a href="#single-server-installation" id="markdown-toc-single-server-installation">Single server installation</a></li>
    </ul>
  </li>
  <li><a href="#db-creation-site-config" id="markdown-toc-db-creation-site-config">DB creation, site config</a>    <ul>
      <li><a href="#add-secondary-delivery-controller-to-site" id="markdown-toc-add-secondary-delivery-controller-to-site">Add secondary Delivery Controller to site</a></li>
    </ul>
  </li>
</ul>

<p>Every Citrix consultant I’ve worked with, talked to, danced with(maybe not), has always(maybe not always, but close to) wanted a automated installation of a Citrix backend. The amount of time spent, watching spinning wheels of doom, spinning and spinning. NO MORE, I say!<br />
So in a very Hashicorpified world, where everyone talks about Terraform this, Terraform that. These scripts have been written in Powershell. Now is the time to watch a blue background and a bunch of letters!<br />
Oh and yes, documentation of each scripts … CoPilot</p>

<p>Without further ado. Let’s dive into it.</p>

<h2 id="prerequisites-for-all-installations-in-this-series">Prerequisites for all installations in this series</h2>

<ul>
  <li>All scripts are written for Citrix CVAD LTSR 2402 and Microsoft Windows Server 2022.</li>
  <li>The user used for script execution, needs temporary sysadmin on SQL server</li>
  <li>The user used for script execution, needs local administrator on every server</li>
  <li>All servers needs to have Windows Server 2022 installed, domain joined and updated with latest Windows Updates</li>
  <li>Create a share to host all scriptfiles</li>
  <li>Execution command: Powershell.exe -executionpolicy Bypass -File .\Component\xxx.ps1 -force</li>
  <li>Restart all servers</li>
</ul>

<h3 id="prerequisites-for-this-post">Prerequisites for this post</h3>

<ul>
  <li>Download Citrix installation media from <a href="https://www.citrix.com/downloads/citrix-virtual-apps-and-desktops/product-software/citrix-virtual-apps-and-desktops-alleditions-2402.html">Citrix Download CVAD 2402</a><br />
Extract installationfiles from ISO to $InstallShare\XenDesktop</li>
  <li>Download latest <a href="https://developer.microsoft.com/en-gb/microsoft-edge/webview2?ch=1&amp;form=MA13LH#download-section">Microsoft Edge WebView2 Runtime</a><br />
Move installer to $InstallShare\Prerequisites</li>
  <li>Download ConfigurationVariable.json and all scriptfiles from <a href="https://github.com/TheDanielEU/project-automate-cvad-installation/">TheDanielEU Github</a><br />
Move files to the share created earlier</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>├── XenDesktop
│   ├── AddadminToCVADsite.ps1
│   ├── ConfigureDirector.ps1
│   ├── ConfigureXenDesktop.ps1
│   ├── InstallDDC01.ps1
│   ├── InstallDDC02.ps1
│   ├── InstallDirector.ps1
│   ├── InstallLicenseServer.ps1
│   └── JoinDDC02toSite.ps1
└── ConfigurationVariable.json
</code></pre></div></div>

<h2 id="editing-configurationvariablejson">Editing ConfigurationVariable.json</h2>

<p>The json file holds all the variables used across the different scripts. It’s possible to state almost everything in a json and import to different files.<br />
In this case, we are importing variables to unattended installation, site configuration and so on.<br />
It’s a simple cmdlet to import the json, which is used in every script:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ConVarJson</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Get-Content</span><span class="w"> </span><span class="nt">-Raw</span><span class="w"> </span><span class="o">.</span><span class="nx">\ConfigurationVariables.json</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">ConvertFrom-Json</span><span class="w">
</span></code></pre></div></div>

<p>Line 3 is the name of the installer, we are going to use across all installations
Line 16 - 25 is static, and doesn’t need to edited, since it’s the default for installing the different components.<br />
Line 28 and 29 needs to edited, to fit your setup.<br />
JSON interprets backslashes as escape characters. So for a UNC path to work, four backslashes are needed, with two backslashes to seperate each folder.<br />
So edit line 30, to fit your setup.<br />
It’s the same with line 38. DomainName and serviceaccount, needs to be seperated by two backslashes.<br />
Since this is provided As-Is and a very basic setup, line 39 will be written in cleartext. So remember to remove it afterwards.</p>

<p>Different site admins have been preconfigured, you just need to those groups to line 48 - 51.</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
    </span><span class="nl">"AppInstallers"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="nl">"packagenameXenDesktop"</span><span class="p">:</span><span class="w"> </span><span class="s2">"XenDesktopServerSetup"</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="nl">"UnattendedArguments"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="nl">"unattendedargsDirector"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/components DESKTOPDIRECTOR /passive /noreboot /configure_firewall"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"unattendedargsLicenseServer"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/xenapp /components LICENSESERVER /passive /noreboot /nosql /configure_firewall"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"unattendedargsConStudio"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/xenapp /components CONTROLLER,DESKTOPSTUDIO /passive /disableexperiencemetrics /noreboot /nosql /configure_firewall"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"unattendedargsConStudioLicDir"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/xenapp /components CONTROLLER,DESKTOPSTUDIO,LICENSESERVER,DESKTOPDIRECTOR /passive /noreboot /nosql /configure_firewall"</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="nl">"Common"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="nl">"DomainName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"domain.local"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DomainDN"</span><span class="p">:</span><span class="w"> </span><span class="s2">"DOMAIN"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"InstallShare"</span><span class="p">:</span><span class="w"> </span><span class="s2">"</span><span class="se">\\\\</span><span class="s2">FQDN</span><span class="se">\\</span><span class="s2">TO</span><span class="se">\\</span><span class="s2">INSTALLSHARE"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DeliveryControllers"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"DDC#1"</span><span class="p">,</span><span class="s2">"DDC#2"</span><span class="p">]</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="nl">"XenDesktop"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="nl">"DatabaseServer"</span><span class="p">:</span><span class="w"> </span><span class="s2">"FQDN_of_SQL_Server"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DatabaseName_Site"</span><span class="p">:</span><span class="w"> </span><span class="s2">"CitrixSite"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DatabaseName_Logging"</span><span class="p">:</span><span class="w"> </span><span class="s2">"CitrixLogging"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DatabaseName_Monitor"</span><span class="p">:</span><span class="w"> </span><span class="s2">"CitrixMonitor"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DatabaseUser"</span><span class="p">:</span><span class="w"> </span><span class="s2">"domain.local</span><span class="se">\\</span><span class="s2">serviceaccount"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DatabasePassword"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ServiceaccountPassword"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"XDSite"</span><span class="p">:</span><span class="w"> </span><span class="s2">"CitrixSiteName"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"LicenseServer"</span><span class="p">:</span><span class="w"> </span><span class="s2">"CitrixLicenseServer"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"LicenseServer_LicensingModel"</span><span class="p">:</span><span class="w"> </span><span class="s2">"LicenseModel e.g. UserDevice"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"LicenseServer_ProductCode"</span><span class="p">:</span><span class="w"> </span><span class="s2">"License Product Code e.g. XDT"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"LicenseServer_ProductEdition"</span><span class="p">:</span><span class="w"> </span><span class="s2">"License Edition e.g. PLT"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"LicenseServer_Port"</span><span class="p">:</span><span class="w"> </span><span class="s2">"LicenseServerPort e.g. 27000"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"LicenseServer_ProductVersion"</span><span class="p">:</span><span class="w"> </span><span class="s2">"License Product Version e.g. 7.41 for XenDesktop 2402"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"LicenseServer_AddressType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"LicenseServerAddressType e.g. WSL"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SiteAdminFullAdminGroup"</span><span class="p">:</span><span class="w"> </span><span class="s2">"domain.local</span><span class="se">\\</span><span class="s2">FullAdminGroup"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SiteAdminReadOnly"</span><span class="p">:</span><span class="w"> </span><span class="s2">"domain.local</span><span class="se">\\</span><span class="s2">ReadOnlyAdminGroup"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SiteAdminHelpDesk"</span><span class="p">:</span><span class="w"> </span><span class="s2">"domain.local</span><span class="se">\\</span><span class="s2">HelpDeskAdminGroup"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SiteAdminDeliveryGroup"</span><span class="p">:</span><span class="w"> </span><span class="s2">"domain.local</span><span class="se">\\</span><span class="s2">DeliveryGroupAdminGroup"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SiteScope"</span><span class="p">:</span><span class="w"> </span><span class="s2">"All"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SiteRoleFullAdmin"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Full Administrator"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SiteRoleReadOnlyAdmin"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Read Only Administrator"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SiteRoleHelpDeskAdmin"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Help Desk Administrator"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SiteRoleDeliveryGroupAdmin"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Delivery Group Administrator"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"SiteControllerAddress"</span><span class="p">:</span><span class="w"> </span><span class="s2">"FQDN of Controller #1"</span><span class="w">
    </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>With all the different variables set. Time for Powershell script execution.<br />
And to quote Wolverine “LETS FUCKING GO!!”</p>

<h2 id="component-installations">Component installations</h2>

<p>After each component installation, a Restart-Computer is forced.</p>

<h3 id="license-server">License Server</h3>

<p>Login to the server, which will be license server.<br />
Start Powershell as an administrator and execute:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">net</span><span class="w"> </span><span class="nx">use</span><span class="w"> </span><span class="nx">Z:</span><span class="w"> </span><span class="nx">\\servername.domain.local\InstallScripts</span><span class="w">
</span><span class="n">Z:</span><span class="w">
</span><span class="nx">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\XenDesktop\InstallLicenseServer.ps1</span><span class="w">
</span></code></pre></div></div>

<p>Logon the server again and import a license file.</p>

<h3 id="delivery-controllers">Delivery Controllers</h3>

<h4 id="delivery-controller-1">Delivery Controller #1</h4>

<p>Logon to the server, which will be delivery controller number one</p>

<p>Start Powershell as an administrator and execute:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">net</span><span class="w"> </span><span class="nx">use</span><span class="w"> </span><span class="nx">Z:</span><span class="w"> </span><span class="nx">\\servername.domain.local\InstallScripts</span><span class="w">
</span><span class="n">Z:</span><span class="w">
</span><span class="nx">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\XenDesktop\InstallDDC01.ps1</span><span class="w">
</span></code></pre></div></div>

<h4 id="delivery-controller-2-if-applicable">Delivery Controller #2, if applicable</h4>

<p>Login to the server, which will be delivery controller number two</p>

<p>Start Powershell as an administrator and execute:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">net</span><span class="w"> </span><span class="nx">use</span><span class="w"> </span><span class="nx">Z:</span><span class="w"> </span><span class="nx">\\servername.domain.local\InstallScripts</span><span class="w">
</span><span class="n">Z:</span><span class="w">
</span><span class="nx">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\XenDesktop\InstallDDC02.ps1</span><span class="w">
</span></code></pre></div></div>

<h3 id="director-if-appliable">Director, if appliable</h3>

<p>Login to the server, which will used for Director</p>

<p>Start Powershell as an administrator and execute:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">net</span><span class="w"> </span><span class="nx">use</span><span class="w"> </span><span class="nx">Z:</span><span class="w"> </span><span class="nx">\\servername.domain.local\InstallScripts</span><span class="w">
</span><span class="n">Z:</span><span class="w">
</span><span class="nx">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\XenDesktop\InstallDirector.ps1</span><span class="w">
</span></code></pre></div></div>

<h3 id="single-server-installation">Single server installation</h3>

<p>If all components is to be installed on a single server. The following needs configured:</p>

<p>Edit line 35 in .\XenDesktop\InstallDDC01.ps1<br />
From:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$UnattendedArgs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$ConVarJson</span><span class="o">.</span><span class="nf">UnattendedArguments</span><span class="o">.</span><span class="nf">unattendedargsConStudio</span><span class="w">
</span></code></pre></div></div>

<p>To:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$UnattendedArgs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$ConVarJson</span><span class="o">.</span><span class="nf">UnattendedArguments</span><span class="o">.</span><span class="nf">unattendedargsConStudioLicDir</span><span class="w">
</span></code></pre></div></div>

<p>That’s line 19 in ConfigurationVariable.json<br />
Login to the server
Start Powershell as an administrator and execute:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">net</span><span class="w"> </span><span class="nx">use</span><span class="w"> </span><span class="nx">Z:</span><span class="w"> </span><span class="nx">\\servername.domain.local\InstallScripts</span><span class="w">
</span><span class="n">Z:</span><span class="w">
</span><span class="nx">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\XenDesktop\InstallDDC01.ps1</span><span class="w">
</span></code></pre></div></div>

<h2 id="db-creation-site-config">DB creation, site config</h2>

<p>Now is the time to create a new Citrix site<br />
Login to Delivery Controller #1<br />
Start Powershell as an administrator and execute:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">net</span><span class="w"> </span><span class="nx">use</span><span class="w"> </span><span class="nx">Z:</span><span class="w"> </span><span class="nx">\\servername.domain.local\InstallScripts</span><span class="w">
</span><span class="n">Z:</span><span class="w">
</span><span class="nx">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\XenDesktop\ConfigureXenDesktop.ps1</span><span class="w">
</span><span class="n">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\XenDesktop\AddadminToCVADSite.ps1</span><span class="w">
</span></code></pre></div></div>

<p>This creates three DBs on SQL. Site, Monitoring and Logging.<br />
A site is created, with the license server from ConfigurationVariable.json. TrustXML is set to true.<br />
An AD group is added and set to Full Administrator on all scopes.<br />
If multiple admins needs to be configured. Add lines to AddadminToCVADSite.ps1, below line 39 e.g. if needing a Read Only admin:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$siteadminReadOnly</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$ConVarJson</span><span class="o">.</span><span class="nf">XenDesktop</span><span class="o">.</span><span class="nf">SiteAdmin_ReadOnly</span><span class="w">
</span><span class="nv">$siteroleReadOnly</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$ConVarJson</span><span class="o">.</span><span class="nf">XenDesktop</span><span class="o">.</span><span class="nf">SiteRoleReadOnlyAdmin</span><span class="w">
</span></code></pre></div></div>

<p>Add below line 47:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">New-AdminAdministrator</span><span class="w"> </span><span class="nt">-AdminAddress</span><span class="w"> </span><span class="nv">$</span><span class="nn">env</span><span class="p">:</span><span class="nv">COMPUTERNAME</span><span class="w"> </span><span class="nt">-Name</span><span class="w"> </span><span class="s2">"</span><span class="nv">$siteadminReadOnly</span><span class="s2">"</span><span class="w">
</span><span class="n">Add-AdminRight</span><span class="w"> </span><span class="nt">-Administrator</span><span class="w"> </span><span class="s2">"</span><span class="nv">$siteadminReadOnly</span><span class="s2">"</span><span class="w"> </span><span class="nt">-Role</span><span class="w"> </span><span class="s2">"</span><span class="nv">$siteroleReadOnly</span><span class="s2">"</span><span class="w"> </span><span class="nt">-Scope</span><span class="w"> </span><span class="s2">"</span><span class="nv">$siteScope</span><span class="s2">"</span><span class="w">
</span></code></pre></div></div>

<h3 id="add-secondary-delivery-controller-to-site">Add secondary Delivery Controller to site</h3>

<p>Log in to the secondary Delivery Controller and execute the following, from an elevated Powershell:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">net</span><span class="w"> </span><span class="nx">use</span><span class="w"> </span><span class="nx">Z:</span><span class="w"> </span><span class="nx">\\servername.domain.local\InstallScripts</span><span class="w">
</span><span class="n">Z:</span><span class="w">
</span><span class="nx">Powershell.exe</span><span class="w"> </span><span class="nt">-executionpolicy</span><span class="w"> </span><span class="nx">Bypass</span><span class="w"> </span><span class="nt">-File</span><span class="w"> </span><span class="o">.</span><span class="nx">\XenDesktop\joinDDC02toSite.ps1</span><span class="w">
</span></code></pre></div></div>

<p>That’s it for the first part of the series. Next part will be posted next month.
Thanks for reading. Feedback is always appreciated.</p>]]></content><author><name>Daniel Madsen</name><email>danielmadsen1983@gmail.com</email></author><category term="posts" /><category term="Citrix" /><category term="CVAD" /><category term="PowerShell" /><category term="Automation" /><category term="Installation" /><category term="LTSR" /><category term="Windows Server" /><summary type="html"><![CDATA[Complete PowerShell automation guide for Citrix Virtual Apps and Desktops (CVAD) 2402 installation. Learn to automate Delivery Controllers, License Server, and Director deployment with unattended scripts.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://thedaniel.eu/assets/img/blog/project-automate-cvad.jpg" /><media:content medium="image" url="https://thedaniel.eu/assets/img/blog/project-automate-cvad.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Imposter Syndrome, go fuck yourself!</title><link href="https://thedaniel.eu/posts/2024-05-16-imposter-go-fuck-yourself/" rel="alternate" type="text/html" title="Imposter Syndrome, go fuck yourself!" /><published>2024-05-16T00:00:00+00:00</published><updated>2026-05-26T09:17:54+00:00</updated><id>https://thedaniel.eu/posts/imposter-go-fuck-yourself</id><content type="html" xml:base="https://thedaniel.eu/posts/2024-05-16-imposter-go-fuck-yourself/"><![CDATA[<ul class="large-only" id="markdown-toc">
  <li><a href="#what-is-imposter-syndrome" id="markdown-toc-what-is-imposter-syndrome">what is “Imposter Syndrome”?</a></li>
  <li><a href="#therapy-and-a-lot-of-chocolate-later" id="markdown-toc-therapy-and-a-lot-of-chocolate-later">therapy and a lot of chocolate later</a></li>
  <li><a href="#citrix-technology-advocate" id="markdown-toc-citrix-technology-advocate">Citrix Technology Advocate</a></li>
  <li><a href="#dont-hold-back" id="markdown-toc-dont-hold-back">Don’t hold back</a></li>
</ul>

<h2 id="what-is-imposter-syndrome">what is “Imposter Syndrome”?</h2>

<p>A quick Google search gives this answer:<br />
the persistent inability to believe that one’s success is deserved or has been legitimately achieved as a result of one’s own efforts or skills.
“people suffering from impostor syndrome may be at increased risk of anxiety”</p>

<p>Well, I’m not experiencing anxiety, but I’m diffently experiencing every other aspect mentioned in that statement.<br />
Ever since I became a full time consultant, I’ve had that naggin’ feeling, that I wasn’t good enough to be part of this amasing group of people.<br />
Everytime I was appointed a task, I would say to myself “My colleagues would have fixed this by now. You fucking idiot. They’ll find out what a fraud you are.”, five minutes into the task.
At one point, it got so bad, that I was about to crash in my car, because my former teamlead wrote me a text, saying he needed to speak to me, when I got home. My head was spinning and I was sure that I didn’t had a job the next day. Complete chaos.</p>

<p>All he wanted, was to say what a great guy I was(am), and I was doing a fantastic job.</p>

<h2 id="therapy-and-a-lot-of-chocolate-later">therapy and a lot of chocolate later</h2>

<p>Later that evening, I talked with my girlfriend, who convinced me to talk to my teamlead.<br />
He was absolutely devastated, after I told him what had happend. He couldn’t believe it, because I was working with one of out biggest customers and handling them all by myself.<br />
“Oh hello I’m Imposter Syndrome. I tell you, you’re not good enough, so you have to work even harder to be noticed”.
He ensured me, that I was nowhere near about to lose my job. We arranged for theropy sessions, through the company medical insurance.<br />
10 therapy sessions later and a lot of talking with girlfriend, former boss and new boss, I can honestly say that I’ve changed my way of thinking. Imposter still pops up at times, but I’ve learned to cope with it.</p>

<h2 id="citrix-technology-advocate">Citrix Technology Advocate</h2>

<p>All of this culminated with becoming af member of the Citrix Technology Advocate program in 2024.<br />
This is a GIANT pat on the back(like if The Hulk slapped me on the back), for me personally.<br />
From here on, it’s a BIG BIG fuck you Imposter Syndrome.</p>

<h2 id="dont-hold-back">Don’t hold back</h2>

<p>If you read this, and feel some form of resemblance, of what I’ve been writing about. Don’t hold back. Write and I’ll try and help as best as I can.<br />
No one should experience this!</p>]]></content><author><name>Daniel Madsen</name><email>danielmadsen1983@gmail.com</email></author><category term="posts" /><category term="Personal" /><category term="Imposter Syndrome" /><summary type="html"><![CDATA[A candid personal account of dealing with Imposter Syndrome as a senior Citrix consultant — the anxiety, the therapy, and coming out the other side as a Citrix Technology Advocate.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://thedaniel.eu/assets/img/blog/imposter_syndrome_go.jpg" /><media:content medium="image" url="https://thedaniel.eu/assets/img/blog/imposter_syndrome_go.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How to Install Citrix Linux VDA on RHEL with MCS and FAS - Updated Guide</title><link href="https://thedaniel.eu/posts/2024-01-12-REWORK-how-to-configure-citrix-vda-for-linux-with-mcs-and-fas/" rel="alternate" type="text/html" title="How to Install Citrix Linux VDA on RHEL with MCS and FAS - Updated Guide" /><published>2024-01-12T00:00:00+00:00</published><updated>2026-05-26T09:17:54+00:00</updated><id>https://thedaniel.eu/posts/REWORK-how-to-configure-citrix-vda-for-linux-with-mcs-and-fas</id><content type="html" xml:base="https://thedaniel.eu/posts/2024-01-12-REWORK-how-to-configure-citrix-vda-for-linux-with-mcs-and-fas/"><![CDATA[<ul class="large-only" id="markdown-toc">
  <li><a href="#citrix-support-and-a-big-thank-you" id="markdown-toc-citrix-support-and-a-big-thank-you">Citrix support and a BIG thank you</a></li>
  <li><a href="#trialnerror" id="markdown-toc-trialnerror">Trial’n’error</a></li>
  <li><a href="#components-in-use" id="markdown-toc-components-in-use">Components in use</a></li>
  <li><a href="#tools" id="markdown-toc-tools">Tools</a></li>
  <li><a href="#prerequisites" id="markdown-toc-prerequisites">Prerequisites</a></li>
  <li><a href="#supported-linux-distributions-for-mcs-and-fas" id="markdown-toc-supported-linux-distributions-for-mcs-and-fas">Supported Linux distributions for MCS and FAS</a></li>
  <li><a href="#pre-vda-installation-configurations" id="markdown-toc-pre-vda-installation-configurations">Pre-VDA installation configurations</a>    <ul>
      <li><a href="#hostname" id="markdown-toc-hostname">Hostname</a></li>
      <li><a href="#assign-a-loopback-address-to-the-hostname" id="markdown-toc-assign-a-loopback-address-to-the-hostname">Assign a loopback address to the hostname</a></li>
      <li><a href="#check-the-hostname" id="markdown-toc-check-the-hostname">Check the hostname</a></li>
      <li><a href="#dns-and-network-reachabilitity" id="markdown-toc-dns-and-network-reachabilitity">DNS and network reachabilitity</a></li>
      <li><a href="#time-synchronization-using-chrony" id="markdown-toc-time-synchronization-using-chrony">Time synchronization using Chrony</a></li>
      <li><a href="#install-and-specify-a-database" id="markdown-toc-install-and-specify-a-database">Install and specify a database</a></li>
      <li><a href="#time-synchronization-fix-on-esxi" id="markdown-toc-time-synchronization-fix-on-esxi">Time synchronization fix on ESXi</a></li>
      <li><a href="#add-vm-to-domain" id="markdown-toc-add-vm-to-domain">Add VM to domain</a></li>
      <li><a href="#net-runtime-60-installation" id="markdown-toc-net-runtime-60-installation">.NET Runtime 6.0 installation</a></li>
      <li><a href="#install-epel-repos" id="markdown-toc-install-epel-repos">Install EPEL repos</a></li>
    </ul>
  </li>
  <li><a href="#vda-installation-and-configuration" id="markdown-toc-vda-installation-and-configuration">VDA Installation and configuration</a>    <ul>
      <li><a href="#install-vda-package" id="markdown-toc-install-vda-package">Install VDA package</a></li>
      <li><a href="#ctxinstallsh-and-ctxsetupsh" id="markdown-toc-ctxinstallsh-and-ctxsetupsh">ctxinstall.sh and ctxsetup.sh</a></li>
    </ul>
  </li>
  <li><a href="#a-short-intro-to-ctxreg-before-we-continue" id="markdown-toc-a-short-intro-to-ctxreg-before-we-continue">A short intro to ctxreg before we continue</a></li>
  <li><a href="#fas-configuration" id="markdown-toc-fas-configuration">FAS configuration</a>    <ul>
      <li><a href="#import-root-and-intermediate-certificates" id="markdown-toc-import-root-and-intermediate-certificates">Import root and intermediate certificates</a></li>
      <li><a href="#configure-citrix-fas" id="markdown-toc-configure-citrix-fas">Configure Citrix FAS</a></li>
    </ul>
  </li>
  <li><a href="#mcs-configuration" id="markdown-toc-mcs-configuration">MCS Configuration</a>    <ul>
      <li><a href="#dns-servers-needs-to-corrected-in-mcsconf" id="markdown-toc-dns-servers-needs-to-corrected-in-mcsconf">DNS servers needs to corrected in mcs.conf</a></li>
    </ul>
  </li>
  <li><a href="#a-few-tips" id="markdown-toc-a-few-tips">A few tips</a>    <ul>
      <li><a href="#lock-linux-version" id="markdown-toc-lock-linux-version">Lock Linux version</a></li>
    </ul>
  </li>
</ul>

<h2 id="citrix-support-and-a-big-thank-you">Citrix support and a BIG thank you</h2>

<p>There’s been written many stories and novels about Citrix support and how challenging this experience can be.<br />
But this story is a little different, because of <strong>one</strong> guy, Vijaykumar P.<br />
He works as an Escalation Engineer within Citrix Support.<br />
He’s the most pro-active, helpful and knowledgeable supporter I’ve dealt with, when talking with Citrix support. If your case get assigned to him, don’t worry, you’re in good hands.<br />
So just a big shout-out and thanks!</p>

<h2 id="trialnerror">Trial’n’error</h2>

<p>My <a href="https://thedaniel.eu/posts/2023-05-12-how-to-configure-citrix-vda-for-linux-with-mcs-and-fas/">last article</a> was pretty much, a trial’n’error installation of Linux VDA. Since then, I’ve tried following it a couple of times, and none of them worked :)<br />
This guide will be a complete rework, both how the installation is done and include troubleshooting.<br />
And to be honest. I wrote the article, one and half year after installation/configuration. So, sorry to those guys, who may have tried followed the guide.<br />
This new post, will be fresh from memory.</p>

<h2 id="components-in-use">Components in use</h2>

<ul>
  <li>RHEL 8.8 Workstation VM on VMWare ESXi 7.0.3</li>
  <li>XenDesktop VDA 2308 Agent</li>
</ul>

<h2 id="tools">Tools</h2>

<ul>
  <li>PuTTY</li>
  <li>WinSCP</li>
  <li>Browser to access vCenter</li>
</ul>

<h2 id="prerequisites">Prerequisites</h2>
<ul>
  <li>Internet!.. For the love of god.. internet..<br />
<em>Otherwise you will need to setup a local repo containing every dependency needed for each installation. A.k.a. new VDA version, new repo, new dependencies.</em>
    <blockquote>
      <p>Yees, it’s copied from the original Linux VDA guide. ‘Cause I can’t emphasize it enough!</p>
    </blockquote>
  </li>
  <li>A working Citrix FAS configuration</li>
  <li>Download Citrix VDA for Linux rpm package<br />
<em>https://www.citrix.com/downloads/citrix-virtual-apps-and-desktops/components/linux-vda-2308.html</em></li>
</ul>

<h2 id="supported-linux-distributions-for-mcs-and-fas">Supported Linux distributions for MCS and FAS</h2>

<p>As per written, the supported versions are as follows:<br />
MCS supported distributions:</p>
<style scoped="">
table {
  font-size: 13px;
}
</style>

<table>
  <thead>
    <tr>
      <th>Distributions Version</th>
      <th>Winbind</th>
      <th style="text-align: center">SSSD</th>
      <th style="text-align: center">Centrify</th>
      <th style="text-align: right">PBIS</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Debian 11.3</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>RHEL 9.2/9.0</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>RHEL 8.8/8.6</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>Rocky Linux 9.2/9.0</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>Rocky Linux 8.8/8.6</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>RHEL 7.9, CentOS 7.9</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>SUSE 15.4</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>Ubuntu 22.04, Ubuntu 20.04</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">Yes</td>
    </tr>
  </tbody>
</table>

<p>Distributions where FAS is supported on MCS created VMs:</p>

<table>
  <thead>
    <tr>
      <th>Distributions Version</th>
      <th>Winbind</th>
      <th style="text-align: center">SSSD</th>
      <th style="text-align: center">Centrify</th>
      <th style="text-align: right">PBIS</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>RHEL 9.2/9.0</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>RHEL 8.x</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>Rocky Linux 9.2/9.0</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>Rocky Linux 8.x</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>RHEL 7, CentOS 7</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>Debian 11.3</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>SUSE 15.4</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>Ubuntu 22.04, Ubuntu 20.04</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
  </tbody>
</table>

<p>To be sure authentication works, the only supported method is “Winbind”. SSSD as an authentication method for Citrix FAS, which seems almost dead, since it’s only available for RHEL/CentOS 7. And RHEL 7 only has <a href="https://endoflife.date/rhel">extended maintenance</a> and CentOS 7 only has <a href="https://endoflife.date/centos">security support</a>.<br />
Other than that, choose whatever distribution that suits you or your organization.</p>

<h2 id="pre-vda-installation-configurations">Pre-VDA installation configurations</h2>

<p>Connect to the VM using PuTTY and WinSCP</p>
<blockquote>
  <p>It’s easier to edit files using WinSCP, if aren’t familiar with Linux and nano/vi</p>
</blockquote>

<h3 id="hostname">Hostname</h3>

<p>Edit /etc/hostname so only one name is present</p>

<h3 id="assign-a-loopback-address-to-the-hostname">Assign a loopback address to the hostname</h3>

<p>Edit /etc/hosts so only the following is present:<br />
<strong>127.0.0.1 servername.domain.local servername localhost</strong><br />
Remove any other references to hostname-fqdn and hostname.</p>
<blockquote>
  <p>The Linux VDA currently does not support NetBIOS name truncation. The host name must not exceed 15 characters.
Tip:
Use a–z, A–Z, 0–9, and hyphen (-) characters only. Avoid underscores (_), spaces, and other symbols. Do not start a host name with a number and do not end with a hyphen.</p>
</blockquote>

<h3 id="check-the-hostname">Check the hostname</h3>

<p><strong>Hostname</strong> and <strong>Hostname -f</strong><br />
The results should be:<br />
servername and servername.domain.local</p>

<h3 id="dns-and-network-reachabilitity">DNS and network reachabilitity</h3>

<p>Run the following four commands, to make sure that the VM is able to reach both domain controller and delivery controller</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nslookup domain-controller-fqdn
ping domain-controller-fqdn
nslookup delivery-controller-fqdn
ping delivery-controller-fqdn
</code></pre></div></div>
<p>The results should look like this:<br />
<img src="/assets/img/blog/Linux-vda-1.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<h3 id="time-synchronization-using-chrony">Time synchronization using Chrony</h3>

<p>Edit /etc/Chrony.conf using root account. Type in your domain controllers or a NTP server of your choice, with <strong>iburst</strong> following.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>server peer1-fqdn-or-ip-address iburst
server peer2-fqdn-or-ip-address iburst
</code></pre></div></div>
<p>Restart chrony deamon service</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> /bin/systemctl restart chronyd
</code></pre></div></div>

<p><img src="/assets/img/blog/Linux-vda-2.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<h3 id="install-and-specify-a-database">Install and specify a database</h3>

<p>Since this is a multi-session environment, the database of choice is PostgreSQL.</p>
<blockquote>
  <p>Citrix recommends SQLlite for single-session environments</p>
</blockquote>

<p>Six commands needs to be executed:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>yum <span class="nt">-y</span> <span class="nb">install </span>postgresql-server
<span class="nb">sudo </span>yum <span class="nt">-y</span> <span class="nb">install </span>postgresql-jdbc
<span class="nb">sudo </span>yum <span class="nt">-y</span> <span class="nb">install </span>libpq
<span class="nb">sudo </span>postgresql-setup initdb
<span class="nb">sudo </span>systemctl <span class="nb">enable </span>postgresql
<span class="nb">sudo </span>systemctl start postgresql
</code></pre></div></div>
<p>The first three installs PostgreSQL. The fourth initiates the database and creates database files under <strong>/var/lib/pgsql/data</strong>. The last two enables and start PostgreSQL, though <em>enable</em> also sets that the service starts on startup.</p>

<p>Check the version of PostgreSQL by using:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>psql <span class="nt">--version</span>
</code></pre></div></div>

<p><img src="/assets/img/blog/Linux-vda-3.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<h3 id="time-synchronization-fix-on-esxi">Time synchronization fix on ESXi</h3>

<p>When using ESXi, VMware Time Synchronization needs to be disabled for the VMs. Otherwise there’s two clock synchronizations, NTP and hypervisor, which can cause some issues.</p>

<p>Untick “Syncronize at startup and resume (recommended)”<br />
<img src="/assets/img/blog/Linux-vda-4.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<h3 id="add-vm-to-domain">Add VM to domain</h3>
<blockquote>
  <p>This isn’t required since the VDAs will join the domain using MCS, but it’s great to see that the VM is able to join the domain and later test FAS.</p>
</blockquote>

<p>Install the required packages:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>yum <span class="nt">-y</span> <span class="nb">install </span>samba-winbind samba-winbind-clients krb5-workstation oddjob-mkhomedir realmd authselect
</code></pre></div></div>

<p>Enable Winbind service at startup:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> /sbin/chkconfig winbind on
</code></pre></div></div>

<p>The result should look like this:<br />
<img src="/assets/img/blog/Linux-vda-5.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>Configure the machine for Kerberos authentication by using Winbind:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>authselect <span class="k">select </span>winbind with-mkhomedir <span class="nt">--force</span>
</code></pre></div></div>

<p>Using WinSCP or nano. Edit <strong>/etc/samba/smb.conf</strong> and add the following three lines in [GLOBAL] section:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kerberos method <span class="o">=</span> secrets and keytab
winbind refresh tickets <span class="o">=</span> <span class="nb">true
</span>winbind offline logon <span class="o">=</span> no
</code></pre></div></div>

<p>Edit /etc/krb5.conf, using WinSCP or nano, and add entries under the [libdefaults], [realms], and [domain_realm] sections:<br />
<em>REALM</em> and <em>realm</em> is to be edited, so it fits your domainname.<br />
<em>REALM</em> is <strong>DOMAIN.LOCAL</strong> and <em>realm</em> is <strong>domain.local</strong><br />
Under the [libdefaults] section:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>default_ccache_name <span class="o">=</span> FILE:/tmp/krb5cc_%<span class="o">{</span>uid<span class="o">}</span>
default_realm <span class="o">=</span> REALM
dns_lookup_kdc <span class="o">=</span> <span class="nb">true</span>
</code></pre></div></div>
<p>Under the [realms] section:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>REALM <span class="o">=</span> <span class="o">{</span>
kdc <span class="o">=</span> fqdn-of-domain-controller
<span class="o">}</span>
</code></pre></div></div>
<p>Under the [domain_realm] section:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>realm <span class="o">=</span> REALM
.realm <span class="o">=</span> REALM
</code></pre></div></div>
<p>Krb5.conf should look something like this:<br />
<img src="/assets/img/blog/Linux-vda-6.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>Join the VM to the domain, using the following command and an account which has privilege to join a computer to the domain:<br />
Edit <em>REALM</em> to your <strong>DOMAIN.LOCAL</strong></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>realm <span class="nb">join</span> <span class="nt">-U</span> user <span class="nt">--client-software</span><span class="o">=</span>winbind REALM
</code></pre></div></div>
<p>To confirm domain join form the machine:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>realm list
</code></pre></div></div>
<p><img src="/assets/img/blog/Linux-vda-7.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>Edit /etc/security/pam_winbind.conf, using WinSCP or nano, and add or change the following entries under the [Global] section:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>krb5_auth <span class="o">=</span> <span class="nb">yes
</span>krb5_ccache_type <span class="o">=</span> FILE
mkhomedir <span class="o">=</span> <span class="nb">yes</span>
</code></pre></div></div>

<p>These settings require a restart of Winbind deamon:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl restart winbind
systemctl status winbind
</code></pre></div></div>

<p>Verify domain and kerberos configuration:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>net ads testjoin
<span class="nb">sudo </span>net ads info
<span class="nb">sudo </span>klist <span class="nt">-ke</span> 
</code></pre></div></div>

<p><img src="/assets/img/blog/Linux-vda-8.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<h3 id="net-runtime-60-installation">.NET Runtime 6.0 installation</h3>

<p>.NET Runtime needs to be install, before anything regarding Citrix is installed</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>yum <span class="nb">install </span>aspnetcore-runtime-6.0
which dotnet
</code></pre></div></div>
<p>When install .NET Runtime with the above command, the default dotnet path is:<br />
<strong>/usr/bin</strong><br />
Take a note of this, because this is going to be used later in the VDA configuration</p>

<h3 id="install-epel-repos">Install EPEL repos</h3>
<p>Like .NET Runtime, EPEL repos are required to be installed before the VDA package</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>subscription-manager repos <span class="nt">--enable</span> codeready-builder-for-rhel-8-<span class="si">$(</span><span class="nb">arch</span><span class="si">)</span><span class="nt">-rpms</span>
dnf <span class="nb">install </span>https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
</code></pre></div></div>

<h2 id="vda-installation-and-configuration">VDA Installation and configuration</h2>

<p>Download Linux VDA for <a href="https://www.citrix.com/downloads/citrix-virtual-apps-and-desktops/components/Linux-vda-2308.html">RHEL 8.8</a> and for those guys, who is into security and verifications, go ahead and download the GPG key and verify the integrity of the package.<br />
Copy both the .rpm and .asc files to /tmp/ using WinSCP and execute the following:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rpmkeys <span class="nt">--import</span> /tmp/GPG_Key.asc
<span class="nb">cd</span> /tmp
rpm <span class="nt">--checksig</span> <span class="nt">--verbose</span> XenDesktopVDA-23.08.0.30-1.el8_x.x86_64.rpm
</code></pre></div></div>

<p><img src="/assets/img/blog/Linux-vda-9.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<h3 id="install-vda-package">Install VDA package</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>yum <span class="nb">install</span> <span class="nt">-y</span> XenDesktopVDA-23.08.0.30-1.el8_x.x86_64.rpm
</code></pre></div></div>
<p>The install checks if all dependencies are present in the VM. In my case, several of the dependencies were missing. These has to be installed manually, before retrying to install the VDA package.<br />
<img src="/assets/img/blog/Linux-vda-10.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>In my case. The missing dependencies was:</p>
<ul>
  <li>ImageMagick</li>
  <li>imlib2</li>
  <li>java-11-openjdk</li>
  <li>qrencode-libs</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yum <span class="nt">-y</span> <span class="nb">install </span>ImageMagick
yum <span class="nt">-y</span> <span class="nb">install </span>imlib2
yum <span class="nt">-y</span> <span class="nb">install </span>qrencode-libs
yum <span class="nt">-y</span> <span class="nb">install </span>java-11-openjdk
</code></pre></div></div>

<p>After all the dependencies have been installed the VDA package is installed correctly.</p>

<h3 id="ctxinstallsh-and-ctxsetupsh">ctxinstall.sh and ctxsetup.sh</h3>

<p>Complete the installation with the following commands:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /opt/Citrix/VDA/sbin/
./ctxinstall.sh 
</code></pre></div></div>

<blockquote>
  <p>The installation can be monitored from a new SSH by executing:</p>
  <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">tail</span> <span class="nt">-f</span> /var/log/xdl/ctxinstall.log
</code></pre></div>  </div>
</blockquote>

<p><img src="/assets/img/blog/Linux-vda-11.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p class="note" title="Attention">Important: After the installation, if it displays <strong>“Step 1: Get user input”</strong>, as shown below, do not proceed with adding the details here. Cancel it by pressing Ctrl+C.</p>

<p><img src="/assets/img/blog/Linux-vda-12.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>Run <strong>ctxsetup.sh</strong> to configure the VDA configuration:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /opt/Citrix/VDA/sbin/
./ctxsetup.sh
</code></pre></div></div>

<p>This is a prompted configuration, where the installer asks for your input, such as:
CTX_XDL_DOTNET_RUNTIME_PATH=path-to-install-dotnet-runtime</p>
<blockquote>
  <p>Applying the note from earlier, the answer here would be <strong>/usr/bin</strong></p>
</blockquote>

<p>CTX_XDL_DDC_LIST=list-ddc-fqdns<br />
For this input, you should type at least one FQDN of a DDC. If you have multiple, they need to be space-separated.</p>

<p>Instead of cluttering this post, with all the configuration questions, you can find more information on this <a href="https://docs.citrix.com/en-us/Linux-virtual-delivery-agent/current-release/installation-overview/manual-installation-overview/redhat#automated-configuration">page</a>.</p>

<p>After the configuration has finished, it’s time for good old <strong>XDPing</strong>.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /opt/Citrix/VDA/bin
./xdping
</code></pre></div></div>

<p>This tool provides a wealth of information about all the services in use, including the most important errors related to these services. Some errors are self-explanatory; for example, <strong>Kerberos weak crypto disabled</strong> was a test and, of course, needs to be disabled.
<img src="/assets/img/blog/Linux-vda-13.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p><strong>XDPing</strong> ultimately provides a summary with errors and warnings, with the majority of errors requiring correction.
<img src="/assets/img/blog/Linux-vda-14.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>Make sure that the VDA service is running</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl status ctxvda
</code></pre></div></div>
<p><img src="/assets/img/blog/Linux-vda-15.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>That concludes the installation and configuration of the VDA.<br />
At this point, it’s possible to create a machine catalog and delivery group, to check if the VDA registers correctly.<br />
Publish a desktop and connect to the VDA; it will prompt for username and password, since Citrix FAS isn’t configured yet.<br />
It would be a good idea to take a snapshot of the VM at this point.</p>

<h2 id="a-short-intro-to-ctxreg-before-we-continue">A short intro to ctxreg before we continue</h2>

<p>So my guess is; Citrix created the Linux VDA out of demand, not because they really saw a market for it. Someone might have waved a blank cheque and said “go fix”.<br />
Because, what they did was; create a Windows registry hive inside Linux.<br />
From my limited experience with Linux, I don’t think this is what Linus Torvalds had in mind, when he created the Linux kernel.<br />
Anyways. <strong>ctxreg</strong> is the container of these registry settings. This is where all Citrix related information is written.<br />
E.g. VDA configuration from earlier: Delivery Controllers, Citrix FAS, File transfers.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>create <span class="nt">-k</span> <span class="s2">"HKLM</span><span class="se">\S</span><span class="s2">oftware</span><span class="se">\C</span><span class="s2">itrix</span><span class="se">\V</span><span class="s2">irtualDesktopAgent"</span> <span class="nt">-t</span> <span class="s2">"REG_SZ"</span> <span class="nt">-v</span> <span class="s2">"ListOfDDCs"</span> <span class="nt">-d</span> <span class="s2">"FQDN FQDN"</span> <span class="nt">--force</span>
create <span class="nt">-k</span> <span class="s2">"HKLM</span><span class="se">\S</span><span class="s2">oftware</span><span class="se">\C</span><span class="s2">itrix</span><span class="se">\V</span><span class="s2">irtualDesktopAgent</span><span class="se">\F</span><span class="s2">asLogon"</span> <span class="nt">--force</span>
create <span class="nt">-k</span> <span class="s2">"HKLM</span><span class="se">\S</span><span class="s2">oftware</span><span class="se">\C</span><span class="s2">itrix</span><span class="se">\V</span><span class="s2">irtualDesktopAgent</span><span class="se">\F</span><span class="s2">asLogon"</span> <span class="nt">-t</span> <span class="s2">"REG_DWORD"</span> <span class="nt">-v</span> <span class="s2">"FasConfigured"</span> <span class="nt">-d</span> <span class="s2">"0x00000001"</span> <span class="nt">--force</span>
create <span class="nt">-k</span> <span class="s2">"HKLM</span><span class="se">\S</span><span class="s2">oftware</span><span class="se">\P</span><span class="s2">olicies</span><span class="se">\C</span><span class="s2">itrix</span><span class="se">\8\U</span><span class="s2">ser</span><span class="se">\I</span><span class="s2">O"</span> <span class="nt">--force</span>
create <span class="nt">-k</span> <span class="s2">"HKLM</span><span class="se">\S</span><span class="s2">oftware</span><span class="se">\P</span><span class="s2">olicies</span><span class="se">\C</span><span class="s2">itrix</span><span class="se">\8\U</span><span class="s2">ser</span><span class="se">\I</span><span class="s2">O"</span> <span class="nt">-t</span> <span class="s2">"REG_DWORD"</span> <span class="nt">-v</span> <span class="s2">"AllowFileTransfer"</span> <span class="nt">-d</span> <span class="s2">"0x00000000"</span> <span class="nt">--force</span>
create <span class="nt">-k</span> <span class="s2">"HKLM</span><span class="se">\S</span><span class="s2">oftware</span><span class="se">\P</span><span class="s2">olicies</span><span class="se">\C</span><span class="s2">itrix</span><span class="se">\8\U</span><span class="s2">ser</span><span class="se">\I</span><span class="s2">O"</span> <span class="nt">-t</span> <span class="s2">"REG_DWORD"</span> <span class="nt">-v</span> <span class="s2">"AllowPNPRedirection"</span> <span class="nt">-d</span> <span class="s2">"0x00000000"</span> <span class="nt">--force</span>
</code></pre></div></div>

<p>These settings can be manipulated using <strong>ctxreg</strong>. Parameter <em><code class="language-plaintext highlighter-rouge">--help</code></em> shows all parameters available.</p>
<blockquote>
  <p>I’m unsure if settings is overridden, if using Citrix Policies. My first guess would be “Yes”.</p>
</blockquote>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /opt/Citrix/VDA/bin/
./ctxreg <span class="nt">--help</span>
</code></pre></div></div>

<h2 id="fas-configuration">FAS configuration</h2>

<p>Download CentOS pam_krb5 module from <a href="http://vault.centos.org/7.9.2009/os/Source/SPackages/pam_krb5-2.4.8-6.el7.src.rpm">vault.centos</a> and copy .rpm to /tmp/.<br />
Build and install the module with the following commands:</p>
<blockquote>
  <p>Don’t mind CentOS. It’s the correct pam module.</p>
</blockquote>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /tmp
yum <span class="nb">install </span>make gcc krb5-devel pam-devel autoconf libtool
rpm2cpio pam_krb5-2.4.8-6.el7.src.rpm | cpio <span class="nt">-div</span>
<span class="nb">tar </span>xvzf pam_krb5-2.4.8.tar.gz
<span class="nb">cd </span>pam_krb5-2.4.8
./configure <span class="nt">--prefix</span><span class="o">=</span>/usr
make
make <span class="nb">install</span>
</code></pre></div></div>

<p>Verify that pam_krb5.so exists under <strong>/usr/lib64/security/</strong></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">ls</span> <span class="nt">-l</span> /usr/lib64/security | <span class="nb">grep </span>pam_krb5
</code></pre></div></div>
<p><img src="/assets/img/blog/Linux-vda-16.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>I added the Citrix FAS FQDNs to the VDA configuration. This can be verified by typing:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /opt/Citrix/VDA/bin/
./ctxreg dump | <span class="nb">grep</span> <span class="nt">-i</span> usercreden
</code></pre></div></div>
<p><img src="/assets/img/blog/Linux-vda-17.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>And if you fancy it; a complete dump of ctxreg is possible:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /opt/Citrix/VDA/bin/
./ctxreg dump
</code></pre></div></div>

<p>That’ll give some information as to what can be set, updated or removed, using the command below.<br />
Citrix FAS FQDNs can be added or updated using this command:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /opt/Citrix/VDA/bin/
./ctxreg create <span class="nt">-k</span> <span class="s2">"HKLM</span><span class="se">\S</span><span class="s2">oftware</span><span class="se">\C</span><span class="s2">itrix</span><span class="se">\V</span><span class="s2">irtualDesktopAgent</span><span class="se">\A</span><span class="s2">uthentication</span><span class="se">\U</span><span class="s2">serCredentialService"</span> <span class="nt">-t</span> <span class="s2">"REG_SZ"</span> <span class="nt">-v</span> <span class="s2">"Addresses"</span> <span class="nt">-d</span> <span class="s2">"&lt;Your-FAS-Server-List&gt;"</span> <span class="nt">--force</span>
</code></pre></div></div>

<p>The FQDNs need to be semi;colon-separated</p>

<p>Restart two Citrix services:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl restart ctxjproxy
systemctl restart ctxvda
</code></pre></div></div>

<h3 id="import-root-and-intermediate-certificates">Import root and intermediate certificates</h3>

<p>Export the root and intermediate certificates in PEM format. If multiple intermediate CAs are available, export from all of them.<br />
Copy the certificates to either /tmp/ and use <strong>cp</strong> or directly to /etc/pki/CA/certs. If /etc/pki/CA/certs isn’t available. Create the folder structure and copy the certificates.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo cp </span>root.pem /etc/pki/CA/certs/
<span class="nb">sudo cp </span>intermediate.pem or intermediates.pem /etc/pki/CA/certs/
</code></pre></div></div>

<h3 id="configure-citrix-fas">Configure Citrix FAS</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /opt/Citrix/VDA/sbin/
./ctxfascfg.sh
</code></pre></div></div>
<p><img src="/assets/img/blog/Linux-vda-18.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>
<blockquote>
  <p>Don’t mind Step 3. The picture is from a rerun of ctxfascfg.sh</p>
</blockquote>

<p>Once completed, check /etc/krb5.conf and add all KDCs(Key Distribution Center). Below is krb5.conf file from my setup:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># To opt out of the system crypto-policies configuration of krb5, remove the</span>
<span class="c"># symlink at /etc/krb5.conf.d/crypto-policies which will not be recreated.</span>
includedir /etc/krb5.conf.d/

<span class="o">[</span>logging]
    default <span class="o">=</span> FILE:/var/log/krb5libs.log
    kdc <span class="o">=</span> FILE:/var/log/krb5kdc.log
    admin_server <span class="o">=</span> FILE:/var/log/kadmind.log

<span class="o">[</span>libdefaults]
 default_ccache_name <span class="o">=</span> FILE:/tmp/krb5cc_%<span class="o">{</span>uid<span class="o">}</span>_XXXXXX
    dns_lookup_realm <span class="o">=</span> <span class="nb">false
    </span>ticket_lifetime <span class="o">=</span> 24h
    renew_lifetime <span class="o">=</span> 7d
    forwardable <span class="o">=</span> <span class="nb">true
    </span>rdns <span class="o">=</span> <span class="nb">false
    </span>spake_preauth_groups <span class="o">=</span> edwards25519
    default_realm <span class="o">=</span> DOMAIN.LOCAL
    dns_lookup_kdc <span class="o">=</span> <span class="nb">true
    </span>udp_preference_limit <span class="o">=</span> 0

<span class="o">[</span>realms]
 DOMAIN.LOCAL <span class="o">=</span> <span class="o">{</span>
     kdc <span class="o">=</span> fqdn.domain.controller
     kdc <span class="o">=</span> fqdn.domain.controller
     auth_to_local <span class="o">=</span> RULE:[1:<span class="nv">$1</span>@<span class="nv">$0</span><span class="o">]</span>
     pkinit_kdc_hostname <span class="o">=</span> fqdn.domain.controller
     pkinit_kdc_hostname <span class="o">=</span> fqdn.domain.controller
     pkinit_anchors <span class="o">=</span> DIR:/etc/pki/CA/certs/
     pkinit_eku_checking <span class="o">=</span> kpServerAuth
     pkinit_cert_match <span class="o">=</span> <span class="o">||</span>&lt;EKU&gt;msScLogin,&lt;KU&gt;digitalSignature
     admin_server <span class="o">=</span> fqdn.domain.controller
  <span class="o">}</span>

<span class="o">[</span>domain_realm]
 domain.local <span class="o">=</span> DOMAIN.LOCAL
 .domain.local <span class="o">=</span> DOMAIN.LOCAL
</code></pre></div></div>

<p>Restart VDA service and connect to the publish desktop, when the VDA har registered:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl restart ctxvda
</code></pre></div></div>

<h2 id="mcs-configuration">MCS Configuration</h2>
<p>Citrix created a tool called <strong>Easyinstall</strong> which I’m going to use, to set up the MCS configuration</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /opt/Citrix/VDA/bin
./easyinstall
</code></pre></div></div>

<p>This opens a GUI where information, such as Delivery Controllers, DNS server, and so on, needs to be typed.<br />
One of the most important settings is <em>“Use_AD_Configuration_Files_Of_Current_VDA”</em>. The default is ‘N,’ and in this case, it needs to be set to ‘Y’ since I’ve already configured all AD settings in the VDA configuration.</p>

<p><img src="/assets/img/blog/Linux-vda-19.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>When all relevant information have been typed, press <em>Deploy</em> and <strong>Easyinstall</strong> will do it’s thing and hopefully end up saying <em>“Finished preparing a master image”</em>.</p>

<p><img src="/assets/img/blog/Linux-vda-20.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<h3 id="dns-servers-needs-to-corrected-in-mcsconf">DNS servers needs to corrected in mcs.conf</h3>
<p>After using <strong>Easyinstall</strong> for the MCS configuration, I noticed that the LDAP list was not getting saved correctly in the mcs.conf file. All the servers were put in one line instead of separate lines.<br />
It didn’t cause initial issues, but I’m quiet sure that it could later on.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#########################DNS Configuration#####################################</span>
<span class="c"># Provide DNS information</span>
<span class="c"># You can provide 4 DNS servers at most.</span>
<span class="c"># Leave empty if you do not have 4 servers. You may also leave all of them empty</span>
<span class="c"># and configure dns manually.</span>
<span class="c"># Format:</span>
<span class="c"># dns1="xx.xx.xx.xx"</span>
<span class="c"># dns2="xx.xx.xx.xx"</span>
<span class="c"># dns3=</span>
<span class="c"># dns4=</span>
<span class="nv">dns1</span><span class="o">=</span><span class="s1">'IP IP IP IP'</span>
<span class="nv">dns2</span><span class="o">=</span><span class="s1">''</span>
<span class="nv">dns3</span><span class="o">=</span><span class="s1">''</span>
<span class="nv">dns4</span><span class="o">=</span><span class="s1">''</span>
</code></pre></div></div>

<p>This was corrected to:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#########################DNS Configuration#####################################</span>
<span class="c"># Provide DNS information</span>
<span class="c"># You can provide 4 DNS servers at most.</span>
<span class="c"># Leave empty if you do not have 4 servers. You may also leave all of them empty</span>
<span class="c"># and configure dns manually.</span>
<span class="c"># Format:</span>
<span class="c"># dns1="xx.xx.xx.xx"</span>
<span class="c"># dns2="xx.xx.xx.xx"</span>
<span class="c"># dns3=</span>
<span class="c"># dns4=</span>
<span class="nv">dns1</span><span class="o">=</span><span class="s1">'IP'</span>
<span class="nv">dns2</span><span class="o">=</span><span class="s1">'IP'</span>
<span class="nv">dns3</span><span class="o">=</span><span class="s1">'IP'</span>
<span class="nv">dns4</span><span class="o">=</span><span class="s1">'IP'</span>

</code></pre></div></div>

<p>Shutdown the VDA. Create a snapshot. Create a new machine catalog, as you would any other, with MCS. Assign VDAs to a delivery group or create a new one.<br />
This concludes the installation of VDA, configuration of Citrix FAS and MCS.<br />
Let me know what you think or has comments.</p>

<h2 id="a-few-tips">A few tips</h2>

<p>This is an unfinished list, I’ll continue to add to.</p>

<h3 id="lock-linux-version">Lock Linux version</h3>
<p>Like any other OS, RHEL needs to be updated for security and hotfix’(probably not the correct term in Linux country).<br />
In Linux you can lock the OS to a specific version, both major and minor.<br />
This is important, since Citrix only supports specific versions. E.g. for RHEL 8, it’s 8.6 and 8.8 (as per written). If <em>yum update</em> is used and OS version is not locked, then it automatically updates to the latest minor version.<br />
The commands are different from each distribution. For RHEL, it’s the following commands.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>subscription-manager release <span class="nt">--list</span>
subscription-manager release <span class="nt">--set</span><span class="o">=</span>8.8
yum clean all
yum updateinfo
yum update
</code></pre></div></div>
<p>The first shows a list releases<br />
The seconds sets both major and minor release<br />
The third removes all prio updates<br />
The fourth returns which updates are available for the OS<br />
The fifth updates the OS, with the available updates</p>]]></content><author><name>Daniel Madsen</name><email>danielmadsen1983@gmail.com</email></author><category term="posts" /><category term="Citrix" /><category term="Linux VDA" /><category term="MCS" /><category term="FAS" /><category term="RHEL" /><summary type="html"><![CDATA[Complete and tested guide to installing Citrix Linux VDA on Red Hat Enterprise Linux, configured with Machine Creation Services (MCS) and Federated Authentication Service (FAS). Includes troubleshooting.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://thedaniel.eu/assets/img/blog/rework-linux-vda.jpg" /><media:content medium="image" url="https://thedaniel.eu/assets/img/blog/rework-linux-vda.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How to Migrate Citrix Cloud from One OrgID to Another - Complete Guide</title><link href="https://thedaniel.eu/posts/2023-12-22-migrate-from-citrix-orgid-to-new-orgid/" rel="alternate" type="text/html" title="How to Migrate Citrix Cloud from One OrgID to Another - Complete Guide" /><published>2023-12-22T00:00:00+00:00</published><updated>2026-05-26T09:17:54+00:00</updated><id>https://thedaniel.eu/posts/migrate-from-citrix-orgid-to-new-orgid</id><content type="html" xml:base="https://thedaniel.eu/posts/2023-12-22-migrate-from-citrix-orgid-to-new-orgid/"><![CDATA[<ul class="large-only" id="markdown-toc">
  <li><a href="#license-policy-change" id="markdown-toc-license-policy-change">License policy change</a></li>
  <li><a href="#services-in-use" id="markdown-toc-services-in-use">Services in use</a></li>
  <li><a href="#prereqs" id="markdown-toc-prereqs">Prereqs</a></li>
  <li><a href="#migration" id="markdown-toc-migration">Migration</a>    <ul>
      <li><a href="#resource-location" id="markdown-toc-resource-location">Resource Location</a></li>
      <li><a href="#cloud-connector-and-automated-configuration-tool" id="markdown-toc-cloud-connector-and-automated-configuration-tool">Cloud Connector and Automated Configuration Tool</a></li>
    </ul>
  </li>
  <li><a href="#wem-service-migration" id="markdown-toc-wem-service-migration">WEM Service migration</a></li>
  <li><a href="#fas-service-migration" id="markdown-toc-fas-service-migration">FAS Service migration</a></li>
  <li><a href="#connect-azure-ad-to-citrix-cloud" id="markdown-toc-connect-azure-ad-to-citrix-cloud">Connect Azure AD to Citrix Cloud</a></li>
  <li><a href="#conclusion" id="markdown-toc-conclusion">Conclusion</a></li>
</ul>

<h2 id="license-policy-change">License policy change</h2>
<p>Citrix changed their license policy regarding when customers want to decrease the number of licenses they have. As a result, if a customer, for various reasons, reduces their staff, they need to migrate to a new Citrix OrgID and purchase a new license.</p>

<p class="note" title="Attention">Update pr. 28/12<br />
You don’t need to migrate from one OrgID to another OrgID, when decreasing license count, but … you can’t decrease your number of licenses, if you keep using the same OrgID. If you have bought a 1000 licenses, you can’t decrease to e.g. 500. You still need to pay for 1000, but can assign 500 licenses, if that’s what you need.</p>

<h2 id="services-in-use">Services in use</h2>
<p>Citrix DaaS<br />
Citrix FAS<br />
Citrix WEM<br />
Azure Active Directory</p>

<h2 id="prereqs">Prereqs</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Prereqs
├── Citrix
│   ├── Full Administrator <span class="k">in </span>both Citrix Cloud accounts
│   ├── Automated Configuration Tool<span class="o">(</span>ACT<span class="o">)</span>
│   ├── Two new VMs <span class="k">for </span>Cloud Connectors
│   └── Two Secret Clients, one <span class="k">in </span>each Cloud account
└── Azure
    ├── Global Administrator <span class="k">in </span>Azure
    └── SecretID password of the service principal <span class="k">in </span>Azure
</code></pre></div></div>

<h2 id="migration">Migration</h2>
<h3 id="resource-location">Resource Location</h3>
<p>From one of the new Cloud Connector VMs, connect to the new Citrix Cloud and create a new Resource Location. It’s preferable to use the same name as in the existing Citrix Cloud. More on that later.</p>

<h3 id="cloud-connector-and-automated-configuration-tool">Cloud Connector and Automated Configuration Tool</h3>
<p>After the Resource Location has been created, download and install Cloud Connectors. While they is installing, download ACT(Automated Configuration Tool).<br />
Install ACT. That will create a shortcut on the desktop icon named “Auto Config”.<br />
When executing “Auto Config”, a PoSH window will open<br />
<img src="/assets/img/blog/auto_config_1.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>Insert values from CustomerID and Secret Client, to the cmdlet below and execute it</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>⁠Backup-CvadAcToFile <span class="nt">-All</span> <span class="nt">-CustomerId</span> <span class="s2">"CustomerID taken from Citrix Cloud"</span> <span class="nt">-ClientId</span> <span class="s2">"ClientID from Secret Client"</span> <span class="nt">-Secret</span> <span class="s2">"Secret from Secret Client"</span>
</code></pre></div></div>
<p>This creates a folder structure in the “\AutoConfig\” folder.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">.</span>
└── ./AutoConfig
    ├── ./AutoConfig/Backup_date_and_timestamp
    ├── ./AutoConfig/CustomerInfo.yml
    ├── ./AutoConfig/CvadAcSecurity.yml
    └── ./AutoConfig/ZoneMapping.yml
</code></pre></div></div>

<p>And an outout that looks something like this:<br />
<img src="/assets/img/blog/auto_config_2.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>CustomerInfo.yml needs to populated with CustomerID, ClientID and Secret from Secret Client from the new Cloud account</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Set-CvadAcCustomerInfoFile <span class="nt">-CustomerId</span> <span class="s2">"CustomerID taken from Citrix Cloud"</span> <span class="nt">-ClientId</span> <span class="s2">"ClientID from Secret Client"</span> <span class="nt">-Secret</span> <span class="s2">"Secret from Secret Client"</span>
</code></pre></div></div>

<p>CvadAcSecurity.yml needs hypervisor information, which is typed in manually.<br />
If Resource Location was named the same, then ZoneMapping.yml doesn’t need any configuration.</p>

<p>Inside ./AutoConfig/Backup_date_and_timestamp, there are several .yml files that can be invoked using ‘Restore-CvadAcToSite’ with options like ‘-GroupPolicy’. This will recreate all the Citrix Policies that were exported when using ‘Backup-CvadAcToFile’.</p>
<blockquote>
  <p>There is a chance that this might cause issues where the policies are assigned. The first time I attempted this, I used ‘Restore-CvadAcToSite -Restorefolder <path>' and encountered a bunch of errors, as Machine Catalog, Delivery Group, and so on are dependent on each other.</path></p>
</blockquote>

<p class="note" title="Attention">Before we move forward, a short warning: MCS-created Machine Catalogs cannot be migrated. Whether the hosting connection is created before running Restore-CvadAcToSite doesn’t matter.</p>

<p>Citrix has created a <a href="https://docs.citrix.com/en-us/citrix-daas/migrate#component-migration-order">migration order</a><br />
I had the misfortune of not saving my Service Principal password when I last created the Enterprise App for the Hosting Connection.
<img src="/assets/img/blog/OrgID-Enterprise_app.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" />
I had to create a new Client Secret in Azure and manually create the Hosting Connection.<br />
Machine Catalogs needed to be manually created, again with the same name as the existing, as they are MCS-created. For PVS-created Machine Catalogs use the code block below.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Restore-CvadAcToSite <span class="nt">-MachineCatalogs</span> <span class="nt">-RestoreFolder</span> &lt;path&gt;
</code></pre></div></div>

<p>Move forward in the migration order</p>

<h2 id="wem-service-migration">WEM Service migration</h2>

<p>That was actually fairly easy, when I found the option. Thank Yan Wang, from the WEM team for pointing that out.</p>

<p>Start by provisioning the WEM Service.<br />
In the existing WebConsole go to Configuration Sets and create a backup in “Backup and Restore” and download it.<br />
<img src="/assets/img/blog/OrgID-WEM-1.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>When the provisioning has completed, go to WebConsole. Add a new Configuration Set.<br />
Press Configuration Sets(the briefcase icon), go to “Backup and Restore” and upload the resently downloaded configuration set. Press the “Restore” button, as seen below.<br />
<img src="/assets/img/blog/OrgID-WEM-2.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>Select the newly added Configuration Set, in the dropdown and press “Restore”.<br />
<img src="/assets/img/blog/OrgID-WEM-3.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" />
If you have more than one Configuration Set, then …</p>

<h2 id="fas-service-migration">FAS Service migration</h2>

<p>It’s possible to reuse the FAS servers from the existing environment.<br />
Set one of the FAS servers in maintenance mode.</p>

<p><img src="/assets/img/blog/OrgID-FAS-1.jpg" alt="Full-width image" /></p>

<p>Disconnect from Citrix Cloud in Citrix FAS Administration Console. Connect to the new Citrix Cloud</p>

<p><img src="/assets/img/blog/OrgID-FAS-2.jpg" alt="Full-width image" /></p>

<p>Enable FAS in Workspace Configuration</p>

<p><img src="/assets/img/blog/OrgID-FAS-3.jpg" alt="Full-width image" /></p>

<h2 id="connect-azure-ad-to-citrix-cloud">Connect Azure AD to Citrix Cloud</h2>

<p>Connect to Azure from “Identity and Access Management” in Citrix Cloud, using a Global Admin account.</p>

<p><img src="/assets/img/blog/OrgID-Az-1.jpg" alt="Full-width image" /></p>

<p>Write a sign-in URL and press “Confirm”.</p>

<p><img src="/assets/img/blog/OrgID-Az-2.jpg" alt="Full-width image" /></p>

<p>This will open a browser. Log in with a Global Admin and accept the required permissions.</p>

<p><img src="/assets/img/blog/OrgID-Az-3.jpg" alt="Full-width image" /></p>

<h2 id="conclusion">Conclusion</h2>

<p>In my opinion, changing the policy on such a simple task is a significant step in the wrong direction and a waste of customers’ money.
Changing from one OrgID to another is by no means a small change for any customer who encounters this. It would have been a slight change if customers were still using on-premise only and reporting via Call Home.
I have never seen how Citrix handles license amounts or license choices, but I imagine a dropdown with license types and a field for the license amount.</p>

<p>That’s my two cents. I hope you enjoy the blog/guide. Feel free to let me know if you come across any flaws or suggestions for improvement.</p>]]></content><author><name>Daniel Madsen</name><email>danielmadsen1983@gmail.com</email></author><category term="posts" /><category term="Citrix" /><category term="Cloud" /><category term="OrgID" /><category term="Migration" /><summary type="html"><![CDATA[Complete guide to migrating a Citrix Cloud environment between OrgIDs, covering DaaS, FAS, WEM, and Azure AD. Includes the Automated Configuration Tool, Cloud Connectors, and license policy changes.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://thedaniel.eu/assets/img/blog/OrgID-migration.jpg" /><media:content medium="image" url="https://thedaniel.eu/assets/img/blog/OrgID-migration.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Build Golden Images Across Hypervisors with Packer and Ansible - Part 1</title><link href="https://thedaniel.eu/posts/2023-10-30-packer-ansible-solution-to-create-golden-images-across-major-hypervisors-part1/" rel="alternate" type="text/html" title="Build Golden Images Across Hypervisors with Packer and Ansible - Part 1" /><published>2023-10-30T00:00:00+00:00</published><updated>2026-05-26T09:17:54+00:00</updated><id>https://thedaniel.eu/posts/packer-ansible-solution-to-create-golden-images-across-major-hypervisors-part1</id><content type="html" xml:base="https://thedaniel.eu/posts/2023-10-30-packer-ansible-solution-to-create-golden-images-across-major-hypervisors-part1/"><![CDATA[<ul class="large-only" id="markdown-toc">
  <li><a href="#out-of-my-depth" id="markdown-toc-out-of-my-depth">Out of my depth</a>    <ul>
      <li><a href="#build-tools" id="markdown-toc-build-tools">Build tools</a></li>
    </ul>
  </li>
  <li><a href="#how-to-create-a-vm-using-packer" id="markdown-toc-how-to-create-a-vm-using-packer">How to create a VM using Packer</a>    <ul>
      <li><a href="#who-is-hashicorp" id="markdown-toc-who-is-hashicorp">Who is HashiCorp?</a></li>
      <li><a href="#simple-to-run" id="markdown-toc-simple-to-run">Simple to run</a></li>
      <li><a href="#hcl-templates-blocks-variables-and-so-on" id="markdown-toc-hcl-templates-blocks-variables-and-so-on">HCL Templates, Blocks, Variables and so on</a></li>
      <li><a href="#hcl-templates" id="markdown-toc-hcl-templates">HCL Templates</a></li>
      <li><a href="#blocks" id="markdown-toc-blocks">Blocks</a></li>
      <li><a href="#packer-plugins" id="markdown-toc-packer-plugins">Packer plugins</a></li>
      <li><a href="#variables" id="markdown-toc-variables">Variables</a>        <ul>
          <li><a href="#input-variables" id="markdown-toc-input-variables">Input variables</a></li>
          <li><a href="#local-variables" id="markdown-toc-local-variables">Local variables</a></li>
        </ul>
      </li>
      <li><a href="#packer-init" id="markdown-toc-packer-init">Packer init</a></li>
      <li><a href="#packer-build" id="markdown-toc-packer-build">Packer build</a></li>
    </ul>
  </li>
</ul>

<h2 id="out-of-my-depth">Out of my depth</h2>

<p>At every employer I’ve worked for, we’ve had both managed/internal and external customers, where we always tried to deliver the best image-based VDI as possible.<br />
The images could be created from master scripts, calling different installer scripts with hard-coded username’n’passwords. Those were the days :-)<br />
Later SMS, which became SCCM (and MDT for Customers only needing a bare minimum deployment solution) - which still works great - but lacks simple integration to some form of password vault or encryption of username and password in customsettings.ini.<br />
Since everyone is doing DevOps, I thought… Why not give it a shot! Why not scrap our normal MDT-way of doing things, and completely start from scratch? That could be fun, right? To be honest, I’ve never been more out of depth, since I’ve started doing this. Just some quick background info: Most of the code I write would be simple PowerShell one-liners and minor scripts.</p>

<p>The goal was to find a new way to build golden images using modernized tools, that could be used across major hypervisors.
What I ended up with, was a combination of <a href="https://www.packer.io/">Packer</a>, <a href="https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_intro.html">Ansible Playbook</a> and Powershell. I’m still looking for a password-vault solution. It may end up being 1Password. Time will tell.</p>

<p>This series of blog posts is as much a tool for me to document my journey, as it is for you to learn from my mistakes :-)<br />
If you have any pointers or want to participate in my little endeavor, do not hesitate to reach out.</p>

<h3 id="build-tools">Build tools</h3>

<ul>
  <li>Packer
    <ul>
      <li>simplicity</li>
      <li>easy-to-read code</li>
      <li>well documented</li>
    </ul>
  </li>
  <li>Ansible Playbooks
    <ul>
      <li>no agent</li>
      <li>central controller node</li>
      <li>well documented</li>
    </ul>
  </li>
  <li>Powershell
    <ul>
      <li>well you know</li>
    </ul>
  </li>
</ul>

<h2 id="how-to-create-a-vm-using-packer">How to create a VM using Packer</h2>

<p>First blog in the series, will be about <a href="https://www.packer.io/">Packer</a>.</p>

<h3 id="who-is-hashicorp">Who is HashiCorp?</h3>

<p>For those who don’t know HashiCorp. Let’s just say, they were tired of manually creating complete infrastructures and golden images. So they wrote <a href="https://developer.hashicorp.com/terraform/intro">Terraform</a> and <a href="https://www.packer.io/">Packer</a>. They also created a configuration language called <a href="https://developer.hashicorp.com/terraform/language/syntax/configuration">HashiCorp Configuration Language</a>, or in short “HCL”, which later got extended to HCL2, which I will be focusing on.</p>

<h3 id="simple-to-run">Simple to run</h3>

<p>Packer is extremely simple to run.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>packer init 
packer build <span class="s2">"filename.pkr.hcl"</span>
</code></pre></div></div>

<p>In a matter of minutes, you will have a VM, with installed OS.<br />
It’s also possible to use variable files</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>packer init
packer build <span class="nt">-var-file</span><span class="o">=</span><span class="s2">"filename.pkrvar.hcl"</span> <span class="nb">.</span>
</code></pre></div></div>

<p>That little “.” is very important, since it defines to use every file in the current directory.</p>

<h3 id="hcl-templates-blocks-variables-and-so-on">HCL Templates, Blocks, Variables and so on</h3>

<p>HCL2 is a declarative language, where you tell Packer what to do and how to do it. This is done using plugins such as <a href="https://developer.hashicorp.com/packer/integrations/hashicorp/vsphere">vSphere</a>. In this case, it uses vSphere API to create and configure VMs.</p>

<h3 id="hcl-templates">HCL Templates</h3>

<p>HCL Templates is the actual file, where all code is written. For reference to e.g. Powershell users. The template is a .ps1 file.</p>

<h3 id="blocks">Blocks</h3>

<p>In a HCL template, there are these things called blocks, which are containers for objects, such as sources and variables.<br />
Blocks have a <strong>block type</strong>, and can have zero or multiple label names.</p>

<p>A block could look like this:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>packer <span class="o">{</span>
  required_version <span class="o">=</span> <span class="s2">"&gt;= 1.9.1"</span>
  required_plugins <span class="o">{</span>
    vsphere <span class="o">=</span> <span class="o">{</span>
      version <span class="o">=</span> <span class="s2">"&gt;= v1.2.0"</span>
      <span class="nb">source</span>  <span class="o">=</span> <span class="s2">"github.com/hashicorp/vsphere"</span>
    <span class="o">}</span>
  <span class="o">}</span>
<span class="o">}</span>
</code></pre></div></div>

<p>“packer” is the block type, and no label has been set.</p>

<h3 id="packer-plugins">Packer plugins</h3>

<p>Like I mentioned earlier in the blog. Packer uses <a href="https://developer.hashicorp.com/packer/integrations">plugins</a> to create VMs in vSphere, Windows update, install applications using Ansible Playbook, and so on.<br />
In the code above, you can see that “packer” is the block type and it requires the minimum version to be at least “1.9.1” and required plugins are “vsphere”.
If plugins are being used, then the code above needs to present in every HCL template, otherwise the plugins won’t work. See <a href="#packer-init">Packer Init</a> for downloading plugin binaries.</p>

<h3 id="variables">Variables</h3>

<p>There are two types of variables. <strong>Input Variables</strong> and <strong>Local Variables</strong>.<br />
Input variables are usually called “variables” and Local variables are called “locals”.</p>

<h4 id="input-variables">Input variables</h4>

<p>Input variables can have default values, but can be overridden using command line options, environment variables or variable definitions files. However, nothing can change the value of an input variable after the initial override.<br />
An example of an Input variable:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>variable <span class="s2">"vsphere_endpoint"</span> <span class="o">{</span>
  <span class="nb">type</span>        <span class="o">=</span> string
  description <span class="o">=</span> <span class="s2">"The fully qualified domain name or IP address of the vCenter Server instance."</span>
<span class="o">}</span>
</code></pre></div></div>

<blockquote>
  <p>“variable” is the block type and “vsphere_endpoint” is the label</p>
</blockquote>

<p>Example of declaring a variable:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>vsphere_endpoint <span class="o">=</span> <span class="s2">"vcenter_server.fqdn.local"</span>
</code></pre></div></div>

<p>Example of using the declared variable:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>vcenter_server <span class="o">=</span> <span class="s2">"var.vsphere_endpoint"</span>
</code></pre></div></div>

<h4 id="local-variables">Local variables</h4>

<p>Local or locals can be used multiple times, and contains other local variables, input variables, data sources etc.<br />
An example of using local and locals variables:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>locals <span class="o">{</span>
  build_by          <span class="o">=</span> <span class="s2">"Built by: theDaniel Packer </span><span class="k">${</span><span class="nv">packer</span><span class="p">.version</span><span class="k">}</span><span class="s2">"</span>
  build_date        <span class="o">=</span> formatdate<span class="o">(</span><span class="s2">"YYYY-MM-DD hh:mm ZZZ"</span>, timestamp<span class="o">())</span>
  build_description <span class="o">=</span> <span class="s2">"Built on: </span><span class="k">${</span><span class="nv">local</span><span class="p">.build_date</span><span class="k">}</span><span class="se">\n</span><span class="k">${</span><span class="nv">local</span><span class="p">.build_by</span><span class="k">}</span><span class="s2">"</span>
  iso_paths         <span class="o">=</span> <span class="o">[</span><span class="s2">"[</span><span class="k">${</span><span class="nv">var</span><span class="p">.common_iso_datastore</span><span class="k">}</span><span class="s2">] </span><span class="k">${</span><span class="nv">var</span><span class="p">.iso_path</span><span class="k">}</span><span class="s2">/</span><span class="k">${</span><span class="nv">var</span><span class="p">.iso_file</span><span class="k">}</span><span class="s2">"</span>, <span class="s2">"[] /usr/lib/vmware/isoimages/</span><span class="k">${</span><span class="nv">var</span><span class="p">.vm_guest_os_family</span><span class="k">}</span><span class="s2">.iso"</span><span class="o">]</span>
<span class="o">}</span>
</code></pre></div></div>

<p>The first two are local variables. The last two are a combination of input variables and two local variables</p>

<h3 id="packer-init">Packer init</h3>

<p>As mentioned <a href="#simple-to-run">earlier</a>, the “Packer init” command is the first command to be executed, when working with templates. This installs all the binaries when using plugins. This command is completely safe to run, since it’s only job is to install binaries.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>packer <span class="o">{</span>
  required_version <span class="o">=</span> <span class="s2">"&gt;= 1.9.1"</span>
  required_plugins <span class="o">{</span>
    vsphere <span class="o">=</span> <span class="o">{</span>
      version <span class="o">=</span> <span class="s2">"&gt;= v1.2.0"</span>
      <span class="nb">source</span>  <span class="o">=</span> <span class="s2">"github.com/hashicorp/vsphere"</span>
    <span class="o">}</span>
  <span class="o">}</span>
<span class="o">}</span>
</code></pre></div></div>
<p>Reuse of the code from earlier, when executing “Packer init”, then “vsphere” will be downloaded and installed.</p>

<h3 id="packer-build">Packer build</h3>

<p>“Packer build” does what it says. It builds the VM (HashiCorp calls it an artifact).<br />
There is bunch of <a href="https://developer.hashicorp.com/packer/docs/commands/build">parameters</a> that can be used, e.g. “-var-file” and “-force”. “-var-file” is self-explaining, but “-force” is nice to know. If a VM specified with the same name in the template already exists, then “-force” deletes that VM, before creating a new one.</p>
<blockquote>
  <p>but what if, I’ve have a VM, that shouldn’t be deleted, and has the same name, as in the template??<br />
Change the name, in the template then. Control your VM names.</p>
</blockquote>

<p>For now, this is the HCL Template, I’m using:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>//  BLOCK: packer
//  The Packer configuration.

packer <span class="o">{</span>
  required_version <span class="o">=</span> <span class="s2">"&gt;= 1.9.1"</span>
  required_plugins <span class="o">{</span>
    vsphere <span class="o">=</span> <span class="o">{</span>
      version <span class="o">=</span> <span class="s2">"&gt;= v1.2.0"</span>
      <span class="nb">source</span>  <span class="o">=</span> <span class="s2">"github.com/hashicorp/vsphere"</span>
    <span class="o">}</span>
    ansible <span class="o">=</span> <span class="o">{</span>
      version <span class="o">=</span> <span class="s2">"~&gt; 1"</span>
      <span class="nb">source</span> <span class="o">=</span> <span class="s2">"github.com/hashicorp/ansible"</span>
    <span class="o">}</span>
  <span class="o">}</span>
<span class="o">}</span>

//  BLOCK: locals
//  Defines the <span class="nb">local </span>variables.

locals <span class="o">{</span>
  build_by                   <span class="o">=</span> <span class="s2">"Built by: DanofficeIT Packer methodology </span><span class="k">${</span><span class="nv">packer</span><span class="p">.version</span><span class="k">}</span><span class="s2">"</span>
  build_date                 <span class="o">=</span> formatdate<span class="o">(</span><span class="s2">"YYYY-MM-DD hh:mm ZZZ"</span>, timestamp<span class="o">())</span>
  build_description          <span class="o">=</span> <span class="s2">"Built on: </span><span class="k">${</span><span class="nv">local</span><span class="p">.build_date</span><span class="k">}</span><span class="se">\n</span><span class="k">${</span><span class="nv">local</span><span class="p">.build_by</span><span class="k">}</span><span class="s2">"</span>
  iso_paths                  <span class="o">=</span> <span class="o">[</span><span class="s2">"[</span><span class="k">${</span><span class="nv">var</span><span class="p">.common_iso_datastore</span><span class="k">}</span><span class="s2">] </span><span class="k">${</span><span class="nv">var</span><span class="p">.iso_path</span><span class="k">}</span><span class="s2">/</span><span class="k">${</span><span class="nv">var</span><span class="p">.iso_file</span><span class="k">}</span><span class="s2">"</span>, <span class="s2">"[] /usr/lib/vmware/isoimages/</span><span class="k">${</span><span class="nv">var</span><span class="p">.vm_guest_os_family</span><span class="k">}</span><span class="s2">.iso"</span><span class="o">]</span>
  bucket_name                <span class="o">=</span> replace<span class="o">(</span><span class="s2">"</span><span class="k">${</span><span class="nv">var</span><span class="p">.vm_guest_os_family</span><span class="k">}</span><span class="s2">-</span><span class="k">${</span><span class="nv">var</span><span class="p">.vm_guest_os_name</span><span class="k">}</span><span class="s2">-</span><span class="k">${</span><span class="nv">var</span><span class="p">.vm_guest_os_version</span><span class="k">}</span><span class="s2">"</span>, <span class="s2">"."</span>, <span class="s2">""</span><span class="o">)</span>
  bucket_description         <span class="o">=</span> <span class="s2">"</span><span class="k">${</span><span class="nv">var</span><span class="p">.vm_guest_os_family</span><span class="k">}</span><span class="s2"> </span><span class="k">${</span><span class="nv">var</span><span class="p">.vm_guest_os_name</span><span class="k">}</span><span class="s2"> </span><span class="k">${</span><span class="nv">var</span><span class="p">.vm_guest_os_version</span><span class="k">}</span><span class="s2">"</span>

<span class="o">}</span>

//  BLOCK: <span class="nb">source</span>
//  Defines the builder configuration blocks.

<span class="nb">source</span> <span class="s2">"vsphere-iso"</span> <span class="s2">"windows-server-standard-dexp"</span> <span class="o">{</span>

  // vCenter Server Endpoint Settings and Credentials
  vcenter_server       <span class="o">=</span> var.vsphere_endpoint
  username             <span class="o">=</span> var.vsphere_username
  password             <span class="o">=</span> var.vsphere_password
  insecure_connection  <span class="o">=</span> var.vsphere_insecure_connection

  // vSphere Settings
  datacenter           <span class="o">=</span> var.vsphere_datacenter
  cluster              <span class="o">=</span> var.vsphere_cluster
  datastore            <span class="o">=</span> var.vsphere_datastore
  folder               <span class="o">=</span> var.vsphere_folder

  // Virtual Machine Settings
  vm_name              <span class="o">=</span> var.vm_name
  guest_os_type        <span class="o">=</span> var.vm_guest_os_type
  firmware             <span class="o">=</span> var.vm_firmware
  CPUs                 <span class="o">=</span> var.vm_cpu_count
  cpu_cores            <span class="o">=</span> var.vm_cpu_cores
  CPU_hot_plug         <span class="o">=</span> var.vm_cpu_hot_add
  RAM                  <span class="o">=</span> var.vm_mem_size
  RAM_hot_plug         <span class="o">=</span> var.vm_mem_hot_add
  cdrom_type           <span class="o">=</span> var.vm_cdrom_type
  disk_controller_type <span class="o">=</span> var.vm_disk_controller_type
  storage <span class="o">{</span>
    disk_size             <span class="o">=</span> var.vm_disk_size
    disk_controller_index <span class="o">=</span> 0
    disk_thin_provisioned <span class="o">=</span> var.vm_disk_thin_provisioned
  <span class="o">}</span>
  network_adapters <span class="o">{</span>
    network      <span class="o">=</span> var.vsphere_network
    network_card <span class="o">=</span> var.vm_network_card
  <span class="o">}</span>
  vm_version           <span class="o">=</span> var.common_vm_version
  remove_cdrom         <span class="o">=</span> var.common_remove_cdrom
  tools_upgrade_policy <span class="o">=</span> var.common_tools_upgrade_policy
  notes                <span class="o">=</span> local.build_description

  // Removable Media Settings
  iso_paths    <span class="o">=</span> local.iso_paths

  // Floppy configuration
  floppy_files         <span class="o">=</span> <span class="o">[</span>
        <span class="s2">"data/*"</span>,
        <span class="s2">"scripts/*"</span>,
  <span class="o">]</span>

  floppy_content <span class="o">=</span> <span class="o">{</span>
    <span class="s2">"autounattend.xml"</span> <span class="o">=</span> templatefile<span class="o">(</span><span class="s2">"</span><span class="k">${</span><span class="nv">abspath</span><span class="p">(path.root)</span><span class="k">}</span><span class="s2">/data/autounattend.pkrtpl.hcl"</span>, <span class="o">{</span>
      build_username       <span class="o">=</span> var.build_username
      build_password       <span class="o">=</span> var.build_password
      vm_inst_os_language  <span class="o">=</span> var.vm_inst_os_language
      vm_inst_os_keyboard  <span class="o">=</span> var.vm_inst_os_keyboard
      vm_inst_os_image     <span class="o">=</span> var.vm_inst_os_image_standard_desktop
      vm_inst_os_kms_key   <span class="o">=</span> var.vm_inst_os_kms_key_standard
      vm_guest_os_language <span class="o">=</span> var.vm_guest_os_language
      vm_guest_os_keyboard <span class="o">=</span> var.vm_guest_os_keyboard
      vm_guest_os_timezone <span class="o">=</span> var.vm_guest_os_timezone
    <span class="o">})</span>
  <span class="o">}</span>

  // Boot and Provisioning Settings
  http_port_min    <span class="o">=</span> var.common_http_port_min
  http_port_max    <span class="o">=</span> var.common_http_port_max
  boot_order       <span class="o">=</span> var.vm_boot_order
  boot_wait        <span class="o">=</span> var.vm_boot_wait
  boot_command     <span class="o">=</span> var.vm_boot_command
  ip_wait_timeout  <span class="o">=</span> var.common_ip_wait_timeout
  shutdown_command <span class="o">=</span> var.vm_shutdown_command
  shutdown_timeout <span class="o">=</span> var.common_shutdown_timeout

  // Communicator Settings and Credentials
  communicator   <span class="o">=</span> <span class="s2">"winrm"</span>
  winrm_username <span class="o">=</span> var.build_username
  winrm_password <span class="o">=</span> var.build_password
  winrm_port     <span class="o">=</span> var.communicator_port
  winrm_timeout  <span class="o">=</span> var.communicator_timeout
<span class="o">}</span>

//  BLOCK: build
//  Defines the builders to run, provisioners, and post-processors.

build <span class="o">{</span>
  sources <span class="o">=</span> <span class="o">[</span><span class="s2">"source.vsphere-iso.windows-server-standard-dexp"</span><span class="o">]</span>

  provisioner <span class="s2">"powershell"</span> <span class="o">{</span>
    environment_vars <span class="o">=</span> <span class="o">[</span>
      <span class="s2">"BUILD_USERNAME=</span><span class="k">${</span><span class="nv">var</span><span class="p">.build_username</span><span class="k">}</span><span class="s2">"</span>
    <span class="o">]</span>
    elevated_user     <span class="o">=</span> var.build_username
    elevated_password <span class="o">=</span> var.build_password
    scripts           <span class="o">=</span> formatlist<span class="o">(</span><span class="s2">"</span><span class="k">${</span><span class="nv">path</span><span class="p">.cwd</span><span class="k">}</span><span class="s2">/%s"</span>, var.scripts<span class="o">)</span>
  <span class="o">}</span>

  provisioner <span class="s2">"powershell"</span> <span class="o">{</span>
    elevated_user     <span class="o">=</span> var.build_username
    elevated_password <span class="o">=</span> var.build_password
    inline            <span class="o">=</span> var.inline
  <span class="o">}</span>
<span class="o">}</span>
</code></pre></div></div>]]></content><author><name>Daniel Madsen</name><email>danielmadsen1983@gmail.com</email></author><category term="posts" /><category term="Packer" /><category term="Ansible" /><category term="Golden Images" /><category term="Automation" /><category term="VMware" /><summary type="html"><![CDATA[Introduction to building automated golden images across VMware and other hypervisors using HashiCorp Packer, Ansible, and PowerShell. Learn why modern image building tools beat legacy MDT approaches.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://thedaniel.eu/assets/img/blog/open_source.jpg" /><media:content medium="image" url="https://thedaniel.eu/assets/img/blog/open_source.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How to Install WDAC Policy Wizard on Windows Server 2019</title><link href="https://thedaniel.eu/posts/2023-07-03-wdac-policy-wizard-installation-on-Server2019/" rel="alternate" type="text/html" title="How to Install WDAC Policy Wizard on Windows Server 2019" /><published>2023-07-03T00:00:00+00:00</published><updated>2026-05-26T09:17:54+00:00</updated><id>https://thedaniel.eu/posts/wdac-policy-wizard-installation-on-Server2019</id><content type="html" xml:base="https://thedaniel.eu/posts/2023-07-03-wdac-policy-wizard-installation-on-Server2019/"><![CDATA[<ul class="large-only" id="markdown-toc">
  <li><a href="#target-audience" id="markdown-toc-target-audience">Target audience</a></li>
  <li><a href="#prereqs" id="markdown-toc-prereqs">Prereqs:</a></li>
  <li><a href="#installation" id="markdown-toc-installation">Installation</a></li>
</ul>

<h2 id="target-audience">Target audience</h2>

<p>System Administrators, EUC Consultants and so on.</p>

<h2 id="prereqs">Prereqs:</h2>

<p>Download WDAC Policy Wizard: https://webapp-wdac-wizard.azurewebsites.net/<br />
Download App Installer: https://download.microsoft.com/download/d/e/2/de2b2ee1-6e63-45fa-99e4-32ee24fe365a/Microsoft.DesktopAppInstaller_1.17.10751.0_8wekyb3d8bbwe.zip<br />
Download App Installer dependency: https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx<br />
Download App Installer dependency: https://www.nuget.org/packages/Microsoft.UI.Xaml/2.7.2<br />
<img src="/assets/img/blog/microsoft_ui_xaml.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>Change the name of the .nupkg file to .zip, and extract the content to your desired path</p>
<h2 id="installation">Installation</h2>
<p>Application Control is crucial in any EUC environment, but once in a while, there can be hiccups. 
Such as, installing WDAC Policy Wizard in a Server based OS.<br />
Open Powershell and do the following:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Add-AppxPackage <span class="nt">-Path</span> <span class="s2">"WhateverDrive:</span><span class="se">\P</span><span class="s2">ath</span><span class="se">\T</span><span class="s2">o</span><span class="se">\M</span><span class="s2">icrosoft.VCLibs.x64.14.00.Desktop.appx"</span>
Add-AppxPackage <span class="nt">-Path</span> <span class="s2">"WhateverDrive:</span><span class="se">\P</span><span class="s2">ath</span><span class="se">\T</span><span class="s2">o</span><span class="se">\M</span><span class="s2">icrosoft.UI.Xaml.2.7.appx"</span>
Add-AppxPackage <span class="nt">-Path</span> <span class="s2">"WhateverDrive:</span><span class="se">\P</span><span class="s2">ath</span><span class="se">\T</span><span class="s2">o</span><span class="se">\M</span><span class="s2">icrosoft.DesktopAppInstaller_1.17.10751.0_8wekyb3d8bbwe</span><span class="se">\M</span><span class="s2">icrosoft.DesktopAppInstaller_1.17.10751.0_8wekyb3d8bbwe.msixbundle"</span>
</code></pre></div></div>

<p>Replace <strong>“WhateverDrive:\Path\To"</strong> with the locations of the different <strong>“.appx”</strong> installers and remember to choose the correct platform in UI Xaml</p>

<p>Now double click the previously download WDACWizard.appinstaller and you’re good-to-go!</p>]]></content><author><name>Daniel Madsen</name><email>danielmadsen1983@gmail.com</email></author><category term="posts" /><category term="Windows Server" /><category term="WDAC" /><category term="Security" /><category term="Microsoft" /><summary type="html"><![CDATA[Step-by-step guide to installing the WDAC Policy Wizard on Windows Server 2019 using PowerShell and AppX packages. Covers prerequisites, dependencies, and workarounds for Server OS limitations.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://thedaniel.eu/assets/img/blog/microsoft_wdac.jpg" /><media:content medium="image" url="https://thedaniel.eu/assets/img/blog/microsoft_wdac.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">HOW-TO Configure Citrix VDA for Linux with MCS and FAS</title><link href="https://thedaniel.eu/posts/2023-05-12-how-to-configure-citrix-vda-for-linux-with-mcs-and-fas/" rel="alternate" type="text/html" title="HOW-TO Configure Citrix VDA for Linux with MCS and FAS" /><published>2023-05-12T00:00:00+00:00</published><updated>2026-05-26T09:17:54+00:00</updated><id>https://thedaniel.eu/posts/how-to-configure-citrix-vda-for-linux-with-mcs-and-fas</id><content type="html" xml:base="https://thedaniel.eu/posts/2023-05-12-how-to-configure-citrix-vda-for-linux-with-mcs-and-fas/"><![CDATA[<blockquote>
  <p><strong>This guide has been superseded.</strong> A fully reworked and updated version is available:
<a href="/posts/2024-01-12-REWORK-how-to-configure-citrix-vda-for-linux-with-mcs-and-fas/">Rework of guide to install Linux VDA, w/ MCS and FAS</a></p>
</blockquote>

<ul class="large-only" id="markdown-toc">
  <li><a href="#why-this-article" id="markdown-toc-why-this-article">Why this article?</a></li>
  <li><a href="#supported-linux-distributions-for-mcs-and-fas" id="markdown-toc-supported-linux-distributions-for-mcs-and-fas">Supported Linux distributions for MCS and FAS</a></li>
  <li><a href="#prerequisites" id="markdown-toc-prerequisites">Prerequisites</a></li>
  <li><a href="#components-in-use" id="markdown-toc-components-in-use">Components in use</a></li>
  <li><a href="#installation-and-configuration" id="markdown-toc-installation-and-configuration">Installation and configuration</a>    <ul>
      <li><a href="#installation" id="markdown-toc-installation">Installation</a></li>
      <li><a href="#mcs-configuration" id="markdown-toc-mcs-configuration">MCS Configuration</a></li>
      <li><a href="#fas-configuration" id="markdown-toc-fas-configuration">FAS Configuration</a></li>
    </ul>
  </li>
</ul>

<h2 id="why-this-article">Why this article?</h2>

<p>As a very non-Linux kind-a-guy. I haven’t been able to find an article, which helps with installing a Citrix VDA for Linux and enables MCS and FAS.<br />
This has been a trial’n’error installation, since Linux VDAs in tiny Denmark is very uncommon. So please take in to consideration, that the article is not bullitproof and you may need to do several configurations.</p>

<h2 id="supported-linux-distributions-for-mcs-and-fas">Supported Linux distributions for MCS and FAS</h2>

<p>It can be a little tricky, finding the correct distribution and versions of that distribution, which is supported for both MCS and FAS.<br />
As per written, the supported versions are as follows:</p>

<p>MCS supported distributions:</p>

<table>
  <thead>
    <tr>
      <th>Distributions Version</th>
      <th>Winbind</th>
      <th style="text-align: center">SSSD</th>
      <th style="text-align: center">Centrify</th>
      <th style="text-align: right">PBIS</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Debian 11.3</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>RHEL 9.1/9.0</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>RHEL 8.7/8.6/8.4</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>Rocky Linux 9.1/9.0</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>Rocky Linux 8.7/8.6</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>RHEL 7.9, CentOS 7.9</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>SUSE 15.4</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>Ubuntu 22.04, Ubuntu 20.04, Ubuntu 18.04</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">Yes</td>
    </tr>
  </tbody>
</table>

<p>FAS enabled on MCS supported distributions:</p>

<table>
  <thead>
    <tr>
      <th>Distributions Version</th>
      <th>Winbind</th>
      <th style="text-align: center">SSSD</th>
      <th style="text-align: center">Centrify</th>
      <th style="text-align: right">PBIS</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Debian 11.3</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>RHEL 9.1/9.0</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>RHEL 8.7/8.6/8.4</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>Rocky Linux 9.1/9.0</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>Rocky Linux 8.7/8.6</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>RHEL 7.9, CentOS 7.9</td>
      <td>Yes</td>
      <td style="text-align: center">Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">Yes</td>
    </tr>
    <tr>
      <td>SUSE 15.4</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
    <tr>
      <td>Ubuntu 22.04, Ubuntu 20.04, Ubuntu 18.04</td>
      <td>Yes</td>
      <td style="text-align: center">No</td>
      <td style="text-align: center">No</td>
      <td style="text-align: right">No</td>
    </tr>
  </tbody>
</table>

<p>As you can see, it’s very limited, which authentication method, that can be used, when both MCS and FAS is to be used.</p>

<h2 id="prerequisites">Prerequisites</h2>

<ul>
  <li>Internet!.. For the love of god.. internet..<br />
<em>Otherwise you will need to setup a repo containing every dependency needed for each installation. Aka new VDA version, new repo, new dependencies.</em></li>
  <li>Download Citrix VDA for Linux rpm package<br />
<em>https://www.citrix.com/downloads/citrix-virtual-apps-and-desktops/components/linux-vda-2303.html</em></li>
  <li>Internal PKI for Citrix FAS</li>
</ul>

<h2 id="components-in-use">Components in use</h2>

<ul>
  <li>RHEL 8.4 Workstation VM on VMWare ESXi 6.7</li>
  <li>XenDesktop VDA 2204 Agent</li>
</ul>

<h2 id="installation-and-configuration">Installation and configuration</h2>

<h3 id="installation">Installation</h3>

<p>Power on the template VM, and make sure the time is correct.<br />
<em>If not, set checkmark in “Synchronize guest time with host”</em></p>

<p>.NET Runtime 6.0 needs to be installed before anything, for Virtual Desktop Agent to function.<br />
Start Terminal and run the following:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>rpm <span class="nt">-UvH</span> https://packages.microsoft.com/config/rhel/8/packages-microsoft-prod.rpm
<span class="nb">sudo </span>yum <span class="nb">install </span>aspnetcore-runtime-6.0
</code></pre></div></div>

<p>Find .NET Runtime 6.0 for your distribution here: https://packages.microsoft.com/config<br />
<em>e.g. RHEL 8.x is https://packages.microsoft.com/config/rhel/8/packages-microsoft-prod.rpm</em></p>

<p>When installing VDA for Linux on RHEL, install EPEL repository before the VDA.<br />
<em>Read more about EPEL here: https://docs.fedoraproject.org/en-US/epel/</em><br />
rpm -qa | grep epel, shows the installed version of EPEL.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yum search epel-release
yum <span class="nb">install </span>epel-release
yum update
rpm <span class="nt">-qa</span> | <span class="nb">grep </span>epel
</code></pre></div></div>

<p>Copy the downloaded VDA install package to a folder on the template VM, e.g. /tmp and type the following in Terminal.<br />
<em>Use WinSCP to transfer files between a Windows box and a Linux box. Much easier.</em></p>

<p>Install Citrix VDA for Linux.<br />
<em>Remember to edit the installer, to the correct filename.</em></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>yum <span class="nt">-y</span> localinstall /tmp/XenDesktopVDA-xx.xx.x.xx-x.xxx_x.x86_64.rpm
</code></pre></div></div>

<p><img src="/assets/img/blog/vda_for_linux_installed.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<h3 id="mcs-configuration">MCS Configuration</h3>

<p>For MCS to work, we need to edit <strong>sudo /etc/xdl/mcs/mcs.conf</strong><br />
This is a complete <strong>mcs.conf</strong> with the needed settings for MCS and FAS.<br />
Please edit so it fits your configuration.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
 
<span class="c">###############################################################################</span>
<span class="c">#</span>
<span class="c"># Citrix Virtual Apps &amp; Desktops For Linux Script: Machine Creation Service</span>
<span class="c"># Copyright (c) Citrix Systems, Inc. All Rights Reserved.</span>
<span class="c">#</span>
<span class="c"># This is the configuration file for mcs scripts.</span>
 
 
 
<span class="c">#########################Template machine check################################</span>
<span class="c"># If unspecified, the value is N by default, meaning that mcs configuration templates will overwrite configuration items</span>
<span class="c"># If you choose Y, MCS created VMs will use the existing configurations of the current VDA that must running correctly</span>
<span class="nv">Use_Existing_Configurations_Of_Current_VDA</span><span class="o">=</span>
 
<span class="c">#########################DNS Configuration#####################################</span>
<span class="c"># Provide DNS information</span>
<span class="c"># You can provide 4 DNS servers at most.</span>
<span class="c"># Leave empty if you do not have 4 servers. You may also leave all of them empty</span>
<span class="c"># and configure dns manually.</span>
<span class="c"># Format:</span>
<span class="c"># dns1="xx.xx.xx.xx"</span>
<span class="c"># dns2="xx.xx.xx.xx"</span>
<span class="c"># dns3=</span>
<span class="c"># dns4=</span>
<span class="nv">dns1</span><span class="o">=</span>Insert DC IP here
<span class="nv">dns2</span><span class="o">=</span>Insert DC IP here
<span class="nv">dns3</span><span class="o">=</span>
<span class="nv">dns4</span><span class="o">=</span>
 
<span class="c">#########################NTP Configuration#####################################</span>
<span class="c"># Provide NTP server information.</span>
<span class="c"># If not set here, the default value will be the address of domain controller.</span>
<span class="c"># Format:</span>
<span class="c"># NTP_SERVER="xx.xx.xx.xx"</span>
<span class="nv">NTP_SERVER</span><span class="o">=</span><span class="nv">1</span><span class="o">=</span>Insert NTP server IP here
 
<span class="c">#########################WORKGROUP Configuration###############################</span>
<span class="c"># Provide Workgroup information.</span>
<span class="c"># Usually workgroup is the same with domain name and you do not need to configure it here.</span>
<span class="c"># If that is not the case, please config it according to the correct format:</span>
<span class="c"># WORKGROUP="workgroup_name"</span>
<span class="nv">WORKGROUP</span><span class="o">=</span>
 
<span class="c">#########################Domain Join Configuration#############################</span>
<span class="c"># Provide Domain Join method.</span>
<span class="c"># Winbind: support RHEL7/CentOS7, RHEL8/CentOS8, SUSE12, SUSE15, Ubuntu16.04, Ubuntu18.04, Ubuntu20.04</span>
<span class="c"># SSSD: support RHEL7/CentOS7, Ubuntu16.04, Ubuntu18.04, Ubuntu20.04, SUSE12, SUSE15</span>
<span class="c"># Centrify: support RHEL7/CentOS7</span>
<span class="c"># PBIS: support RHEL7/CentOS7, RHEL8/CentOS8, SUSE12, SUSE15, Ubuntu16.04, Ubuntu18.04, Ubuntu20.04, Debian 10</span>
<span class="c"># AD_INTEGRATION="winbind" or AD_INTEGRATION="sssd" or AD_INTEGRATION="centrify" or AD_INTEGRATION="pbis"</span>
<span class="nv">AD_INTEGRATION</span><span class="o">=</span><span class="s2">"winbind"</span>
 
<span class="c">#########################Centrify download path Configuration#############################</span>
<span class="c"># When choose Centrify as AD_INTEGRATION, provide Centrify download path with related distribution if Centrify is not installed.</span>
<span class="c"># To find out the correct download url for your os, you may go here:</span>
<span class="c"># https://www.centrify.com/express/linux/download-files/#accordion-download-express-02</span>
<span class="nv">CENTRIFY_DOWNLOAD_PATH</span><span class="o">=</span>
 
 
<span class="c">#########################Centrify Samba download path Configuration#############################</span>
<span class="c"># When choose Centrify as AD_INTEGRATION, provide Centrify Samba download path with related distribution if Centrify is not installed.</span>
<span class="c"># CENTRIFY_SAMBA_DOWNLOAD_PATH=https://downloads.centrify.com/products/adbindproxy/2020/centrify-adbindproxy-5.7.0-rhel5-x86_64.tgz</span>
<span class="nv">CENTRIFY_SAMBA_DOWNLOAD_PATH</span><span class="o">=</span>
 
 
<span class="c">#########################PBIS download path Configuration#############################</span>
<span class="c"># When choose PBIS as AD_INTEGRATION, provide PBIS download path if PBIS is not installed.</span>
<span class="c"># PBIS: support RHEL7/CentOS7, RHEL8/CentOS8, SUSE12/SUSE15, Ubuntu16.04, Ubuntu18.04, Ubuntu20.04</span>
<span class="c"># RHEL7 and SUSE12: https://github.com/BeyondTrust/pbis-open/releases/download/8.8.0/pbis-open-8.8.0.506.linux.x86_64.rpm.sh</span>
<span class="c"># RHEL8: https://github.com/BeyondTrust/pbis-open/releases/download/9.1.0/pbis-open-9.1.0.551.linux.x86_64.rpm.sh</span>
<span class="c"># Ubuntu: https://github.com/BeyondTrust/pbis-open/releases/download/8.8.0/pbis-open-8.8.0.506.linux.x86_64.deb.sh</span>
<span class="c"># SUSE15: https://github.com/BeyondTrust/pbis-open/releases/download/9.1.0/pbis-open-9.1.0.551.linux.x86_64.rpm.sh</span>
<span class="c"># PBIS_DOWNLOAD_PATH=https://github.com/BeyondTrust/pbis-open/releases/download/8.8.0/pbis-open-8.8.0.506.linux.x86_64.rpm.sh</span>
<span class="nv">PBIS_DOWNLOAD_PATH</span><span class="o">=</span>
 
 
<span class="c">#########################Machine Password Automate Update############################</span>
<span class="c"># Machine password will expire after 30 days(default), so we have a mechanism to update</span>
<span class="c"># this password regularly.</span>
<span class="c"># You can set this value to enabled to enable this feature.</span>
<span class="nv">UPDATE_MACHINE_PW</span><span class="o">=</span><span class="s2">"Y"</span>
 
<span class="c">#########################Linux VDA Configuration###############################</span>
<span class="c"># Provide Linux VDA configuration information.</span>
<span class="c"># Please refer to Linux VDA Documentation for these settings.</span>
<span class="nv">DOTNET_RUNTIME_PATH</span><span class="o">=</span>/usr/bin
<span class="nv">DESKTOP_ENVIRONMENT</span><span class="o">=</span>gnome
<span class="nv">SUPPORT_DDC_AS_CNAME</span><span class="o">=</span>N
<span class="nv">VDA_PORT</span><span class="o">=</span>80
<span class="nv">REGISTER_SERVICE</span><span class="o">=</span>Y
<span class="nv">ADD_FIREWALL_RULES</span><span class="o">=</span>Y
<span class="nv">HDX_3D_PRO</span><span class="o">=</span>N
<span class="nv">VDI_MODE</span><span class="o">=</span>N
<span class="nv">SITE_NAME</span><span class="o">=</span><span class="s1">'&lt;none&gt;'</span>
<span class="nv">LDAP_LIST</span><span class="o">=</span><span class="s1">'domaincontroller01.domain.local;domaincontroller02.domain.local'</span> &lt;<span class="nt">---</span> edit
<span class="nv">SEARCH_BASE</span><span class="o">=</span><span class="s1">'DC=domain,DC=local'</span> &lt;<span class="nt">---</span> edit
<span class="nv">FAS_LIST</span><span class="o">=</span><span class="s1">'citrixfederationserverNAME01.domain.local;citrixfederationserverNAME02.domain.local'</span> &lt;<span class="nt">---</span> edit
<span class="nv">START_SERVICE</span><span class="o">=</span>Y
<span class="nv">TELEMETRY_SOCKET_PORT</span><span class="o">=</span>7503
<span class="nv">TELEMETRY_PORT</span><span class="o">=</span>7502
</code></pre></div></div>
<p>All of this can also be configured using Easy Install, but I haven’t tried it.<br />
It’s available here: <strong>/opt/Citrix/VDA/bin/easyinstall</strong><br />
<strong>EDIT 12/09-2023: This cannot be used for MCS, only standalone VDAs</strong></p>

<p>Run <strong>sudo /opt/Citrix/VDA/sbin/deploymcs.sh</strong> from Terminal<br />
<img src="/assets/img/blog/batman_you_need_fas.png" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>I’m deviating from Citrix Docs at this point. Because they want to edit /etc/krb5.conf at this point, but an one and a half year Citrix Support ticket says otherwise.<br />
I’ll move straight for the FAS configuration and will get back to /etc/krb5.conf later in the configuration.</p>

<h3 id="fas-configuration">FAS Configuration</h3>

<p>If you are using both root and intermediate certificate in your environment, copy both of them to /tmp<br />
<em>They need to be DER encrypted</em></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>openssl x509 <span class="nt">-inform</span> der <span class="nt">-in</span> /tmp/root.cer <span class="nt">-out</span> /etc/pki/CA/certs/root.pem
<span class="nb">sudo </span>openssl x509 <span class="nt">-inform</span> der <span class="nt">-in</span> /tmp/intermediate.cer <span class="nt">-out</span> /etc/pki/CA/certs/intermediate.pem
</code></pre></div></div>

<p>Install of pam_krb5 module:<br />
Download the module and copy .rpm file to /tmp<br />
<em>https://centos.pkgs.org/7/centos-x86_64/pam_krb5-2.4.8-6.el7.x86_64.rpm.html</em><br />
Yes, it reads CentOS, but it works for RHEL and is the module Citrix links to aswell.<br />
Direct download path.<br />
<em>http://vault.centos.org/7.9.2009/os/Source/SPackages/pam_krb5-2.4.8-6.el7.src.rpm</em></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yum <span class="nb">install </span>make gcc krb5-devel pam-devel autoconf libtool
rpm2cpio pam_krb5-2.4.8-6.el7.src.rpm | cpio <span class="nt">--extract</span> <span class="nt">--make-directories</span>
<span class="nb">tar </span>xvzf pam_krb5-2.4.8.tar.gz
<span class="nb">cd </span>pam_krb5-2.4.8
./configure <span class="nt">--prefix</span><span class="o">=</span>/usr
make
make <span class="nb">install
ls</span> <span class="nt">-l</span> /usr/lib64/security | <span class="nb">grep </span>pam_krb5
</code></pre></div></div>

<p>Run <strong>sudo /opt/Citrix/VDA/sbin/ctxfascfg.sh</strong><br />
Choose <strong>1</strong> for <strong>Winbind</strong>
<img src="/assets/img/blog/citrix_linuxVDA_fas_configured.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>Now we will get back to /etc/krb5.conf, but then again <strong>Yeah not really</strong><br />
If you follow Citrix Docs and edit /etc/krb5.conf, with the info needed for your environment, it’ll get wiped as soon as you use it for MCS.<br />
I don’t know why, but it does.</p>

<p><strong>So</strong>, we need to edit <strong>/var/xdl/mcs/ad_join.sh</strong> and edit the function <strong>conf_winbind</strong> to look like this:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">function </span>conf_winbind_krb5<span class="o">()</span>
<span class="o">{</span>
    log <span class="s2">"Debug: Enter function conf_winbind_krb5"</span>
    <span class="nv">krbFile</span><span class="o">=</span><span class="s2">"/etc/krb5.conf"</span>
    <span class="nv">winbind_krbFile</span><span class="o">=</span><span class="s2">"/etc/xdl/mcs/winbind_krb5.conf.tmpl"</span>
 
    <span class="c"># Customize /etc/krb5.conf</span>
    envsubst &lt; <span class="s2">"</span><span class="nv">$winbind_krbFile</span><span class="s2">"</span> <span class="o">&gt;</span> <span class="s2">"</span><span class="nv">$krbFile</span><span class="s2">"</span>
 
    log <span class="s2">"Debug: Exit function conf_winbind_krb5"</span>
<span class="o">}</span>
</code></pre></div></div>

<p>“<strong>REALM=$REALM AD_FQDN=$AD_FQDN realm=$realm</strong>” has been removed.<br />
If you take a look at the code above. <strong>envsubst</strong>, in lack of a better word, copies what is written in $winbind_krbFile to $krbFile.</p>

<p>Instead of editing /etc/krb5.conf, we’ll go and edit <strong>/etc/xdl/ad_join/winbind_smb.conf.tmpl</strong>.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>logging]
default <span class="o">=</span> FILE:/var/log/krb5libs.log
kdc <span class="o">=</span> FILE:/var/log/krb5kdc.log
admin_server <span class="o">=</span> FILE:/var/log/kadmind.log
<span class="o">[</span>libdefaults]
default_ccache_name <span class="o">=</span> FILE:/tmp/krb5cc_%<span class="o">{</span>uid<span class="o">}</span>
dns_lookup_realm <span class="o">=</span> <span class="nb">false
</span>ticket_lifetime <span class="o">=</span> 24h
renew_lifetime <span class="o">=</span> 7d
forwardable <span class="o">=</span> <span class="nb">true
</span>rdns <span class="o">=</span> <span class="nb">false
</span>spake_preauth_groups <span class="o">=</span> edwards25519
default_realm <span class="o">=</span> DOMAIN.LOCAL &lt;<span class="nt">---</span> edit
dns_lookup_kdc <span class="o">=</span> <span class="nb">true</span>
<span class="o">[</span>realms]
<span class="c"># EXAMPLE.COM = {</span>
<span class="c">#     kdc = kerberos.example.com</span>
<span class="c">#     admin_server = kerberos.example.com</span>
<span class="c"># }</span>
EDIT and move arrow <span class="nt">---</span><span class="o">&gt;</span>DOMAIN.LOCAL <span class="o">=</span> <span class="o">{</span>
kdc <span class="o">=</span> domaincontrollername01.domain.local &lt;<span class="nt">---</span> edit
auth_to_local <span class="o">=</span> RULE:[1:<span class="nv">$1</span>@<span class="nv">$0</span><span class="o">]</span>
pkinit_kdc_hostname <span class="o">=</span> domaincontrollername01.domain.local &lt;<span class="nt">---</span> edit
pkinit_kdc_hostname <span class="o">=</span> domaincontrollername02.domain.local &lt;<span class="nt">---</span> edit
pkinit_anchors <span class="o">=</span> FILE:/etc/pki/CA/certs/root.pem &lt;<span class="nt">---</span> <span class="k">if </span>you followed the article, this is the path <span class="k">for </span>the certificates
pkinit_pool <span class="o">=</span> FILE:/etc/pki/CA/certs/intermediate.pem &lt;<span class="nt">---</span> <span class="k">if </span>you followed the article, this is the path <span class="k">for </span>the certificates
pkinit_eku_checking <span class="o">=</span> kpServerAuth
pkinit_cert_match <span class="o">=</span> <span class="o">||</span>&lt;EKU&gt;msScLogin,&lt;KU&gt;digitalSignature
<span class="o">}</span>
<span class="o">[</span>domain_realm]
domain.local <span class="o">=</span> DOMAIN.LOCAL &lt;<span class="nt">---</span> edit both sides of <span class="s2">"="</span>
.domain.local <span class="o">=</span> DOMAIN.LOCAL &lt;<span class="nt">---</span> edit both sides of <span class="s2">"="</span>
</code></pre></div></div>

<p><strong><em>It’s extremely important to type all of your domain controllers in pkinit.kdc.hostname</em></strong><br />
Create a new, <em>pkinit_kdc_hostname</em>, for every domain controller you have in your environment.<br />
If this is not done, you might end up with a login error saying “<strong>Invalid Login</strong>”</p>

<p>Shutdown the VM. Take a snapshot and create a machine catalog, like you normally would and create X amount of VDA from the snapshot.<br />
I hope this helps you.</p>]]></content><author><name>Daniel Madsen</name><email>danielmadsen1983@gmail.com</email></author><category term="posts" /><category term="Citrix" /><category term="Linux VDA" /><category term="MCS" /><category term="FAS" /><category term="RHEL" /><summary type="html"><![CDATA[A comprehensive guide on how to install Citrix VDA for Linux with MCS and FAS.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://thedaniel.eu/assets/img/blog/linux_vda.jpg" /><media:content medium="image" url="https://thedaniel.eu/assets/img/blog/linux_vda.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How to Set Custom Icons on Citrix Published Desktops - Complete Guide</title><link href="https://thedaniel.eu/posts/2023-04-17-set-custom-icons-on-published-desktops/" rel="alternate" type="text/html" title="How to Set Custom Icons on Citrix Published Desktops - Complete Guide" /><published>2023-04-17T00:00:00+00:00</published><updated>2025-08-19T10:45:53+00:00</updated><id>https://thedaniel.eu/posts/set-custom-icons-on-published-desktops</id><content type="html" xml:base="https://thedaniel.eu/posts/2023-04-17-set-custom-icons-on-published-desktops/"><![CDATA[<p class="lead">Have you ever wondered how to set custom icons on published desktops?</p>

<ul class="large-only" id="markdown-toc">
  <li><a href="#questions-from-customers" id="markdown-toc-questions-from-customers">Questions from customers</a></li>
  <li><a href="#default-published-desktop-icon" id="markdown-toc-default-published-desktop-icon">Default published desktop icon</a></li>
  <li><a href="#different-ways-to-import-icons" id="markdown-toc-different-ways-to-import-icons">Different ways to import icons</a>    <ul>
      <li><a href="#set-icons-from-applications" id="markdown-toc-set-icons-from-applications">Set icons from applications</a></li>
      <li><a href="#convert-images-to-icons" id="markdown-toc-convert-images-to-icons">Convert images to icons</a></li>
    </ul>
  </li>
  <li><a href="#conclusion" id="markdown-toc-conclusion">Conclusion</a></li>
</ul>

<h2 id="questions-from-customers">Questions from customers</h2>

<p>Every once in a while, you get a question from a customer, where the answer isn’t apparent right away.
This question was one of them:</p>
<blockquote>
  <p>Can we change the default icon, to a custom created, for Published Desktops? and keep in mind, we have several published desktops in the site.</p>
</blockquote>

<p>TL:DR Yes, it’s possible.<br />
The following article shows how to create and import/use custom icons</p>

<h2 id="default-published-desktop-icon">Default published desktop icon</h2>

<p>As per default, published desktop icons will always be shown from C:\inetpub\wwwroot\Citrix\StoreName\App_Data\Desktop.ico from Storefront.<br />
Citrix has made it possible to change that with a simple Powershell cmdlet, executed from a Storefront server:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&amp; <span class="s1">'C:\Program Files\Citrix\Receiver StoreFront\Scripts\ImportModules.ps1'</span>
Disable-DSStoreSubstituteDesktopImage <span class="nt">-SiteId</span> 1 <span class="nt">-VirtualPath</span> /Citrix/StoreName
</code></pre></div></div>

<p>If executed, icons will be shown from the default IconUid from the Delivery Group, in your Citrix site.<br />
Say hello to the good old PNAgent icon:
<img src="/assets/img/blog/PNAgent_Icon.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<h2 id="different-ways-to-import-icons">Different ways to import icons</h2>

<h3 id="set-icons-from-applications">Set icons from applications</h3>

<p>The following needs to executed from a delivery controller, or from where Citrix snapins are installed:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ctxIcon</span> <span class="o">=</span> Get-BrokerIcon <span class="nt">-FileName</span> C:<span class="se">\W</span>indows<span class="se">\S</span>ystem32<span class="se">\n</span>otepad.exe <span class="nt">-index</span> 0
<span class="nv">$brokerIcon</span> <span class="o">=</span> New-BrokerIcon <span class="nt">-EncodedIconData</span> <span class="nv">$ctxIcon</span>.EncodedIconData
<span class="nv">$desktopGroup</span> <span class="o">=</span> Get-BrokerDesktopGroup <span class="nt">-Name</span> <span class="s1">'MyDesktopGroup'</span>
Set-BrokerDesktopGroup <span class="nv">$desktopGroup</span> <span class="nt">-IconUid</span> <span class="nv">$brokerIcon</span>.Uid
</code></pre></div></div>

<p>Output of $ctxIcon, shows IconFormats and EncodedIconData. EncodedIconData is Base64 encoded version of the icon:
<img src="/assets/img/blog/ctxIcon_EncodedIconData.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>$brokerIcon creates a new icon, with the EncodedIconData from $ctxIcon, and also gives it an Uid.<br />
Set-BrokerDesktopGroup changes the default IconUid from 1, to the Uid from $brokerIcon.Uid.<br />
The published desktop icon for “MyDesktopGroup” will now be displayed as the notepad icon.</p>

<h3 id="convert-images-to-icons">Convert images to icons</h3>

<p>icoconverter.com is the go-to site, where it’s possible change .png, .jpg, and so on to a .ico file
<img src="/assets/img/blog/Icoconverter.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" /></p>

<p>Upload an image file, and it’ll do magic, and download afterwards as favicon.ico:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Get-CtxIcon <span class="nt">-filename</span> favicon.ico | New-BrokerIcon
Get-BrokerIcon | <span class="k">select </span>Uid, EncodedIconData
Get-BrokerDesktopGroup <span class="s2">"Delivery Group Name"</span> | Set-BrokerDesktopGroup <span class="nt">-IconUid</span> <span class="s2">"Identifier"</span>
</code></pre></div></div>

<p>Get-BrokerIcon shows a combination of Uids and EncodedIconDatas. The first is always the default published desktop icon, and the following represents published application icons.<br />
The last on the list, will be the one imported from New-BrokerIcon:
<img src="/assets/img/blog/Get-brokericon_uid_encodedicondata.jpg" alt="Full-width image" class="lead" width="800" height="100" loading="lazy" />
Get-BrokerDesktopGroup “Delivery Group Name” | Set-BrokerDesktopGroup -IconUid “Identifier” changes the default IconUid 1 to the number stated in “Identifier”.</p>

<h2 id="conclusion">Conclusion</h2>

<p>Citrix please change the way icons for published desktop is changed. If it’s possible to change published application icons, from both Studio and Web Studio, then it should be possible to change published desktop icons.</p>]]></content><author><name>Daniel Madsen</name><email>danielmadsen1983@gmail.com</email></author><category term="posts" /><category term="Citrix" /><category term="CVAD" /><category term="StoreFront" /><category term="PowerShell" /><category term="Desktop Icons" /><category term="Administration" /><summary type="html"><![CDATA[Learn how to create and set custom icons for Citrix published desktops using PowerShell. Step-by-step guide with StoreFront configuration and icon conversion techniques.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://thedaniel.eu/assets/img/blog/custom_icons.jpg" /><media:content medium="image" url="https://thedaniel.eu/assets/img/blog/custom_icons.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>