• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Error: Can’t open display: hostname:x.y when running xclock

by admin

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"

Filed Under: CentOS/RHEL, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 7 : Unable To Start The Samba Service
  2. CentOS / RHEL : How to change the UUID of the filesystem
  3. Using vmstat to troubleshoot performance issues in Linux
  4. netstat Command Examples in Linux
  5. Passwordless SSH not working for local users on LDAP servers – CentOS/RHEL 7
  6. last Command Examples in Linux
  7. getfacl Command Examples in Linux
  8. How to uninstall rhythmbox-plugins from Ubuntu
  9. Permissions 0644 for ‘/home/username/.ssh/your_pem_file.pem:’ are too open
  10. After Reboot RAID1 Disk Gets Removed/Out of Sync (CentOS/RHEL)

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright