====== Display server ====== Those are the instructions to setup what I call a display server : an X window system waiting an a screen to display whatever you would like. What is this for? If I say remotely controlling ''mplayer'' with no GUI on the machine connected to your TV using your wireless laptop? That's how I use it, and it is nice. This setup uses a dedicated user to run the X server at the machine startup and does not involve the installation of a window manager. ===== Packages ===== You obviously need X to run on the machine. I won't go into the details of the X configuration since this is already covered on numerous websites. # aptitude install x-window-system-core ===== Dedicated user ===== To make things clean, I added a system user (''xserver'') that will own the ''X'' process. The selected home directory will hold some configuration. # adduser --system --home /var/lib/xserver --ingroup video --disabled-password xserver ===== Initscript ===== I used the Debian skeleton init script as a base. This ''/etc/init.d/xserver'' script is to load X at startup using our ''xserver'' user. To take advantage of all the session stuff that is done by ''startx'', I used a slightly modified version of the script with static cookie generation (i.e. the X session cookie is only generated if it does not exist) instead of the ''X'' executable. Put the {{xserver.init.d.txt|X init script}} as ''/etc/init.d/xserver''. Put the {{xserver.txt|modified ''startx''}} as ''/var/lib/xserver/xserver''. Next is updating the init symbolic links. I used the same parameters that are used to make ''gdm'' load at startup. # chmod +x /etc/init.d/xserver /var/lib/xserver/xserver # update-rc.d xserver defaults 99 01 For the init script to be allowed to run the X server, you must allow anybody to start ''X'', not just people that own a local console (''tty''). You may change that setting by editing ''/etc/X11/Xwrapper.config'' or by issuing the following command : # dpkg-reconfigure xserver-common Or, if you use the newer modular X.org : # dpkg-reconfigure x11-common ===== Cosmetics ===== To make things look nice, and to actually have an X client connected to the display, I added a background picture and transparent apache logs to the setup. # aptitude install xloadimage xrootconsole ''/var/lib/xserver/.xsession'' : xloadimage -onroot -quiet -fullscreen /var/lib/xserver/debianbg.jpg exec xrootconsole -bg white -geometry 250x80+50+50 /var/log/apache2/access.log ===== From your username ===== The problem with this is that only the ''xserver'' user is allowed to run X applications (X clients). Using the MIT Magic cookie method, you choose who may run X clients. Launching ''X'' once (using ''/etc/init.d/xserver start'') creates a cookie in ''/var/lib/xserver/.Xauthority''. Simply copy it in your home directory and you are allowed to display on ''xserver'''s X server. # cp /var/lib/xserver/.Xauthority /home/you # chown you /home/you/.Xauthority ===== Clients ===== If you ssh to your new Display server, you may now dipslay X clients either by setting the ''$DISPLAY'' variable or by configuring your client. For ''mplayer'', add in ''/etc/mplayer.conf'' : vo=xv display=:0.0