Where can I find X command examples


Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Where can I find X command examples

  1. #1
    Join Date
    Jul 2003
    Posts
    2,021

    Where can I find X command examples

    Hi folks,


    Where can I find article/guide on X command with examples. Not many discovery found on googling other than;

    Commands Reference, Volume 6
    http://www.ncsa.uiuc.edu/UserInfo/Re...aixcmds6/X.htm

    Linux / Unix x command
    http://www.computerhope.com/unix/ux.htm


    Pointer would be appreciated. TIA


    B.R.
    satimis

  2. #2
    Join Date
    Jun 2006
    Location
    Haarlem, Holland
    Posts
    129
    you can type
    man x
    but I think that is not what you want.
    What do you want to know about x
    personally I don't know a lot about it, other than that I got it running

  3. #3
    Join Date
    Jan 2007
    Posts
    280
    From the horse's mouth. (link) (link).

    Like you already said, Googling didn't turn up much...
    Last edited by i845_; 09-01-2008 at 05:38 PM.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,021
    H folkert and i845,


    Thanks for your advice.


    This is a virtual machine.

    On guest
    T forward X of host based on hostname, size of window, keyboard, etc. So that X application on guest, e.g. Firefox, can be evoked running on X window of host. The guest is a headless server without X. Host has full X running including Gnome desktop


    I did following test;

    ssh connect the Host

    # ssh 192.168.0.110 (Host local IP)


    # netstat -plnu | grep :177

    No printout.

    gdm is running on Host.


    # X -query 192.168.0.110 :2

    A full screen is displayed without anything on it. Mouse pointer can
    be moved around. No key operation works. Neither can I escape to
    close the screen.

    Thanks


    B.R.
    satimis
    Last edited by satimis; 09-01-2008 at 07:19 PM.

  5. #5
    Join Date
    Sep 1999
    Posts
    3,202
    You need to enable XDMCP on the headless box, or ssh in and export your display out...

  6. #6
    Join Date
    Jul 2003
    Posts
    2,021
    Quote Originally Posted by ph34r
    You need to enable XDMCP on the headless box, or ssh in and export your display out...
    Hi ph34r,


    Could you please explain in more detail. TIA


    B.R.
    satimis

  7. #7
    Join Date
    Sep 1999
    Posts
    3,202
    Sure... in your /etc/gdm/gdm.conf, look for the section that starts with
    Code:
    [xdmcp]
    On my Ubuntu 8.04 box, it is on line 306...

    Anyway, below that you'll find
    Code:
    Enable=false
    And further below that, the port to listen on (177 is the default). Change the false to true (for enable) and uncomment the port # line, and then restart gdm. You can then open a virtual terminal (or use Xnest) and query the headless box, and get a graphical login screen.
    Code:
    X :1 -query ip.or.host.of.headless.box
    or
    Code:
    Xnest :1 -query ip.or.host.of.headless.box
    To escape out of the login prompt, simply kill the X server session with CTRL+ALT+BACKSPACE, or just quit Xnest with the close button (it is a "normal" windowed app that happens to be an X server). If you use XDMCP, from a windows box you can install cygwin-x and have a win32 xserver and do the same thing...



    To just run a single app via ssh and tunneling, connect like:
    Code:
    ssh -CY user@headless.box
    And login as normal. Then start whatever app you want. Another option is to use passwordless ssh keys, and create launchers that would have something like
    Code:
    ssh -CY user@headless.box firefox
    or
    Code:
    ssh -CY user@headless.box gedit
    Last edited by ph34r; 09-03-2008 at 09:49 AM.

  8. #8
    Join Date
    Jul 2003
    Posts
    2,021
    Quote Originally Posted by ph34r
    Sure... in your /etc/gdm/gdm.conf, look for the section that starts with
    Code:
    [xdmcp]
    On my Ubuntu 8.04 box, it is on line 306...
    Hi ph34r,


    That is all I have on /etc/gdm/gdm.conf

    $ cat /etc/gdm/gdm.conf
    Code:
    # GDM Configuration Customization file.
    #
    # This file is the appropriate place for specifying your customizations to the
    # GDM configuration.   If you run gdmsetup, it will automatically edit this
    # file for you and will cause the daemon and any running GDM GUI programs to
    # automatically update with the new configuration.  Not all configuration
    # options are supported by gdmsetup, so to modify some values it may be# necessary to modify this file directly by hand.
    #
    # Older versions of GDM used the "gdm.conf" file for configuration.  If your
    # system has an old gdm.conf file on the system, it will be used instead of
    # this file - so changes made to this file will not take effect.  Consider
    # migrating your configuration to this file and removing the gdm.conf file.
    #
    # To hand-edit this file, simply add or modify the key=value combination in
    # the appropriate section in the template below.  Refer to the comments in the
    # /usr/share/gdm/defaults.conf file for information about each option.  Also
    # refer to the reference documentation.
    #
    # If you hand edit a GDM configuration file, you should run the following
    # command to get the GDM daemon to notice the change.  Any running GDM GUI
    # programs will also be notified to update with the new configuration.
    #
    # gdmflexiserver --command="UPDATE_CONFIG <configuration key>"
    #
    # e.g, the "Enable" key in the "[debug]" section would be "debug/Enable".
    #
    # You can also run gdm-restart or gdm-safe-restart to cause GDM to restart and
    # re-read the new configuration settings.  You can also restart GDM by sending
    # a HUP or USR1 signal to the daemon.  HUP behaves like gdm-restart and causes
    # any user session started by GDM to exit immediately while USR1 behaves like
    # gdm-safe-restart and will wait until all users log out before restarting GDM.
    #
    # For full reference documentation see the gnome help browser under
    # GNOME|System category.  You can also find the docs in HTML form on
    # http://www.gnome.org/projects/gdm/
    #
    # NOTE: Lines that begin with "#" are considered comments.
    #
    # Have fun!
    
    [daemon]
    
    [security]
    
    [xdmcp]
    
    [gui]
    
    [greeter]
    
    [chooser]
    
    [debug]
    
    # Note that to disable servers defined in the defaults.conf file (such as
    # 0=Standard, you must put a line in this file that says 0=inactive, as# described in the Configuration section of the GDM documentation.
    #
    [servers]
    
    # Also note, that if you redefine a [server-foo] section, then GDM will# use the definition in this file, not the defaults.conf file.  It is
    # currently not possible to disable a [server-foo] section defined
    # in the defaults.conf file.

    satimis

  9. #9
    Join Date
    Sep 1999
    Posts
    3,202
    Read the first few sentences of the file... you can run gdmsetup and have a nice gui for configuring all of this...

    so, connect via ssh first to do it...
    Code:
    ssh -CY root@headless.box gdmsetup

  10. #10
    Join Date
    Jul 2003
    Posts
    2,021
    Quote Originally Posted by ph34r
    Read the first few sentences of the file... you can run gdmsetup and have a nice gui for configuring all of this...

    so, connect via ssh first to do it...
    Code:
    ssh -CY root@headless.box gdmsetup
    Hi ph34r,


    Thanks for your advice.


    I think I have to explain in more detail of what I'm prepared to achieve.


    The PC is a Virtual Machine

    Host - Debian Etch, with full X packages installed including Gnome desktop (it can be considered as remote machine)

    Guest - Debian Etch, headless server w/o X packages installed (it can be considered as local machine)

    They are running on the same box.


    What I'm trying to do;
    1)
    on local machine ssh forward X of the remote machine and display the same on local machine. Firefox or other applications running on remote machine can be evoked on local machine.

    2)
    Can GUI package such as Firefox installed on the local machine be evoked/run on the X-window of the remote machine and displayed on the local machine (guest)



    On 2 boxes with X packages installed I can manage to forward X of box-2 to box-1 evoking applications on box-2 on the X-window forwarded/displayed on box-1 without problem and vice versa.


    Now the local machine (guest) is without X packages installed. Can I forward X of the remote machine (host) to local machine?


    On my posting #4 above I installed xorg and xserver-xorg-core on the local machine. Therefore I can forward X of the remote machine to local machine. Now I have them deleted, no X packages running on local machine.


    Coming back to my problem on #8 above, I performed following test;

    On remote machine (Host);
    ===============

    # gdmsetup
    Code:
    Launching a SCIM daemon with Socket FrontEnd...
    Loading simple Config module ...
    Creating backend ...
    Loading socket FrontEnd module ...
    Starting SCIM as daemon ...
    GTK Panel of SCIM 1.4.4
    'Login Window Preferences' window started

    -> Security
    Security
    [check] Allow local system administrator login

    No other change made. All items there retained as default.


    Logout and relogin

    $ cat /etc/gdm/gdm.conf
    Code:
    .....
    [security]
    AllowRoot=true
    
    [greeter]
    GraphicalThemedColor=#76848f
    
    [daemon]
    
    [xdmcp]
    
    [gui]
    
    [chooser]
    
    [debug]
    
    [servers]

    manually added
    [xdmcp]
    Enable=false


    # grep X11Forwarding /etc/ssh/sshd.conf
    Code:
    X11Forwarding yes


    On local machine (guest)
    =============

    # ssh -CY satimis@192.168.0.110 gedit
    Code:
    satimis@192.168.0.110's password:
    Warning: No xauth data; using fake authentication data for X11 forwarding.
    connect /tmp/.X11-unix/X0: No such file or directory
    The application 'gedit' lost its connection to the display localhost:10.0;
    most likely the X server was shut down or you killed/destroyed
    the application.

    Would the problem be accountable to without X packages installed on local machine (guest)?


    Thanks


    B.R.
    satimis

  11. #11
    Join Date
    Sep 1999
    Posts
    3,202
    When you launch ssh, you need to tell it to allow connections to the X server you are looking at:

    ssh -CY user@box firefox

    The -C compresses data, the Y allows X connections. Your sshd.conf file won't have any effect on this.

    If you re-run the gdmsetup, there is an option to enable querying. I think this is what you want to do, so you can load a whole desktop from the headless box.

  12. #12
    Join Date
    Jul 2003
    Posts
    2,021
    Quote Originally Posted by ph34r
    When you launch ssh, you need to tell it to allow connections to the X server you are looking at:

    ssh -CY user@box firefox

    The -C compresses data, the Y allows X connections. Your sshd.conf file won't have any effect on this.

    If you re-run the gdmsetup, there is an option to enable querying. I think this is what you want to do, so you can load a whole desktop from the headless box.
    Hi ph34r,


    Performed following test;

    On remote machine (Host)


    # gdmsetup

    -> Security

    It was found.
    [check] Deny TCP connection to Xserver
    Disables X forwarding, but does not affect XDMCP

    uncheck it.


    On local machine (Guest)
    # ssh -CY satimis@192.168.0.110 gedit
    Code:
    The authenticity of host '192.168.0.110 (192.168.0.110)' can't be established.
    RSA key fingerprint is 92:4e:32:48:c9:8e:28:4c:f6:e1:c6:9d:5a:bb:a9:53.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '192.168.0.110' (RSA) to the list of known hosts.
    satimis@192.168.0.110's password:
    cannot open display: (null)
    Run 'gedit --help' to see a full list of available command line options.
    Still failed. The password is correct.


    B.R.
    satimis

  13. #13
    Join Date
    Sep 1999
    Posts
    3,202
    Ok... on the machine that has the X server running locally, you connect via ssh like you showed in your last post. The error message you got is because you don't have a local X sever...

  14. #14
    Join Date
    Jul 2003
    Posts
    2,021
    Quote Originally Posted by ph34r
    Ok... on the machine that has the X server running locally, you connect via ssh like you showed in your last post. The error message you got is because you don't have a local X sever...
    Hi ph34r,


    I fully understand that problem. What I'm trying to explore is to forward X to the machine without local X server running. I have no problem to forward X on 2 workstations.

    B.R.
    satimis

  15. #15
    Join Date
    Sep 1999
    Posts
    3,202
    You need to have a X server to handle X clients. In this client/server relationship, the server handles displaying stuff and interpreting keyboard/mouse. The clients are the applications....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •