Posts Tagged ‘xorg’

Hi all,

today i want to talk about a interesting feature of a xserver. Using linux (or bsd, etc) we discovered how is very powerful using ssh to work on another server. A command line shell (bash for me) is the most usage program for a system administrator, and it has a big suite of tools and programs to avoid any graphical needs.

But some cases may required to use a program who needs X to run. So in those cases we have two choices: setup X on server and use a remote/share desktop program or use X throu the net.

It is very simple: first of all, you needs a pc with xorg (or xfree) with listener for tcp.

$ ps aux | grep X

show you the situation.

root      3001  2.9  6.2 211968 129320 tty7    Ss+  08:36   0:55 /usr/bin/X -br -nolisten tcp :0 vt7 -auth /var/run/xauth/A:0-5QdGTF

In my case, I see X is running without listening its tcp port, so we have to found where are stored the option of X.

– Step one:

$ cd /etc

$ grep ‘listen’ -r *

is a way to find it. For me is in /etc/kde4/kdm/kdmrc.Then open the file and remove the option ‘-nolisten tcp’.

Now we have to restart the X server: make logout, access by a tty, restart our login manager, back to tty. Before proceed, we check if X is running correctly, as the beginning

$ ps aux |grep X

root      3001  2.9  6.2 211968 129320 tty7    Ss+  08:40   0:55 /usr/bin/X -br :0 vt7 -auth /var/run/xauth/A:0-5QdGTF

The result may be something like this. Using netstat we could see the port of xserver

$ netstat -nptl | grep 6000

tcp     0   0*      LISTEN    1535/X

Well, if that is what we get, the first step is finished.

REMEMBER: next steps needs to be repeated every time you, but they are very simple do not fear.

– Step two:

On our pc, the one with xserver in listening,  we have to allow other servers to connect to our xserver.

Someone use the following command:

$ xhost +

This one, enable everyone to connect to our pc…. may be not a good idea.

$ xhost +

In this way, we enable only the server with ip… a right way to do that.

– Step three:

We have to connect throu ssh to the server, in example case

$ ssh

user@ export DISPLAY=

The second row is on server. We have to tell it which is the pc with X, in example is

Well now you can start your graphical program on server with echo on your pc.

For example:

user@ kwrite notsobad.txt

I hope you enjoy about that.