Linux Virtual Delivery Agent

使用轻松安装创建已加入域的 VDA

重要提示:

  • 对于全新安装,建议您参考本文进行快速安装。本文逐步介绍了如何使用轻松安装来安装和配置 Linux VDA。轻松安装可节省时间和精力,并且比手动安装更不容易出错。它通过自动安装必要的软件包和自定义配置文件来帮助您设置 Linux VDA 的运行环境。

  • 要创建未加入域的 VDA,您可以使用 Machine Creation Services (MCS) 和轻松安装。有关详细信息,请参阅 使用 MCS 创建未加入域的 Linux VDA使用轻松安装创建未加入域的 Linux VDA(预览版)

  • 要了解适用于未加入域的 VDA 的功能,请转到 未加入域的 VDA

步骤 1:准备配置信息和 Linux 计算机

需要收集以下配置信息,以便进行轻松安装:

  • 主机名 – 要安装 Linux VDA 的计算机的主机名。
  • 域名服务器的 IP 地址。
  • NTP 服务器的 IP 地址或字符串名称。
  • 域名 – 域的 NetBIOS 名称。
  • 领域名称 – Kerberos 领域名称。
  • 域的完全限定域名 (FQDN)。
  • Active Directory (AD) integration method - Currently, easy install supports Winbind, SSSD, Centrify, PBIS, and Quest. Easy install supports Quest only for RHEL and Rocky Linux.
  • 用户名 – 将计算机加入域的用户的名称。
  • 密码 - 将计算机加入域的用户的密码。
  • OU – 组织单位。可选。

重要提示:

  • 要安装 Linux VDA,请验证存储库是否已在 Linux 计算机上正确添加。
  • 要启动会话,请验证 X Window 系统和桌面环境是否已安装。
  • 出于安全考虑,轻松安装不会保存域加入密码。每次以交互模式运行轻松安装脚本 (ctxinstall.sh) 时,都必须手动输入域加入密码。在静默模式下,您必须在 /Citrix/VDA/sbin/ctxinstall.conf 中设置域加入密码或导出密码。我们建议您不要使用管理员帐户加入域。相反,请将域加入权限委派给除管理员帐户之外的 Active Directory 用户。为此,请使用“委派控制向导”在域控制器上委派控制权。

步骤 2:准备管理程序

在受支持的管理程序上将 Linux VDA 作为虚拟机运行时,需要进行一些更改。根据所使用的管理程序平台进行以下更改。如果您在裸机硬件上运行 Linux 计算机,则无需进行任何更改。

Fix time synchronization on XenServer (formerly Citrix Hypervisor™)

当 XenServer® 时间同步功能启用时,在每个半虚拟化 Linux VM 中,您会遇到 NTP 和 XenServer 的问题。两者都尝试管理系统时钟。为避免时钟与其他服务器不同步,请确保每个 Linux 访客中的系统时钟与 NTP 同步。这种情况需要禁用主机时间同步。在 HVM 模式下无需进行任何更改。

如果您正在运行安装了 XenServer VM Tools 的半虚拟化 Linux 内核,您可以从 Linux VM 中检查 XenServer 时间同步功能是否存在并已启用:

su -

cat /proc/sys/xen/independent_wallclock
<!--NeedCopy-->

此命令返回 0 或 1:

  • 0 - 时间同步功能已启用,必须禁用。
  • 1 - 时间同步功能已禁用,无需进一步操作。

If the /proc/sys/xen/independent_wallclock file is not present, the following steps are not required.

如果已启用,请通过将 1 写入文件来禁用时间同步功能:

sudo echo 1 > /proc/sys/xen/independent_wallclock
<!--NeedCopy-->

要使此更改在重启后永久生效,请编辑 /etc/sysctl.conf 文件并添加以下行:

xen.independent_wallclock = 1

要验证这些更改,请重启系统:

su -

cat /proc/sys/xen/independent_wallclock
<!--NeedCopy-->

此命令返回值为 1。

修复 Microsoft Hyper-V 上的时间同步问题

安装了 Hyper-V Linux 集成服务的 Linux VM 可以应用 Hyper-V 时间同步功能来使用主机操作系统的时钟。为确保系统时钟保持准确,您必须在启用 NTP 服务的同时启用此功能。

在管理操作系统中,请执行以下操作:

  1. 打开 Hyper-V 管理器控制台。
  2. For the settings of a Linux VM, select Integration Services.
  3. 确保已选择 时间同步

注意:

此方法不同于 VMware 和 XenServer(以前称为 Citrix Hypervisor),在 VMware 和 XenServer 中,主机时间同步被禁用以避免与 NTP 冲突。Hyper-V 时间同步可以与 NTP 时间同步共存并对其进行补充。

修复 ESX 和 ESXi 上的时间同步

启用 VMware 时间同步功能后,在每个半虚拟化 Linux VM 中,您会遇到 NTP 和管理程序的问题。两者都尝试同步系统时钟。为避免时钟与其他服务器不同步,请确保每个 Linux 访客中的系统时钟与 NTP 同步。此情况需要禁用主机时间同步。

如果您正在运行安装了 VMware Tools 的半虚拟化 Linux 内核:

  1. 打开 vSphere 客户端。
  2. 编辑 Linux VM 的设置。
  3. 虚拟机属性对话框中,打开选项选项卡。
  4. 选择 VMware 工具
  5. 高级框中,取消选中将客户机时间与主机同步

步骤 3:安装 .NET

在安装 Linux VDA 之前,请按照系统要求安装 .NET。

安装 .NET 后,运行 which dotnet 命令以查找运行时路径。

根据命令输出,设置 .NET 运行时二进制路径。例如,如果命令输出为 /aa/bb/dotnet,则使用 /aa/bb 作为 .NET 二进制路径。

步骤 4:下载 Linux VDA 软件包

  1. 转到 Citrix 虚拟应用和桌面下载页面
  2. 展开相应版本的思杰虚拟应用和桌面。
  3. 展开组件以查找 Linux VDA。例如:

    Citrix 虚拟应用和桌面 的组件

  4. 请点击 Linux VDA 链接,即可访问 Linux VDA 的下载页面。

    Linux 虚拟桌面代理下载

  5. 下载与您的 Linux 发行版匹配的 Linux VDA 软件包。

  6. 下载 GPG 公钥,您可以使用它来验证 Linux VDA 软件包的完整性。例如:

    GPG 公钥文件

    要使用公钥验证 Linux VDA 软件包的完整性:

    • 对于 RPM 软件包,运行以下命令将公钥导入 RPM 数据库并检查软件包完整性:

       rpmkeys --import <path to the public key>
       rpm --checksig --verbose <path to the Linux VDA package>
       <!--NeedCopy-->
      
    • 对于 DEB 软件包,运行以下命令将公钥导入 DEB 数据库并检查软件包完整性:

       sudo apt-get install dpkg-sig
       gpg --import <path to the public key>
       dpkg-sig --verify <path to the Linux VDA package>
       <!--NeedCopy-->
      

步骤 5:安装 Linux VDA 软件包

要设置 Linux VDA 的环境,请运行以下命令。

对于亚马逊利努克斯2、CentOS、RHEL和洛基利努克斯发行版:

注意:

  • 对于 RHEL 和 CentOS,在成功安装 Linux VDA 之前,请先安装 EPEL 存储库。有关如何安装 EPEL 的信息,请参阅 https://docs.fedoraproject.org/zh-cn/epel/ 处的说明。

  • 在 RHEL 9.6/9.4/9.3/9.2/9.0 和 Rocky Linux 9.6/9.4/9.3/9.2/9.0 上安装 Linux VDA 之前,请将 libsepol 软件包更新到 3.4 或更高版本。

sudo yum -y localinstall <PATH>/<Linux VDA RPM>
<!--NeedCopy-->

注意:

在 GCP 上托管的 RHEL 8.x/9.x 和 Rocky Linux 8.x/9.x 上安装 Linux VDA 后,以太网连接可能会丢失,并且在 VM 重启后 Linux VDA 可能无法访问。要解决此问题,请在首次登录 VM 时设置 root 密码,并确保您可以以 root 身份登录 VM。然后,在重启 VM 后,在控制台中运行以下命令:

nmcli dev connect eth0
systemctl restart NetworkManager
<!--NeedCopy-->

对于 乌班图/德比安 发行版:

sudo dpkg -i <PATH>/<Linux VDA deb>
sudo apt-get install -f
<!--NeedCopy-->

注意:

  • 要为 Debian 11 发行版安装必要的依赖项,请将 deb http://deb.debian.org/debian/ bullseye main 行添加到 /etc/apt/sources.list 文件中。

  • For Ubuntu 20.04 on GCP, disable RDNS. To do so, add the rdns = false line under [libdefaults] in /etc/krb5.conf.

对于 SUSE 发行版:

  1. For SUSE 15.5 on AWS, Azure, and GCP, ensure that:

    • 您正在使用 libstdc++6 版本 12 或更高版本。
    • The Default_WM parameter in /etc/sysconfig/windowmanager is set to “gnome”.
  2. 运行以下命令安装 Linux VDA:

    zypper -i install <PATH>/<Linux VDA RPM>
    <!--NeedCopy-->
    

步骤 6:安装 NVIDIA GRID 驱动程序

启用 HDX™ 3D Pro 需要您在管理程序和 VDA 计算机上安装 NVIDIA GRID 驱动程序。

要在特定的管理程序上安装和配置 NVIDIA GRID Virtual GPU Manager(主机驱动程序),请参阅以下指南:

要安装和配置 NVIDIA GRID 客户机 VM 驱动程序,请执行以下常规步骤:

  1. 确保客户机 VM 已关闭。
  2. 在虚拟机管理程序控制面板中,为 VM 分配一个 GPU。
  3. 启动 VM。
  4. 在 VM 上安装客户机 VM 驱动程序(从您的云供应商或 NVIDIA 获取)。

步骤 7:指定要使用的数据库

安装 Linux VDA 软件包后,您可以在 SQLite 和 PostgreSQL 之间切换。为此,请完成以下步骤:

注意:

  • 我们建议您仅在 VDI 模式下使用 SQLite,并在托管共享桌面交付模型中使用 PostgreSQL。
  • 对于简易安装和 MCS,您可以指定使用 SQLite 或 PostgreSQL,而无需手动安装它们。除非通过 /etc/xdl/db.conf 另行指定,否则 Linux VDA 默认使用 PostgreSQL。如果您需要自定义版本的 PostgreSQL,而不是您的 Linux 发行版提供的版本,则必须手动安装指定版本,编辑 /etc/xdl/db.conf 以反映新版本,并在运行简易安装脚本 (ctxinstall.sh) 或 MCS 脚本 (deploymcs.sh) 之前启动 PostgreSQL 服务。
  • 您还可以使用 /etc/xdl/db.conf 文件来配置 PostgreSQL 数据库系统的端口号。
  1. (可选)要使用自定义版本的 PostgreSQL,而不是您的 Linux 发行版提供的版本,请手动安装指定版本并启动 PostgreSQL 服务。
  2. 编辑 /etc/xdl/db.conf 以指定要使用的数据库。以下是 db.conf 文件的示例:

    # database configuration file for Linux VDA
    
    ## database choice
    # possible choices are:
    #     SQLite
    #     PostgreSQL
    # default choice is PostgreSQL
    DbType="PostgreSQL"
    
    
    ## database port
    # specify database port for the database.
    # if not specified, default port will be used:
    # SQLite: N/A
    # PostgreSQL: 5432
    DbPort=5432
    
    
    ## PostgreSQL customized
    # only the following value means true, otherwise false:
    #     true
    #     yes
    #     y
    #     YES
    #     Y
    # default is false
    DbCustomizePostgreSQL=false
    
    ## PostgreSQL service name
    # specify the service name of PostgreSQL for Linux VDA
    # default is "postgresql"
    DbPostgreSQLServiceName="postgresql"
    <!--NeedCopy-->
    

    To use a custom version of PostgreSQL, set DbCustomizePostgreSQL to true.

  3. Run sudo /opt/Citrix/VDA/sbin/ctxinstall.sh or /opt/Citrix/VDA/bin/easyinstall.

步骤 8:运行轻松安装以配置环境和 VDA 以完成安装

安装 Linux VDA 软件包后,通过使用 ctxinstall.sh 脚本或 GUI 配置运行环境。

注意:

在设置运行时环境之前,请确保您的操作系统中已安装 en_US.UTF-8 区域设置。如果您的操作系统中没有此区域设置,请运行 sudo locale-gen en_US.UTF-8 命令。对于 Debian,请通过取消注释 # en_US.UTF-8 UTF-8 行来编辑 /etc/locale.gen 文件,然后运行 sudo locale-gen 命令。

ctxinstall.sh

ctxinstall.sh 是用于执行一些预配置和设置 VDA 运行环境变量的轻松安装脚本。

  • 只有 root 用户才能运行此脚本。

  • 轻松安装使用 /opt/Citrix/VDA/sbin/ctxinstall.conf 作为其配置文件,以设置、保存和同步所有使用的环境变量的值。我们建议您仔细阅读模板 (ctxinstall.conf.tmpl),然后自定义您自己的 ctxinstall.conf。首次创建配置文件时,请使用以下任一方法:
    • By copying the /opt/Citrix/VDA/sbin/ctxinstall.conf.tmpl template file and saving it as /opt/Citrix/VDA/sbin/ctxinstall.conf.
    • By running ctxinstall.sh. Each time you run ctxinstall.sh, your input is saved in /opt/Citrix/VDA/sbin/ctxinstall.conf.
  • 轻松安装支持模块化运行。模块包括预检查、安装、域配置、设置和验证。

  • 此脚本的调试详细信息可在 /var/log/xdl/ctxinstall.log 中找到。

有关详细信息,请使用帮助命令 ctxinstall.sh -h

注意:

  • 遵循最小权限原则,确保只有 root 用户可以读取 /opt/Citrix/VDA/sbin/ctxinstall.conf,因为域加入密码可能在该文件中设置。
  • Uninstalling the Linux VDA removes files under /opt/Citrix/VDA. We recommend you back up /opt/Citrix/VDA/sbin/ctxinstall.conf before uninstalling the VDA.

您可以在交互模式或静默模式下运行 ctxinstall.sh。运行脚本之前,请设置以下环境变量:

  • CTX_XDL_NON_DOMAIN_JOINED=’y|n’ – 是否将计算机加入 域。默认值为 ‘n’。对于已加入域的场景,请将其设置为 ‘n’。

  • CTX_XDL_AD_INTEGRATION=’winbind|sssd|centrify|pbis|quest’ – The Linux VDA requires Kerberos configuration settings to authenticate with the Delivery Controllers. The Kerberos configuration is determined from the installed and configured Active Directory integration tool on the system.

  • CTX_XDL_DDC_LIST=’<list-ddc-fqdns>‘ – Linux VDA 需要一个以空格分隔的交付控制器完全限定域名 (FQDN) 列表,用于向交付控制器注册。必须至少指定一个 FQDN 或 CNAME。

  • CTX_XDL_VDI_MODE=’y|n’ – 是否将计算机配置为专用桌面交付模型 (VDI) 或托管共享桌面交付模型。对于 HDX 3D Pro 环境,请将该值设置为 ‘y’

  • CTX_XDL_HDX_3D_PRO=’y|n’ – Linux VDA 支持 HDX 3D Pro,这是一套旨在优化富图形应用程序虚拟化的 GPU 加速技术。如果选择 HDX 3D Pro,VDA 将配置为 VDI 桌面(单会话)模式 -(即 CTX_XDL_VDI_MODE=‘y’)。

  • CTX_XDL_START_SERVICE=’y|n’ – 此参数用于确定在配置过程完成后,Linux VDA 服务是否会自动启动。

  • CTX_XDL_REGISTER_SERVICE=’y|n’ – 此参数控制 Linux 虚拟桌面服务是否在计算机启动后自动启动。

  • CTX_XDL_ADD_FIREWALL_RULES=’y|n’ – Linux VDA 服务需要允许传入网络连接通过系统防火墙。您可以自动在系统防火墙中为 Linux Virtual Desktop 打开所需的端口(默认端口为 80 和 1494)。

  • CTX_XDL_DESKTOP_ENVIRONMENT=gnome/gnome-classic/kde/mate/xfce/’<none>‘ – Specifies the GNOME, GNOME Classic, KDE, MATE, or Xfce desktop environment to use in sessions. If you set it to ‘<none>‘, the default desktop configured on the VDA is used.

  • CTX_XDL_DOTNET_RUNTIME_PATH=path-to-install-dotnet-runtime – The path to install .NET for supporting the new broker agent service (ctxvda). The default path is ‘/usr/bin’.

  • CTX_XDL_VDA_PORT=端口号 – Linux 虚拟投递代理通过 TCP/IP 端口与交付控制器通信。

  • CTX_XDL_SITE_NAME=<dns-name> – Linux VDA 通过 DNS 发现 LDAP 服务器。要将 DNS 搜索结果限制到本地站点,请指定 DNS 站点名称。如果不需要,请设置为 ‘<none>‘

  • CTX_XDL_LDAP_LIST=’<list-ldap-servers>‘ – Linux VDA 会查询 DNS 以发现 LDAP 服务器。如果 DNS 无法提供 LDAP 服务记录,您可以提供一个以空格分隔的 LDAP 完全限定域名 (FQDN) 列表,其中包含 LDAP 端口信息。例如,ad1.mycompany.com:389 ad2.mycompany.com:3268 ad3.mycompany.com:3268。为了在 Active Directory 林中实现更快的 LDAP 查询,请在域控制器上启用全局编录功能,并将相关的 LDAP 端口号设置为 3268。此变量默认设置为 ‘<none>‘

  • CTX_XDL_SEARCH_BASE=search-base-set – The Linux VDA queries LDAP through a search base set to the root of the Active Directory Domain (for example, DC=mycompany,DC=com). To improve search performance, you can specify a search base (for example, OU=VDI,DC=mycompany,DC=com). If unnecessary, set to ‘<none>‘.

  • CTX_XDL_SUPPORT_DDC_AS_CNAME=’y|n’ – The Linux VDA supports specifying a Delivery Controller name using a DNS CNAME record.

  • CTX_EASYINSTALL_DNS=’<ip-address-of-dns>‘ – The IP address of DNS.

  • CTX_EASYINSTALL_HOSTNAME=host-name – The host name of the Linux VDA server.

  • CTX_EASYINSTALL_NTPS=address-of-ntps – The IP address or string name of the NTP server.

  • CTX_EASYINSTALL_REALM=realm-name – The Kerberos realm name.

  • CTX_EASYINSTALL_FQDN=ad-fqdn-name

  • CTX_EASYINSTALL_USERNAME=domain-user-name – The name of the user who joins the machine to the domain.

  • CTX_EASYINSTALL_PASSWORD=password – The password of the user who joins the machine to the domain.

注意:

我们建议您不要使用管理员帐户进行域加入。相反,请将域加入权限委派给除管理员帐户之外的 Active Directory 用户。为此,请使用 “委派控制向导” 在域控制器上委派控制权。

以下四个变量是可选的。即使未设置这些变量,ctxinstall.sh 也不会在静默模式下中止,并且在交互模式下不会提示您输入用户。您只能通过导出其值或编辑 /Citrix/VDA/sbin/ctxinstall.conf 来设置它们。

  • CTX_EASYINSTALL_NETBIOS_DOMAIN=netbios-domain-name – The NetBIOS domain name is typically the first component of the DNS domain name separated by a dot (.). Otherwise, customize a different NetBIOS domain name. This variable is optional.

  • CTX_EASYINSTALL_OU=ou-value – OU 值因不同的 AD 集成方法而异。有关 OU 值的示例,请参阅本文的注意事项部分中的表格。此变量是可选的。
  • CTX_EASYINSTALL_CENTRIFY_LOCAL_PATH=centrify-local-path – Easy install helps download the Centrify package from the Internet. However, if Centrify is already installed, you can fetch the Centrify package from a local directory defined by this variable. This variable is optional.
  • CTX_EASYINSTALL_PBIS_LOCAL_PATH= pbis-local-path – 轻松安装有助于从 Internet 下载 PBIS 软件包。但是,如果 PBIS 已安装,您可以从此变量定义的本地目录中获取 PBIS 软件包。此变量是可选的。

注意事项

  • The NetBIOS domain name is typically the first component of the DNS domain name separated by a dot (.). To customize a different NetBIOS domain name in your environment, set the environment variable CTX_EASYINSTALL_NETBIOS_DOMAIN in /opt/Citrix/VDA/sbin/ctxinstall.conf.

  • 要将 VDA 加入特定的 OU,请执行以下操作:

    1. 确保特定 OU 存在于域控制器上。

      有关 OU 示例,请参阅以下屏幕截图:

      OU 示例

    2. Set the environment variable CTX_EASYINSTALL_OU in /opt/Citrix/VDA/sbin/ctxinstall.conf.

      OU 值因不同的 AD 方法而异。下表反映了前面屏幕截图中的 OU 示例名称。您可以在组织中使用任何其他 OU 名称。

      操作系统 温绑定 SSSD (系统安全服务守护进程) 森特瑞 批比艾斯
      亚马逊 林纳克斯 2 "Linux/amazon" "Linux/amazon" "XD.LOCAL/Linux/amazon" "Linux/amazon"
      德比安 "Linux/debian" "Linux/debian" "XD.LOCAL/Linux/debian" "Linux/debian"
      RHEL 9.6/9.4/9.3/9.2/9.0, Rocky Linux 9.6/9.4/9.3/9.2/9.0 "OU=redhat,OU=Linux" "OU=redhat,OU=Linux" N/A N/A
      RHEL 8.x "OU=redhat,OU=Linux" "OU=redhat,OU=Linux" "XD.LOCAL/Linux/redhat" "Linux/redhat"
      洛基 林纳克斯 8.x "OU=redhat,OU=Linux" "OU=redhat,OU=Linux" 不适用 不适用
      红帽企业版 Linux 7 "Linux/redhat" "Linux/redhat" "XD.LOCAL/Linux/redhat" "Linux/redhat"
      苏斯 "Linux/suse" "Linux/suse" "XD.LOCAL/Linux/suse" "Linux/suse"
      乌班图 "Linux/ubuntu" "Linux/ubuntu" "XD.LOCAL/Linux/ubuntu" "Linux/ubuntu"
  • Centrify 不支持纯 IPv6 DNS 配置。在 /etc/resolv.conf 中,需要至少一个使用 IPv4 的 DNS 服务器,以便 adclient 能够正确查找 AD 服务。

    日志:

     ADSITE   : Check that this machine's subnet is in a site known by AD   : Failed
              : This machine's subnet is not known by AD.
              : We guess you should be in the site Site1.
     <!--NeedCopy-->
    

    此问题是 Centrify 及其配置特有的。要解决此问题,请执行以下操作:

    a. 在域控制器上打开管理工具。 b. 选择Active Directory 站点和服务。 c. 为子网添加适当的子网地址。

  • 轻松安装支持纯 IPv6,从 Linux VDA 7.16 开始。以下先决条件和限制适用:

    • 您的 Linux 存储库必须配置为确保您的计算机可以通过纯 IPv6 网络下载所需的软件包。
    • Centrify 软件在纯 IPv6 网络上不受支持。

    注意:

    如果您的网络是纯 IPv6 且所有输入都采用正确的 IPv6 格式,则 VDA 会通过 IPv6 向 Delivery Controller™ 注册。如果您的网络具有混合的 IPv4IPv6 配置,则第一个 DNS IP 地址的类型决定了是使用 IPv4 还是 IPv6 进行注册。

  • 您可以使用 CTX_XDL_DESKTOP_ENVIRONMENT 变量指定要在会话中使用的桌面环境,如前所述。您还可以通过运行命令或使用系统托盘在桌面环境之间切换。有关详细信息,请参阅桌面切换命令系统托盘

  • 如果您选择 Centrify 作为加入域的方法,则 ctxinstall.sh 脚本需要 Centrify 软件包。以下是 ctxinstall.sh 获取 Centrify 软件包的方式:

  • 如果您选择 PBIS 作为加入域的方法,则 ctxinstall.sh 脚本需要 PBIS 软件包。ctxinstall.sh 获取 PBIS 软件包的方式如下:

交互模式

要在交互模式下运行 ctxinstall.sh 脚本,请使用不带 -S 选项的 sudo /opt/Citrix/VDA/sbin/ctxinstall.sh 命令。在命令行界面中的每个提示符处键入相关的变量值。如果变量已设置,ctxinstall.sh 会询问您是否要更改它以进行确认。

静默模式

在静默模式下,您必须使用 /opt/Citrix/VDA/sbin/ctxinstall.conf 或 export 命令设置上述变量。之后,运行 ctxinstall.sh -S(请注意,这里的字母 S大写的)。如果并非所有必需变量都已设置或某些值无效,ctxinstall.sh 将中止执行,除非存在默认值。

除非未设置,否则每个变量的导出值会覆盖 /Citrix/VDA/sbin/ctxinstall.conf 中的值。所有更新的值都保存在 /Citrix/VDA/sbin/ctxinstall.conf 中,但域加入密码除外。因此,在静默模式下,您必须在 /Citrix/VDA/sbin/ctxinstall.conf 中设置域加入密码或导出密码。

export CTX_XDL_NON_DOMAIN_JOINED='n'
export CTX_XDL_AD_INTEGRATION=winbind|centrify|sssd|pbis|quest
export CTX_XDL_DDC_LIST='<list-ddc-fqdns>'
export CTX_XDL_VDI_MODE='y|n'
export CTX_XDL_HDX_3D_PRO='y|n'
export CTX_XDL_START_SERVICE='y|n'
export CTX_XDL_REGISTER_SERVICE='y|n'
export CTX_XDL_ADD_FIREWALL_RULES='y|n'
export CTX_XDL_DESKTOP_ENVIRONMENT=gnome|gnome-classic|kde|mate|xfce|'<none>'
export CTX_XDL_DOTNET_RUNTIME_PATH='<path-to-install-dotnet-runtime>'
export CTX_XDL_VDA_PORT='<port-number>'
export CTX_XDL_SITE_NAME='<dns-site-name>'|'<none>'
export CTX_XDL_LDAP_LIST='<list-ldap-servers>'|'<none>'
export CTX_XDL_SEARCH_BASE='<search-base-set>'|'<none>'
export CTX_XDL_SUPPORT_DDC_AS_CNAME='y|n'
export CTX_EASYINSTALL_DNS='<ip-address-of-dns>'
export CTX_EASYINSTALL_HOSTNAME='<host-name>'
export CTX_EASYINSTALL_NTPS='<address-of-ntps>'
export CTX_EASYINSTALL_REALM='<realm-name>'
export CTX_EASYINSTALL_FQDN='<ad-fqdn-name>'
export CTX_EASYINSTALL_USERNAME='<domain-user-name>'
export CTX_EASYINSTALL_PASSWORD='<password>'
export CTX_EASYINSTALL_NETBIOS_DOMAIN='<netbios-domain>'
export CTX_EASYINSTALL_OU='<organization-unit>'
sudo -E /opt/Citrix/VDA/sbin/ctxinstall.sh -S
<!--NeedCopy-->

运行 sudo 命令时,键入 -E 选项以将现有环境变量传递给它创建的新 shell。我们建议您使用 #!/bin/bash 作为第一行,从上述命令创建一个 shell 脚本文件。

或者,您可以使用单个命令指定所有变量。

要设置 VDA 运行环境变量(以“CTX_XDL_”开头的变量),您可以运行 ctxinstall.sh -s(请注意,这里的字母 s小写的)。

GUI

您可以通过 GUI 使用简易安装。在您的 VDA 的桌面环境中运行 /opt/Citrix/VDA/bin/easyinstall 命令,然后按照简易安装 GUI 上的说明进行操作。

简易安装 GUI

简易安装 GUI 将引导您完成以下操作:

  • 检查系统运行环境
  • 安装依赖项
  • 将 VDA 加入指定域
  • 对运行时环境进行配置

提示:

单击“保存”将变量设置保存到您指定的路径下的本地文件。单击“加载”从您指定的文件加载变量设置。有关配置 MCS 变量的信息,请参阅步骤 3:准备主映像

步骤 9:运行 XDPing

运行 sudo /opt/Citrix/VDA/bin/xdping 以检查 Linux VDA 环境中的常见配置问题。有关详细信息,请参阅XDPing

步骤 10:运行 Linux 虚拟投递代理

启动 Linux 虚拟投递代理:

要启动 Linux 虚拟投递代理服务:

sudo systemctl start ctxhdx.service

sudo systemctl start ctxvda.service
<!--NeedCopy-->

停止 Linux 虚拟投递代理:

要停止 Linux 虚拟投递代理服务:

sudo systemctl stop ctxvda.service

sudo systemctl stop ctxhdx.service
<!--NeedCopy-->

注意:

在停止 ctxvdactxhdx 服务之前,请运行 systemctl stop ctxmonitord 命令以停止监视服务守护程序。否则,监视服务守护程序会重新启动您停止的服务。

重新启动 Linux 虚拟投递代理:

要重新启动 Linux VDA 服务:

sudo systemctl stop ctxvda.service

sudo systemctl restart ctxhdx.service

sudo systemctl start ctxvda.service
<!--NeedCopy-->

检查 Linux 虚拟投递代理的状态:

要检查 Linux VDA 服务的运行状态:

sudo systemctl status ctxvda.service

sudo systemctl status ctxhdx.service
<!--NeedCopy-->

步骤 11:创建计算机目录

创建计算机目录和添加 Linux VDA 计算机的过程与传统的 Windows VDA 方法类似。有关如何完成这些任务的详细说明,请参阅 创建计算机目录管理计算机目录

对于包含 Linux VDA 计算机的计算机目录的创建,存在一些限制,这些限制使其与为 Windows VDA 计算机创建计算机目录的过程有所不同:

  • 对于操作系统,请选择:
    • 适用于托管共享桌面交付模型的 多会话操作系统 选项。
    • 适用于 VDI 专用桌面交付模型的 单会话操作系统 选项。
  • 请勿在同一计算机目录中混合使用 Linux 和 Windows VDA 计算机。

注意:

Citrix Studio 的早期版本不支持“Linux 操作系统”的概念。但是,选择 Windows Server OSServer OS 选项意味着等效的托管共享桌面交付模型。选择 Windows Desktop OSDesktop OS 选项意味着每个计算机一个用户的交付模型。

提示:

如果您将计算机从 Active Directory 域中移除并重新加入,则必须再次将该计算机从计算机目录中移除并添加。

步骤 12: 创建交付组

创建包含 Linux VDA 计算机的交付组和添加计算机目录的过程与 Windows VDA 计算机几乎相同。有关如何完成这些任务的更详细说明,请参阅创建交付组

对于创建包含 Linux VDA 计算机目录的交付组,适用以下限制:

  • 确保您选择的 AD 用户和组已正确配置为可以登录到 Linux VDA 计算机。
  • 不允许未经身份验证(匿名)的用户登录。
  • 请勿将交付组与包含 Windows 计算机的计算机目录混合使用。

重要:

Linux VDA 1.4 版及更高版本支持发布应用程序。但是,Linux VDA 不支持将桌面和应用程序交付到同一台计算机。

有关如何创建计算机目录和交付组的信息,请参阅 Citrix 虚拟应用和桌面 7 2402 LTSR

步骤 13: 升级 Linux VDA(可选)

Linux VDA 支持从最新版本进行升级。例如,您可以将 Linux VDA 从 2308 升级到 2311,以及从 1912 LTSR 升级到 2203 LTSR。

对于 红帽企业版 Linux 7 和 社区企业操作系统 7:

sudo rpm -U XenDesktopVDA-<version>.el7_x.x86_64.rpm
<!--NeedCopy-->

针对 RHEL 8 和 Rocky Linux 8 版本,以下是相关说明:

sudo rpm -U XenDesktopVDA-<version>.el8_x.x86_64.rpm
<!--NeedCopy-->

针对 RHEL 9.3/9.2/9.0 和 Rocky Linux 9.3/9.2/9.0 操作系统版本,请务必仔细阅读并按照以下步骤进行操作:

注意:

在 RHEL 9.6/9.4/9.3/9.2/9.0 和 Rocky Linux 9.6/9.4/9.3/9.2/9.0 上升级 Linux VDA 之前,请将 libsepol 软件包更新到版本 3.4 或更高版本。

sudo rpm -U XenDesktopVDA-<version>.el9x.x86_64.rpm
<!--NeedCopy-->

适用于 SUSE:

sudo rpm -U XenDesktopVDA-<version>.sle15_x.x86_64.rpm
<!--NeedCopy-->

针对 Ubuntu 20.04 操作系统:

sudo dpkg -i xendesktopvda_<version>.ubuntu20.04_amd64.deb
<!--NeedCopy-->

针对 Ubuntu 22.04 操作系统:

sudo dpkg -i xendesktopvda_<version>.ubuntu22.04_amd64.deb
<!--NeedCopy-->

故障排除

使用本节中的信息来排查在使用简易安装功能时可能出现的问题。

使用 SSSD 加入域失败

尝试加入域时可能会发生错误,输出类似于以下内容(验证日志以进行屏幕打印):

Step 6: join Domain!Enter ctxadmin's password:Failed to join domain: failed to lookup DC info for domain 'CITRIXLAB.LOCAL' over rpc: The network name cannot be found

/var/log/xdl/vda.log:

2016-11-04 02:11:52.317 [INFO ] - The Citrix Desktop Service successfully obtained the following list of 1 delivery controller(s) with which to register: 'CTXDDC.citrixlab.local (10.158.139.214)'.
2016-11-04 02:11:52.362 [ERROR] - RegistrationManager.AttemptRegistrationWithSingleDdc: Failed to register with http://CTXDDC.citrixlab.local:80/Citrix/CdsController/IRegistrar. Error: General security error (An error occurred in trying to obtain a TGT: Client not found in Kerberos database (6))
2016-11-04 02:11:52.362 [ERROR] - The Citrix Desktop Service cannot connect to the delivery controller 'http://CTXDDC.citrixlab.local:80/Citrix/CdsController/IRegistrar' (IP Address '10.158.139.214')
Check the following:- The system clock is in sync between this machine and the delivery controller.
-  The Active Directory provider (e.g. winbind daemon) service is running and correctly configured.
-  Kerberos is correctly configured on this machine.
If the problem persists, please refer to Citrix Knowledge Base article CTX117248 for further information.
Error Details:
Exception 'General security error (An error occurred in trying to obtain a TGT: Client not found in Kerberos database (6))' of type 'class javax.xml.ws.soap.SOAPFaultException'.
2016-11-04 02:11:52.362 [INFO ] - RegistrationManager.AttemptRegistrationWithSingleDdc: The current time for this VDA is Fri Nov 04 02:11:52 EDT 2016.
Ensure that the system clock is in sync between this machine and the delivery controller.
Verify the NTP daemon is running on this machine and is correctly configured.
2016-11-04 02:11:52.364 [ERROR] - Could not register with any controllers. Waiting to try again in 120000 ms. Multi-forest - false
2016-11-04 02:11:52.365 [INFO ] - The Citrix Desktop Service failed to register with any controllers in the last 470 minutes.
<!--NeedCopy-->

/var/log/messages:

Nov 4 02:15:27 RH-WS-68 [sssd[ldap_child[14867]]]: Failed to initialize credentials using keytab [MEMORY:/etc/krb5.keytab]: Client 'RH-WS-68$@CITRIXLAB.LOCAL' not found in Kerberos database. Unable to create GSSAPI-encrypted LDAP connection.Nov 4 02:15:27 RH-WS-68 [sssd[ldap_child[14867]]]: Client 'RH-WS-68$@CITRIXLAB.LOCAL' not found in Kerberos database

要解决此问题:

  1. 运行 rm -f /etc/krb5.keytab 命令。
  2. 运行 net ads leave $REALM -U $domain-administrator 命令。
  3. 在 Delivery Controller 上删除计算机目录和交付组。
  4. Run /opt/Citrix/VDA/sbin/ctxinstall.sh.
  5. 在 Delivery Controller 上创建计算机目录和交付组。

Ubuntu 桌面会话显示灰屏

当您启动会话后,会话被阻止在空白桌面上时,会出现此问题。此外,当您使用本地用户帐户登录时,计算机控制台也会显示灰屏。

要解决此问题:

  1. 运行 sudo apt-get update 命令。
  2. 运行 sudo apt-get install unity lightdm 命令。
  3. 将以下行添加到 /etc/lightdm/lightdm.conf: greeter-show-manual-login=true

尝试启动 Ubuntu 桌面会话失败,因为缺少主目录

/var/log/xdl/hdx.log:

2016-11-02 13:21:19.015 <P22492:S1> citrix-ctxlogin: StartUserSession: failed to change to directory(/home/CITRIXLAB/ctxadmin) errno(2)

2016-11-02 13:21:19.017 <P22227> citrix-ctxhdx: logSessionEvent: Session started for user ctxadmin.

2016-11-02 13:21:19.023 <P22492:S1> citrix-ctxlogin: ChildPipeCallback: Login Process died: normal.

2016-11-02 13:21:59.217 <P22449:S1> citrix-ctxgfx: main: Exiting normally.
<!--NeedCopy-->

提示:

此问题的根本原因在于,系统未自动为域管理员创建其个人主目录。

要解决此问题,请执行以下操作:

  1. 在命令行界面中,执行 pam-auth-update 命令。

  2. 在出现的对话框中,验证是否已选择 创建主目录登录

    Ubuntu 无法启动会话

会话未启动或因 dbus 错误而快速结束

请检查此日志文件以获取更多详细信息:/var/log/messages (适用于 RHEL 或 CentOS 操作系统)

Oct 27 04:17:16 CentOS7 citrix-ctxhdx[8978]: Session started for user CITRIXLAB\ctxadmin.

Oct 27 04:17:18 CentOS7 kernel: traps: gnome-session[19146] trap int3 ip:7f89b3bde8d3 sp:7fff8c3409d0 error:0

Oct 27 04:17:18 CentOS7 gnome-session[19146]: ERROR: Failed to connect to system bus: Exhausted all available authentication mechanisms (tried: EXTERNAL, DBUS_COOKIE_SHA1, ANONYMOUS) (available: EXTERNAL, DBUS_COOKIE_SHA1, ANONYMOUS)#012aborting...

Oct 27 04:17:18 CentOS7 gnome-session: gnome-session[19146]: ERROR: Failed to connect to system bus: Exhausted all available authentication mechanisms (tried: EXTERNAL, DBUS_COOKIE_SHA1, ANONYMOUS) (available: EXTERNAL, DBUS_COOKIE_SHA1, ANONYMOUS)

Oct 27 04:17:18 CentOS7 gnome-session: aborting...

Oct 27 04:17:18 CentOS7 citrix-ctxgfx[18981]: Exiting normally.

Oct 27 04:17:18 CentOS7 citrix-ctxhdx[8978]: Session stopped for user CITRIXLAB\ctxadmin.
<!--NeedCopy-->

或者,对于 Ubuntu 发行版,请使用日志 /var/log/syslog:

Nov  3 11:03:52 user01-HVM-domU pulseaudio[25326]: [pulseaudio] pid.c: Stale PID file, overwriting.

Nov  3 11:03:52 user01-HVM-domU pulseaudio[25326]: [pulseaudio] bluez5-util.c: Failed to get D-Bus connection: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Nov  3 11:03:52 user01-HVM-domU pulseaudio[25326]: [pulseaudio] hashmap.c: Assertion 'h' failed at pulsecore/hashmap.c:116, function pa_hashmap_free(). Aborting.

Nov  3 11:03:52 user01-HVM-domU pulseaudio[25352]: [pulseaudio] core-util.c: Failed to connect to system bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Nov  3 11:03:52 user01-HVM-domU pulseaudio[25352]: message repeated 10 times: [ [pulseaudio] core-util.c: Failed to connect to system bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.]

Nov  3 11:03:52 user01-HVM-domU pulseaudio[25352]: [pulseaudio] pid.c: Daemon already running.Nov  3 11:03:58 user01-HVM-domU citrix-ctxgfx[24693]: Exiting normally
<!--NeedCopy-->

某些组或模块在重新启动后才会生效。如果日志中出现 dbus 错误消息,建议您重新启动系统并重试。

SELinux 阻止 SSHD 访问用户主目录

用户可以启动会话,但无法登录。

/var/log/xdl/ctxinstall.log:

Jan 25 23:30:31 yz-rhel72-1 setroubleshoot[3945]: SELinux is preventing /usr/sbin/sshd from setattr access on the directory /root. For complete SELinux messages. run sealert -l 32f52c1f-8ff9-4566-a698-963a79f16b81

Jan 25 23:30:31 yz-rhel72-1 python[3945]: SELinux is preventing /usr/sbin/sshd from setattr access on the directory /root.

*****  Plugin catchall_boolean (89.3 confidence) suggests   ******************

If you want to allow polyinstantiation to enabled

   Then you must tell SELinux about this by enabling the 'polyinstantiation_enabled' boolean.

You can read 'None' man page for more details.

    Do

       setsebool -P polyinstantiation_enabled 1

*****  Plugin catchall (11.6 confidence) suggests   **************************

If you believe that sshd should be allowed setattr access on the root directory by default.

Then you should report this as a bug.

You can generate a local policy module to allow this access.

      Do

       allow this access for now by executing:

       # grep sshd /var/log/audit/audit.log | audit2allow -M mypol

# semodule -i mypol.pp
<!--NeedCopy-->

要解决此问题,请执行以下操作:

  1. 通过在 /etc/selinux/config 文件中进行如下所示的更改,来禁用 SELinux。

    SELINUX=disabled

  2. 重新启动 VDA。