• 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. How to Switch Back To Previous Version of openjdk in CentOS/RHEL
  2. “yum update” fails with “[package version 1] is a duplicate with [package version 2]”
  3. CentOS / RHEL : How to backup/restore configuration using authconfig
  4. CentOS / RedHat : Beginners guide to log file administration
  5. grub-mkconfig Command Options
  6. Basic “chmod” Command examples in Linux
  7. YUM command examples to install, remove and upgrade packages
  8. Configure Persistent NIC Names of Network Adaptors in CentOS/RHEL using udev Rules
  9. Linux / UNIX : Examples of find command to find files with specific sets of permissions
  10. Ubuntu: Changing the stripe size of a striped LVM volume

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright