Monday, June 06, 2005

Exporting sound and display in linux

Hi,
well, i knew long ago how to export a display from a remote terminal. this helps to get display for graphical applications that one may want to run on remote machines.

At the end where you are sitting (server) the thing that you have to do is

$ xhost +
which will disable access control and any client can connect to the running X server.

at the client side ( where you have remotely logged in )

$ export DISPLAY="servername:terminal"

terminal numbers start from 0.0.
If you are not sure of which terminal you are using just run the following command on the server

$ echo $DISPLAY

which will give you the terminal number that you should be using at the client side.

Alternatively, a very simple method for doing all this in just one shot is that while logging in to a remote machine

# ssh -X remotemachine

this will do all the above mentioned thing for you.

for sound also the procedure is the same.

on server
# artsd -p portnumber -u

you can select any portnumber which is greater than 1024 and not already in use by some another application. -u will disable the access control. for more options
# artsd -h
this will provide you all the available options for arts deamon.

whereas on the client side
# export ARTS_SERVER="servername:portnumber"

you can also provide IP addresses instead of giving names in the environment variables.

If your mplayer still does not produce sound than you should check which audio output mathod it is using. one can specify a particular audio output mathod using

# mplayer -ao arts filename

Now, you can login to remote machines and enjoy the songs/movies etc. :-)

No comments: