Automatically configuring the DISPLAY environment variable
With X-Win32 you do not have to set the $DISPLAY environment variable in your login scripts (e.g. .bashrc, .cshrc, or .profile) on your remote UNIX, Linux, or BSD hosts (e.g. Red Hat, SuSE, Debian, Ubuntu, HP-UX, AIX, or Solaris) in order for the program in the command field of your X-Win32 sessions to work. In fact, setting this environment variable in your login scripts will most likely cause your X-Win32 sessions to work only when you connect from one of your Windows machines.
There are two different tactics for avoiding setting the $DISPLAY environment variable, depending on the type of session that you are using.
Avoiding setting $DIPSLAY for rexec and rsh sessions
- If your remote host is on the same network (i.e. there are no firewall or network address translation (NAT) devices between your two hosts) as your X-Win32 machine, then simply add the -display $DISPLAY command-line parameter to your X-Win32 sessions using X-Config, then remove all traces of setting $DISPLAY from your login scripts.
- If there is a firewall or NAT device between the two computers and the remote computer is on the public Internet, then you can use X-Win32’s IPSmart facility to find the address of your NAT device; to do this, simply add the -display $IPSMART:$DNUM command-line paramter to your X-Win32 sessions using X-Config, then remote all traces of setting $DISPLAY from your login scripts. If all of your sessions function this way, then you can instead change the address in X-Config’s Display tab to IPSmart, which will cause -display $DISPLAY to return the IPSmart address.
- For newly created sessions, be sure to use the Wizard button in X-Config’s Sessions tab to create each session. The Session Wizard automatically adds the -display $DISPLAY command-line parameter to new rsh and rexec sessions that start xterm or dtterm.
Avoiding setting $DISPLAY for StarNetSSH sessions
- If you are not using X11 Forwarding with your StarNetSSH sessions (e.g. because it is disabled in sshd_config on the remote host), then you should first and foremost turn this feature on as it will automatically set the $DISPLAY environment variable on the remote host for you, without the need to pass -display [...] on the command-line to your sessions.
- If you are using X11 Forwarding with your StarNetSSH sessions but the $DISPLAY environment variable seems to be incorrect (noted by a cannot open display error when starting your StarNetSSH sessions) then you need to double-check your login scripts to be sure that they are not setting the $DISPLAY environment variable and thus overriding the value that sshd is setting it to.
Category:Sessions -> rexec
Category:Sessions -> rsh
Cateogry:Sessions -> StarNetSSH

Solutions