Product Documentation

Prepare the Linux machine for Virtual Desktop installation

Sep 27, 2016

Verify the network configuration

Citrix recommends that the network is connected and properly configured correctly before proceeding.

Set the hostname

To ensure that the hostname of the machine is reported correctly, change the /etc/hostname file to contain only the hostname of the machine.

command 複製

HOSTNAME=hostname

Assign a loopback address to the hostname

To ensure that the DNS domain name and FQDN of the machine are reported back correctly, change the following line of the /etc/hosts file to include the FQDN and hostname as the first two entries:

command 複製

127.0.0.1  hostname-fqdn hostname localhost

localhost.localdomain localhost4 localhost4.localdomain4

For example:

command 複製

127.0.0.1  vda01.example.com vda01 localhost

localhost.localdomain localhost4 localhost4.localdomain4

Remove any other references to hostname-fqdn or hostname from other entries in the file.

注意

The Linux VDA currently does not support NetBIOS name truncation, therefore the hostname must not exceed 15 characters.

提示

Use a-z, A-Z, 0-9 and hyphen (-) characters only. Avoid underscrore characters (_), spaces and other symbols. Do not start a hostname with a number and do not end with a hyphen.

Check the hostname

Verify that the hostname is set correctly:

command 複製

hostname

This should return only the machine's host name and not its fully qualified domain name (FQDN).

Verify that the FQDN is set correctly:

command 複製

hostname -f

This should return the machine's FQDN.

Check name resolution and service reachability

Verify that you can resolve the FQDN and ping the domain controller and XenDesktop Delivery Controller:

command 複製

nslookup domain-controller-fqdn

ping domain-controller-fqdn

nslookup delivery-controller-fqdn

ping delivery-controller-fqdn

If you cannot resolve the FQDN or ping either of these machines, review the steps before proceeding.

Configure clock synchronization (NTP)

Maintaining accurate clock synchronization between the VDAs, XenDesktop Controllers and domain controllers is crucial. Hosting the Linux VDA as a virtual machine can cause clock skew problems. For this reason, synchronizing time with a remote time service is preferred.

RHEL 6.x and earlier releases use the NTP daemon (ntpd) for clock synchronization, whereas a default RHEL 7.x environment uses the newer Chrony daemon (chronyd) instead. The configuration and operational process between the two services is similar.

As root, edit /etc/ntp.conf and add a server entry for each remote time server:

command 複製

server peer1-fqdn-or-ip-address iburst

server peer2-fqdn-or-ip-address iburst

In a typical deployment, time should be synchronized from the local domain controllers and not directly from public NTP pool servers. Add a server entry for each Active Directory domain controller in the domain.

Remove any other server entries listed including loopback IP address, localhost, and public server *.pool.ntp.org entries.

Save changes and restart the NTP daemon:

command 複製

sudo /sbin/service ntpd restart

Install OpenJDK

The Linux VDA is dependent on OpenJDK. The runtime environment should have been installed as part of the operating system installation.

Confirm the correct version with:

command 複製

sudo yum info java-1.7.0-openjdk

The pre-packaged OpenJDK may be an earlier version. Update to the latest version as required:

command 複製

sudo yum -y update java-1.7.0-openjdk

Set the JAVA_HOME environment variable by adding the following line to ~/.bashrc file:

command 複製

export JAVA_HOME=/usr/lib/jvm/java

Open a new shell and verify the version of Java:

command 複製

java –version

提示

To avoid problems, make sure you only installed either OpenJDK version 1.7.0 or 1.8.0. Remove all other versions of Java on your system.

Install PostgreSQL

The Linux VDA requires either PostgreSQL 8.4 or newer on RHEL 6.

Install the following packages:

command 複製

sudo yum -y install postgresql-server

sudo yum -y install postgresql-jdbc

The following post-installation step is required to initialize the database and ensure service starts on boot. This will create database files under /var/lib/pgsql/data

command 複製

sudo /sbin/service postgresql initdb

Start PostgreSQL

For either version PostgreSQL, configure the service to start on boot, and to start now:

command 複製

sudo /sbin/chkconfig postgresql on

sudo /sbin/service postgresql start

Check the version of PostgreSQL using:

command 複製

psql --version

Verify that the data directory is set using the psql command-line utility:

command 複製

sudo -u postgres psql -c 'show data_directory'

Prepare the Linux VM for hypervisor

Some changes are required when running the Linux VDA as a virtual machine on a supported hypervisor. Make the following changes according to the hypervisor platform in use. No changes are required if you are running the Linux machine on bare metal hardware.

Fix time synchronization on Citrix XenServer

If the XenServer Time Sync feature is enabled, within each paravirtualized Linux VM you will experience issues with NTP and XenServer both trying to manage the system clock. To avoid the clock becoming out of sync with other servers, the system clock within each Linux guest must be synchronized with NTP. This requires disabling host time synchronization. No changes are required in HVM mode.

On some Linux distributions, if you are running a paravirtualized Linux kernel with XenServer Tools installed, you can check whether the XenServer Time Sync feature is present and enabled from within the Linux VM:

command 複製

su -

cat /proc/sys/xen/independent_wallclock

This will return either:

  • 0 - The time sync feature is enabled, and needs to be disabled.
  • 1 - The time sync feature is disabled, and no further action is required.

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

If enabled, disable the time sync feature by writing 1 to the file:

command 複製

sudo echo 1 > /proc/sys/xen/independent_wallclock

To make this change permanent and persist after reboot, edit the /etc/sysctl.conf file and add the line:

command 複製

xen.independent_wallclock = 1

To verify these changes, reboot the system:

command 複製

su -

cat /proc/sys/xen/independent_wallclock

This should return the value 1.

Fix time synchronization on Microsoft Hyper-V

Linux VMs with Hyper-V Linux Integration Services installed can leverage the Hyper-V time synchronization feature to use the host operating system's time. To ensure the system clock remains accurate, this feature should be enabled alongside NTP services.

From the management operating system:

  1. Open the Hyper-V Manager console. 
  2. For the settings of a Linux VM, select Integration Services
  3. Ensure Time synchronization is selected. 

注意

This approach is different from VMware and XenServer, where host time synchronization is disabled to avoid conflicts with NTP. Hyper-V time synchronization can co-exist and supplement NTP time synchronization.

Fix time synchronization on ESX and ESXi

If the VMware Time Synchronization feature is enabled, within each paravirtualized Linux VM you will experience issues with NTP and the hypervisor both trying to synchronize the system clock. To avoid the clock becoming out of sync with other servers, the system clock within each Linux guest must be synchronized with NTP. This requires disabling host time synchronization.

If you are running a paravirtualized Linux kernel with VMware Tools installed:

  1. Open the vSphere Client.
  2. Edit settings for the Linux VM.
  3. In the Virtual Machine Properties dialog, open the Options tab.
  4. Select VMware Tools.
  5. In the Advanced box, uncheck Synchronize guest time with host.

Add Linux machine to Windows domain

There are a number of methods for adding Linux machines to the Active Directory domain that are supported by XenDesktop for Linux:

  • Samba Winbind
  • Quest Authentication Service
  • Centrify DirectControl

Follow the instructions below for your chosen method.

Samba Winbind

Install or Update Required Packages

Install or update the required packages:

command 複製

sudo yum -y install samba-winbind \

samba-winbind-clients \

krb5-workstation \

authconfig \

oddjob-mkhomedir

Enable Winbind Daemon to Start on Boot

The Winbind daemon must be configured to start on boot:

command 複製

sudo /sbin/chkconfig winbind on

Configure Winbind Authentication

Configure the machine for Kerberos authentication using Winbind:

command 複製

sudo authconfig \

--disablecache \

--disablesssd \

--disablesssdauth \

--enablewinbind \

--enablewinbindauth \

--disablewinbindoffline \

--smbsecurity=ads \

--smbworkgroup=domain \

--smbrealm=REALM \

--krb5realm=REALM \

--krb5kdc=fqdn-of-domain-controller \

--winbindtemplateshell=/bin/bash \

--enablemkhomedir --updateall

Where REALM is the Kerberos realm name in upper-case and domain is the short NetBIOS name of the Active Directory domain.

If DNS-based lookups of the KDC server and realm name is required, add the following two options to the above command:

command 複製

--enablekrb5kdcdns --enablekrb5realmdns

Ignore any errors returned from the authconfig command about the winbind service failing to start. These are due to authconfig trying to start the winbind service without the machine yet being joined to the domain.

Open /etc/samba/smb.conf and add the following entries under the [Global] section, but after the section generated by the authconfig tool:

command 複製

kerberos method = secrets and keytab

winbind refresh tickets = true

The system keytab file /etc/krb5.keytab is required by the Linux VDA to authenticate and register with the Delivery Controller. The kerberos method setting above will force Winbind to create the system keytab file when the machine is first joined to the domain. 

Join Windows Domain

This requires that your domain controller is reachable and you have a Active Directory user account with permissions to add computers to the domain:

command 複製

sudo net ads join REALM -U user

Where REALM is the Kerberos realm name in upper-case, and user is a domain user with permissions to add computers to the domain.

Configure PAM for Winbind

By default, the configuration for the Winbind PAM module (pam_winbind) does not enable Kerberos ticket caching and home directory creation. Open /etc/security/pam_winbind.conf and add or change the following entries under the [Global] section:

command 複製

krb5_auth = yes

krb5_ccache_type = FILE

mkhomedir = yes

Ensure any leading semi-colons from each setting are removed. These changes require restarting the Winbind daemon:

command 複製

sudo /sbin/service winbind restart

提示

The winbind daemon will only stay running if the machine is joined to a domain.

Open /etc/krb5.conf and change the following setting under the [libdefaults] section from KEYRING to FILE type:

command 複製

default_ccache_name = FILE:/tmp/krb5cc_%{uid}

Verify Domain Membership

The XenDesktop Controller requires that all VDA machines, whether Windows or Linux, have a computer object in Active Directory.

Verify the machine is joined to a domain using Samba's net ads command:

command 複製

sudo net ads testjoin

Additional domain and computer object information can be verified with:

command 複製

sudo net ads info

Verify Kerberos Configuration

To verify Kerberos is configured correctly for use with the Linux VDA, check that the system keytab file has been created and contains valid keys:

command 複製

sudo klist -ke

This should display the list of keys available for the various combinations of principal names and cipher suites. Run the Kerberos kinit command to authenticate the machine with the domain controller using these keys:

command 複製

sudo kinit -k MACHINE\$@REALM

The machine and realm names must be specified in uppercase, and the dollar sign ($) must be escaped with a backslash (\) to prevent shell substitution. In some environments the DNS domain name is different from the Kerberos realm name; ensure the realm name is used. If this command is successful, no output is displayed.

Verify that the TGT ticket for the machine account has been cached using:

Code 複製

sudo klist

Examine the machine’s account details using:

command 複製

sudo net ads status

Verify User Authentication

Use the wbinfo tool to verify that domain users can authenticate with the domain:

command 複製

wbinfo --krb5auth=domain\\username%password

The domain specified here is the AD domain name, not the Kerberos realm name. For the bash shell, the backslash (\) character must be escaped with another backslash. This command will return a message indicating success or failure.

To verify that the Winbind PAM module is configured correctly, logon locally with a domain user account that has not logged onto the machine previously:

command 複製

ssh localhost -l domain\\username

id -u

Check that the tickets in the user’s Kerberos credential cache are valid and not expired:

command 複製

klist

Exit the session:

command 複製

exit

A similar test can be performed by logging onto the Gnome or KDE console directly.

Quest authentication service

Configure Quest on Domain Controller

This assumes you have installed and configured the Quest software on the Active Directory domain controllers, and have been granted administrative privileges to create computer objects in Active Directory.

Enable Domain Users to Logon to Linux VDA Machines

For each domain user that needs to establish HDX sessions on a Linux VDA machine:

  1. In the Active Directory Users and Computers management console, open Active Directory user properties for that user account.
  2. Select Unix Account tab.
  3. Check Unix-enabled.
  4. Set the Primary GID Number to the group ID of an actual domain user group.

注意

These instructions are equivalent for setting up domain users for logon using the console, RDP, SSH or any other remoting protocol.

Configure Quest on Linux VDA 

Workaround SELinux Policy Enforcement

The default RHEL environment has SELinux fully enforced. This interferes with the Unix domain socket IPC mechanisms used by Quest and prevents domain users from logging on.

提示

There are a few ways to workaround outlined here.

The easiest is to disable SELinux. As root, edit /etc/selinux/config and change the SELinux setting:

command 複製

SELINUX=disabled

This change requires a reboot:

command 複製

reboot

Important

Use this setting carefully. Reenabling SELinux policy enforcement after disabling can cause a complete lockout, even for the root user and other local users. 

Configure VAS daemon

Auto-renewal of Kerberos tickets needs to be enabled and disconnected; authentication (offline logon) needs to be disabled:

command 複製

sudo /opt/quest/bin/vastool configure vas vasd \

     auto-ticket-renew-interval 32400

sudo /opt/quest/bin/vastool configure vas vas_auth \

     allow-disconnected-auth false

This sets the renewal interval to 9 hours (32400 seconds) which is an hour less than the default 10 hour ticket lifetime. Set this parameter to a lower value on systems with a shorter ticket lifetime.

Configure PAM and NSS

Quest requires that PAM and NSS be manually configured to enable domain user login via HDX and other services such as su, ssh, and RDP. To configure PAM and NSS:

command 複製

sudo /opt/quest/bin/vastool configure pam

sudo /opt/quest/bin/vastool configure nss

Join Windows Domain

Join the Linux machine to the Active Directory domain using the Quest vastool command:

command 複製

sudo /opt/quest/bin/vastool -u user join domain-name

The user is any domain user with permissions to join computers to the Active Directory domain. The domain-name is the DNS name of the domain; for example, example.com.

Verify Domain Membership

The XenDesktop Controller requires that all VDA machines, whether Windows or Linux, have a computer object in Active Directory. To verify that a Quest-joined Linux machine is on the domain:

command 複製

sudo /opt/quest/bin/vastool info domain

If the machine is joined to a domain this will return the domain name. If not joined, you will see the following error:

command 複製

ERROR: No domain could be found.

ERROR: VAS_ERR_CONFIG: at ctx.c:414 in _ctx_init_default_realm

default_realm not configured in vas.conf. Computer may not be joined to domain

Verify User Authentication

To verify that Quest can authenticate domain users using PAM, logon with a domain user account that has not logged onto the machine previously:

command 複製

ssh localhost -l domain\\username

id -u

Check that a corresponding Kerberos credential cache file was created for the UID returned by the id -u command:

command 複製

ls /tmp/krb5cc_uid

Check that the tickets in user’s Kerberos credential cache are valid and not expired:

command 複製

/opt/quest/bin/vastool klist

Exit the session:

command 複製

exit

A similar test can be performed by logging onto the Gnome or KDE console directly.

Centrify DirectControl

Join Windows Domain

With the Centrify DirectControl Agent installed, join the Linux machine to the Active Directory domain using the Centrify adjoin command:

command 複製

su – 

adjoin -w -V -u user domain-name

The user parameter is any Active Directory domain user with permissions to join computers to the Active Directory domain. The domain-name parameter is the name of the domain to join the Linux machine to.

Verify Domain Membership

The XenDesktop Controller requires that all VDA machines, whether Windows or Linux, have a computer object in Active Directory. To verify that a Centrify-joined Linux machine is on the domain:

command 複製

su –

adinfo

Check that the Joined to domain value is valid and the CentrifyDC mode returns connected. If the mode remains stuck in the starting state, then the Centrify client is experiencing server connection or authentication problems.

More comprehensive system and diagnostic information is available using:

command 複製

adinfo --sysinfo all

adinfo –diag

To test connectivity to the various Active Directory and Kerberos services:

command 複製

adinfo --test

Install NVIDIA GRID drivers 

To enable HDX 3D Pro, additional installation steps are required to install the required graphics drivers on the hypervisor as well as to the VDA machines.

Configure the following:

  1. Citrix XenServer 
  2. VMware ESX

Follow the instructions for your chosen hypervisor.

Citrix XenServer 

This detailed section walks through the install and configuration of the NVIDIA GRID drivers on Citrix XenServer

VMware ESX 

Follow the information contained in this guide to install and configure the NVIDIA GRID drivers for VMware ESX.

VDA Machines 

Follow these steps to  to install and configure the drivers for each of the Linux VM guests:

  1. Before starting ensure the Linux VM is shutdown.
  2. In XenCenter, add a GPU in GPU Passthrough mode to the VM.
  3. Start the RHEL VM.

To prepare the machine for the NVIDIA GRID drivers the following steps are required:

command 複製

# yum install gcc

# yum install "kernel-devel-uname-r == $(uname -r)"

# systemctl set-default multi-user.target

Once complete, follow the steps in the Red Hat Enterprise Linux document to install the NVIDIA GRID Driver.

注意

During the GPU driver install, select the default ('no') for each question. 

Important

Once GPU Passthrough has been enabled, the Linux VM is no longer accessable via XenCenter so you wil need to use SSH to connect.

localized image

Set the correct configuration for the card:

command 複製

etc/X11/ctx-nvidia.sh

To take advantage of large resolutions and multimonitor capabilities you will need a valid NVIDIA license. To apply the license follow the product documentation from “GRID Licensing Guide.pdf - DU-07757-001 September 2015”.