Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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:192.168.0.111  Bcast:192.168.0.255  Mask:255.255.255.0
$ ping 192.168.0.222

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

$ xclock -display 192.168.0.111:0

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 192.168.0.222:0

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

$ xclock -display 192.168.0.111:0.1
Error: Can't open display: 192.168.0.111:0.1
$ ping 192.168.0.333
ping: unknown host 192.168.0.333
$ xclock -display 192.168.0.333:0

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

2 Answers 2

up vote 2 down vote accepted

On my computer (111):

ssh -X 192.168.0.222

followed simply by:

xclock

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

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 0.0.0.0:6000            0.0.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

[security]
DisallowTCP=false

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

Your Answer

 
discard

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.