when I give the command
xclock
I get the error
Error: Can't open display: hostname:0.0
In the following page
https://www.redhat.com/archives/redhat-list/2007-April/msg00299.html
the solution given for redhat linux is
Modify the file /etc/X11/gdm/gdm.conf and set DisallowTCP=false. Then restart X. This will enable the X server to receive network connections. You will also need to make a hole in the firewall to allow connections to the X server port (6000 IIRC).
However I cannot find /etc/X11/gdm in Ubuntu
What to do?
Update:
What I did was:
vim /etc/init/lightdm.conf
and added the following lines
xserver-allow-tcp=true
xserver-command=X -listen tcp
Then I rebooted my system.
My problem has now been solved.
When I give the command
xclock
now, a nice clock opens
source: