How to display xclock on another computer?

74,772

Solution 1

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)

Solution 2

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.

Solution 3

And you can do simplest :)

$ ssh -X 192.168.0.222 "xclock"
Share:
74,772

Related videos on Youtube

CW Holeman II
Author by

CW Holeman II

You may have just discovered a dozen VMS posts today, but up voting them together causes all of the votes to be deleted. C++17 and XSLT: Aptcp C++ and I18N: Ask Library (C++) Perl, Javascript, XUL: Stevedore - DocWorker JavaScript, SVG, DOM, XML and XSLT: Emle - Electronic Mathematics Laboratory Equipment documentation VAX FORTRAN: SDSU_AskLib VMS, VAXELN, RSX-11M/M+, C, DCL, TCL/Tk, Scala OpenHub/cwhii Resume Windows NT looks like MS-Windows with features from VMS but in its heart it is like VAXELN...ZuckOS

Updated on September 18, 2022

Comments

  • CW Holeman II
    CW Holeman II almost 2 years

    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.

  • CW Holeman II
    CW Holeman II almost 12 years
    '/etc/lightdm/lightdm.conf and add xserver-allow-tcp=true ' for LXDE from askubuntu.com/questions/72812/how-to-disable-nolisten