Product Documentation

Configure Xauthority

May 22, 2017

Environments that use interactive remoting using X11 display functionality (including xterm, gvim, etc.) are supported by the Linux VDA. This feature provides a security mechanism necessary to ensure secure communication between XClient and XServer.

There are two methods to secure permission for this secure communication:

  • Xhost. By default, Xhost allows only the localhost XClient to communicate with XServer. If you choose to allow a remote XClient to access XServer, the Xhost command must be executed to grant permission on the specific machine. Or, you can alternately use xhost + to allow any XClient to connect to XServer.
  • Xauthority. The Xauthority file can be found in each user's home directory and is used to store credentials in cookies used by xauth for authentication of XServer. Once an XServer instance (Xorg) is started, the cookie is used to authenticate connections to that specific display.

How it works

When Xorg starts up, an Xauthority file is passed to the Xorg. This Xauthority file contains the following elements:

  • display number
  • remote request protocol
  • cookie number

You can browse this file using the xauth command. For example:

command Copy

# xauth –f ~/.Xauthority

# > list

# > us01msip06:107  MIT-MAGIC-COOKIE-1  fb228d1b695729242616c5908f11624b

If XClient connects to the Xorg remotely, two prerequisites must be met:

  • Set the DISPLAY environment variable to the remote XServer.
  • Get the Xauthority file which contains one of the cookie numbers in Xorg.

Configure Xauthority

To enable Xauthority on the Linux VDA for remote X11 display, you must create the following two registry keys:   

command Copy

sudo /opt/Citrix/VDA/bin/ctxreg create -k "HKLM\System\CurrentControlSet\Control\Citrix\Xorg" -t "REG_DWORD" -v "XauthEnabled" -d "0x00000001" --force

sudo /opt/Citrix/VDA/bin/ctxreg create -k "HKLM\System\CurrentControlSet\Control\Citrix\Xorg" -t "REG_DWORD" -v "ListenTCP" -d "0x00000001" --force

After enabling Xauthority, pass the Xauthority file to XClient manually or by mounting a shared home directory:

  • Pass the Xauthority file to XClient manually

After launching an ICA session, the Linux VDA generates the Xauthority file (the filename is .Xauthority) for the XClient and stores the file in the logon user's home directory. You can copy this Xauthority file to the remote XClient machine, and set the DISPLAY and XAUTHORITY environment variables. DISPLAY is the display number stored in the Xauthority file and XAUTHORITY is the file path of Xauthority. For an example, see the following command:

command Copy

set DISPLAY={Display number stored in the Xauthority file}

set XAUTHORITY={the file path of .Xauthority}


If the XAUTHORITY environment variable is not set, the ~/.Xauthority file will be used by default.

  • Pass the Xauthority file to XClient by mounting a shared home directory
The convenient way is to mount a shared home directory for the logon user. When the Linux VDA starts an ICA session, the .Xauthority file is created under the logon user's home directory. If this home directory is shared with XClient, the user does not need to manually transmit this Xauthority file to XClient. After the DISPLAY and XAUTHORITY environment variables are set correctly, the GUI is displayed in XServer desktop automatically.


If Xauthority fails to work, follow the troubleshooting steps below:

1. As an administrator with root privilege, retrieve all of Xorg cookies:

command Copy

ps aux | grep -i xorg

This command displays the Xorg process and the parameters passed to Xorg while starting. Another parameter displays which Xauthority file is used. For example:

command Copy


Display the cookies using the Xauth command:

command Copy

Xauth -f /var/xdl/xauth/.Xauthority110

2. Use the Xauth command to show the cookies contained in ~/.Xauthority. For the same display number, the displayed cookies must be the same in the Xauthority files of Xorg and XClient.

3. If the cookies are the same, check the remote display port accessibility with the IP address of the Linux VDA (for example, and the published desktop display number (for example, 160).

Run the following command on the XClient machine:

command Copy

telnet 6160

The port number is the sum of 6000 + <display number>.

If this telnet operation fails, the firewall might be blocking the request.