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:

How to make X.org listen tcp port to remote connections?

share|improve this question
    
Is Xwindows running? It's extremely unlikely that you will solve your problem with a current Ubuntu release with a 8 year old solution for a Redhat release. Be that as it may, this appears to be related: superuser.com/questions/310197/… – Elder Geek Jul 29 '16 at 17:03
    
It would be useful if you added a couple of lines of context above and below where you inserted the 2 additional lines so that folk can see where to make the changes. – Mark Setchell Mar 27 '17 at 9:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.