Cannot get DISPLAY or xclock to work remotely from windows system

Hi I am using redhat 2.6, I need to start the gui from putty (on other windows machine=

redhat server IP=
windows machine IP(putty installed)=,putty setting=enable x11 forwarding checked.

on redhat server I have run xhost +

[root@localhost log]# startx
Fatal server error:
Server is already active for display 0
        If this server is no longer running, remove /tmp/.X0-lock
        and start again.
Please consult the The X.Org Foundation support
         at http://wiki.X.Org
 for help.

[root@localhost log]# uname -a
Linux localhost.localdomain 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386 GNU/Linux


[root@localhost ~]# export DISPLAY=
[root@localhost ~]# echo $DISPLAY
[root@localhost ~]# /usr/X11R6/bin/xclock
Error: Can't open display:
[root@localhost ~]#
PLEASE HELP ME TO RESOLVE Error: Can't open display: .
Who is Participating?
Ricardo ElenaManager, US OperationsCommented:
Other way is to use
Putty and Xming
Xming is an X Window Server for Microsoft OS, you can find it here
install it, and when you run these app, and "X" icon will appear in you system tray neer the windows clock
then connect with putty and enable X Forwarding in your connection
done that you'll be able to run x applications from putty and see them on your windows desktop.
Some times you migth need to use these command "export DISPLAY=[your IP]:0.0"
Atul_FGSAuthor Commented:
Also my host files value is

[root@localhost ~]# cd /etc
[root@localhost etc]# ls -ltr host*
-rw-r--r--  1 root root 347 Jan 13  2000 hosts.deny
-rw-r--r--  1 root root 161 Jan 13  2000 hosts.allow
-rw-r--r--  1 root root  17 Jul 23  2000 host.conf
-rw-r--r--  1 root root   5 Nov  1  2004 hosts.canna
-rw-r--r--  1 root root 146 Oct 10 15:00 hosts
[root@localhost etc]# cat hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.       localhost.localdomain   localhost
[root@localhost etc]# cat hosts.allow
# hosts.allow   This file describes the names of the hosts which are
#               allowed to use the local INET services, as decided
#               by the '/usr/sbin/tcpd' server.

[root@localhost etc]# cat hosts.deny
# hosts.deny    This file describes the names of the hosts which are
#               *not* allowed to use the local INET services, as decided
#               by the '/usr/sbin/tcpd' server.
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow.  In particular
# you should know that NFS uses portmap!
do you have X windows running on your windows pc ?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Atul_FGSAuthor Commented:

[root@localhost etc]# ps axl|grep -w X
4     0  4363  4279  15   0 20452 16336 -     S    ?          0:01 /usr/X11R6/bin/X :0 -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7
4     0  6527  6431  16   0  3704  696 pipe_w S+   pts/5      0:00 grep -w X
[root@localhost etc]#

Open in new window

Atul_FGSAuthor Commented:
hI omarfarid
---do you have X windows running on your windows pc ?
How to check this?
I am using putty on windows not sure if x windows is there on windows.
putty is just a telnet/ssh client.  In order to display X applications, you need to run a X server on your Windows PC.  There's plenty to choose from, but a good free one is Cygwin/X.

As Tintin commented, putty is a command line ssh client. You need to install X Windows on your PC. You could use free X windows like cygwin/X or use commercial one like X-Win32 or Exceed.

Atul_FGSAuthor Commented:
Issue resolved thanx I am able to see xclock.
I installed Xming  and configured it from the below link

just one last question how to I get complete gui interface for linux server,i.e logon screen.

also can I open KBOUNCE remotely from windows machive in same fashion,if yes than how?

You need to use XDMCP for login screen.

See for details.
Ricardo ElenaManager, US OperationsCommented:
Atul_FGSAuthor Commented:
Hi Ricardoelena,

I have made all changes as per
except the last one "The system needs to run in init level 5 (/etc/inittab)."
please let me know hoe to changes this.
attached my (/etc/inittab).
[root@localhost ~]# vi /etc/inittab
# inittab       This file describes how the INIT process should set up
#               the system in a certain run-level.
# Author:       Miquel van Smoorenburg, <>
#               Modified for RHS Linux by Marc Ewing and Donnie Barnes
# Default runlevel. The runlevels used by RHS are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
# System initialization.
l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
# When our UPS tells us power has failed, assume we have a few minutes
# of power left.  Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly.
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon

Open in new window

Ricardo ElenaManager, US OperationsCommented:
its done allready in line 19 you setup the init level you want "id:[init level]:initdefault:"
the way you have it is for init level 5 "id:5:initdefault:"
Atul_FGSAuthor Commented:
Thanks all for the help.:-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.