VMware Horizon Community
JustinGrove
Contributor
Contributor
Jump to solution

RHEL8 Issue with /bin/tcsh

System information:

  • RHEL8
  • Horizon 2309
  • Agent Versions 8.11 and 8.9

Seeing a similar issue to this thread: Solved: Horizon 2111 Linux RHEL7 VDI issue with /bin/tcsh - VMware Technology Network VMTN

Users with a default shell of /bin/tcsh are not having the .cshrc run if they SSH to a host with Horizon installed AND their SSH client does not set the DISPLAY variable. If they do use a SSH client that sets the DISPLAY variable by default (MobaXterm for example), the .cshrc is run.

If using something like Cygwin or Windows CMD SSH, with no DISPLAY variable set, the message "DISPLAY: Undefined variable." is shown in the terminal and the .cshrc is never sourced automatically.

We have traced this back to the file /etc/profile.d/vmware-lang.csh

If we rename that file then the .cshrc is sourced correctly from the SSH client with no DISPLAY variable set. It seems the solution to the thread referenced above was folded into the Horizon Agent software but we are still seeing the .cshrc issue.

Is vmware-lang.csh required? I renamed the file and my Horizon client still connects to the host just fine. Why does this script fail completely if no DISPLAY variable is set when SSH'ing to the host? And after the script fails, why does it cause .cshrc not to be sourced?

My vmware-lang.csh below:

###################################################
# Copyright 2022 VMware, Inc. All rights reserved.
###################################################

# Re-export DISPLAY
if ( $DISPLAY =~ 127.0.0.1:* ) setenv DISPLAY ${DISPLAY:s/127.0.0.1//}
if ( $DISPLAY =~ *.* ) setenv DISPLAY `echo $DISPLAY | cut -d '.' -f 1`

# Set remote language to the desktop
set desktopInfoFile="/var/vmware/vmw_desktop/vmw_desktopid.${DISPLAY:s/://}"
if ( -f "$desktopInfoFile" ) then
set language=`grep -i -m1 "LANG=" $desktopInfoFile` && setenv ${language:s/=/ /}
unset language
endif

unset desktopInfoFile

0 Kudos
1 Solution

Accepted Solutions
Hangl
VMware Employee
VMware Employee
Jump to solution

For non-Horizon sessions, the /etc/profile.d/vmware-lang.csh file is not needed.

I'm guessing tcsh stops processing profile(s) when it encounters an error, similar to bash `set -e`.

You can add the following line as the first line of code in /etc/profile.d/vmware-lang.csh. It would work properly for both Horizon and non-Horizon sessions.

if ( ! $?DISPLAY ) exit

 

View solution in original post

0 Kudos
3 Replies
Hangl
VMware Employee
VMware Employee
Jump to solution

For non-Horizon sessions, the /etc/profile.d/vmware-lang.csh file is not needed.

I'm guessing tcsh stops processing profile(s) when it encounters an error, similar to bash `set -e`.

You can add the following line as the first line of code in /etc/profile.d/vmware-lang.csh. It would work properly for both Horizon and non-Horizon sessions.

if ( ! $?DISPLAY ) exit

 

0 Kudos
JustinGrove
Contributor
Contributor
Jump to solution

Thank you @Hangl , this did fix the issue I was having. We'll manage this file in our CM tool for now. Do you think we might see this added to a future agent release?

0 Kudos
Hangl
VMware Employee
VMware Employee
Jump to solution

Sure, I will include the fix in the next release, which is expected to be Horizon 8.13.