Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to display xclock on another computer.

On my computer (111) I am able to ping the other computer (222) inside my home network:

$ ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 44:55:66:77:88:99  
          inet addr:  Bcast:  Mask:
$ ping

The router is a D-Link DIR-655 Wireless N Gigabit Router.

$ xclock -display

Displays the xclock on my computer (111) as expected. On the other computer (222):

$ xhost +

But then back on my computer (111) it also displays on my computer when changed to:

$ xclock -display

To attempt to verify the use of the -display switch:

$ xclock -display
Error: Can't open display:
$ ping
ping: unknown host
$ xclock -display

I would expect it to fail but it also displays on my computer (111) but with a bit of a delay. These results tells me that the display argument is getting to xclock.

$ uname -a
 Linux mycomputer 3.2.0-27-generic #43-Ubuntu SMP Fri Jul 6 14:46:35 UTC 2012 i686 i686 i386 GNU/Linux

I am using LXDE rather than GNOME or KDE.

I am only attempting to get xclock to display and am not interested in addressing security issues in this question.

share|improve this question

Two things to check for: Port 6000 needs to be open on the 222 machine (configure or disable the firewall), and the X server itself needs to be listening on that port. This is often disabled in modern distros. Check if it's listening with

# netstat -nltp | grep 6000
tcp        0      0  *               LISTEN      10818/Xorg          
tcp6       0      0 :::6000                 :::*                    LISTEN      10818/Xorg          

If not, you can enable it for gdm in /etc/gdm/custom.conf


Logout/restart gdm on the 222 machine and log in again. You should then see Xorg listening on port 6000.

share|improve this answer
'/etc/lightdm/lightdm.conf and add xserver-allow-tcp=true ' for LXDE from askubuntu.com/questions/72812/how-to-disable-nolisten – C.W.Holeman II Aug 9 '12 at 20:53
up vote 3 down vote accepted

On my computer (111):

ssh -X

followed simply by:


will run xclock on the other computer (222) and display on my computer (111).

Note: For this to work X11Forwarding should be enabled in /etc/ssh/sshd_config at computer (222)

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.