The Problem
Unable to launch xclock window using the below command for one particular normal user. xclock is fine with the root user.
$ xclock Error: Can't open display: [hostname]:x.y
The Solution
Incorrect user level environment variables set under the file /home/[username]/.bash_profile.
Follow the below steps to fix the issue.
1. Log in as a normal user.
2. Comment out all the user specific env variables under the file /home/[username]/.bash_profile.
3. Launch VNC console.
4. Execute xclock command & check (Note: This is not an exclusive cause & solution, but one of the possible ones.)
For Example:
Issue got fixed after commenting out below lines from the file /home/[username]/.bash_profile.
$ cat /home/[username]/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs export DISPLAY=xxx.xxx.xxx.xxx:4.0 export TMPDIR=/opt/tmp export TEMP=/opt/tmp export TMP=/opt/tmp export PATH=$PATH:$HOME/bin . /d01/oracle/RDBA/EBSapps.env export PATCH_TOP=/d01/oracle/RDBA/fs_ne/EBSapps/patch export CONFIG_JVM_ARGS="-Xms1024m -Xmx2048m"